Exemple #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            var cti = new CategoryInfo
            {
                CatName = txtCName.Text,
                CatNum  = txtCNum.Text,
                Remark  = txtCRemark.Text
            };

            if (CheckTextBox())
            {
                if (this._tp == 1)//新增
                {
                    cti.DelFlag = 0;
                    cti.Subtime = DateTime.Now;
                }
                else if (this._tp == 2)//修改
                {
                    cti.CatId = Convert.ToInt32(labId.Text);
                }

                var bll = new CategoryInfoBLL();
                var msg = bll.SaveCategoryInfoBLL(cti, _tp) ? "操作成功" : "操作失败";
                MessageBox.Show(msg);
                this.Close();
            }
        }