UI/商品资料窗口/类别更名窗体.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using 收银系统.Data;

namespace 收银系统.UI.商品资料窗口
{
    /// <summary>
    /// 更新类别事件的委托
    /// </summary>
    public delegate void 更新类别事件委托();

    public partial class 类别更名窗体 : Form
    {
        /// <summary>
        /// 类别名称改变事件
        /// </summary>
        public event 更新类别事件委托 类别名称改变;

        /// <summary>
        /// 传递要更名的类别的名称;
        /// </summary>
        public string 类别名称 { get; set; }

        private 商品资料 商品资料表;

        public 类别更名窗体()
        {
            InitializeComponent();
        }

        private void 类别更名窗体_Shown(object sender, EventArgs e)
        {
            商品资料表 = new 商品资料();

            label2.Text = 类别名称;
        }

        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            TextBox tx1 = (TextBox)sender;

            if (e.KeyCode == Keys.Enter)
            {
                if (tx1.Text.Trim() == "")
                {
                    MessageBox.Show("类别名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }
                else if (tx1.Text == 类别名称)//同名
                {
                    MessageBox.Show("类别名称无改变!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }
                else
后面还有 39 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。