コード例 #1
0
 private void Update_ChucVu()
 {
     Class.Danhmuc_Chucvu dm = new Class.Danhmuc_Chucvu();
     dm.PositionCode = txtCode.Text;
     dm.PositionName = txtName.Text;
     dm.IsManager    = checkActive.Checked;
     dm.Description  = txtDescription.Text;
     dm.Active       = checkActive.Checked;
     if (txtCode.Enabled == true)
     {
         if (dm.Insert())
         {
             Class.App.SaveSuccessfully();
         }
         else
         {
             Class.App.SaveNotSuccessfully();
         }
     }
     else
     {
         if (dm.Update())
         {
             Class.App.SaveSuccessfully();
         }
         else
         {
             Class.App.SaveNotSuccessfully();
         }
     }
     if (_reCallFunction == "frmDanhMuc_ChucVu")
     {
         (this.Owner as frmDanhMuc_ChucVu).GetAllList_Position();
     }
 }
コード例 #2
0
 private void btnUpdateNew_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Length < 1)
     {
         Class.App.InputNotAccess();
         return;
     }
     Class.Danhmuc_Chucvu dmcv = new Class.Danhmuc_Chucvu();
     dmcv.PositionCode = txtCode.Text;
     dmcv.PositionName = txtName.Text;
     dmcv.IsManager    = checkIsManager.Checked;
     dmcv.Description  = txtDescription.Text;
     dmcv.Active       = checkActive.Checked;
     if (txtCode.Enabled == true)
     {
         if (dmcv.Insert())
         {
             Class.App.SaveSuccessfully();
         }
         else
         {
             Class.App.SaveNotSuccessfully();
         }
     }
     else
     {
         if (dmcv.Update())
         {
             Class.App.SaveSuccessfully();
         }
         else
         {
             Class.App.SaveNotSuccessfully();
         }
     }
     // xac dinh du lieu co thay doi de reload form danh muc.
     (this.Owner as frmDanhMuc_ChucVu).GetAllList_Position();
     txtCode.Enabled     = true;
     txtName.Text        = "";
     txtDescription.Text = "";
     this.Text           = "Thêm chức vụ";
     txtCode.Text        = call_Code_New();
 }
コード例 #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (txtName.Text.Length < 1)
            {
                Class.App.InputNotAccess();
                return;
            }
            Class.Danhmuc_Chucvu dmcv = new Class.Danhmuc_Chucvu();
            dmcv.PositionCode = txtCode.Text;
            dmcv.PositionName = txtName.Text;
            dmcv.IsManager    = checkIsManager.Checked;
            dmcv.Description  = txtDescription.Text;
            dmcv.Active       = checkActive.Checked;
            if (txtCode.Enabled == true)
            {
                if (dmcv.Insert())
                {
                    Class.App.SaveSuccessfully();
                }
                else
                {
                    Class.App.SaveNotSuccessfully();
                }
                if (dmcv.Update())
                {
                    Class.App.SaveSuccessfully();
                }
                else
                {
                    Class.App.SaveNotSuccessfully();
                }

                (this.Owner as frmDanhMuc_ChucVu).GetAllList_Position();
                this.Close();
            }
        }