示例#1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            CategoryInfoBLL bll = new CategoryInfoBLL();
            CategoryInfo    c   = new CategoryInfo();

            c.CName   = txtName.Text;
            c.CNum    = Convert.ToInt32(txtNum.Text);
            c.CRemark = txtNum.Text;
            if (CheckEmpty())
            {
                if (Temp == 1)//新增
                {
                    c.DelFlag = 0;
                    c.SubTime = DateTime.Now;
                    c.SubBy   = 1;
                }
                else if (Temp == 2)//修改
                {
                    c.CId = Convert.ToInt32(labId.Text);
                }
                string strMsg = bll.AddOrUpdateCategoryInfo(c, Temp) ? "操作成功" : "操作失败";
                msg.MsgDivShow(strMsg, 1, Bind);
            }
        }