Exemplo n.º 1
0
 private void Clear_btn_Click(object sender, EventArgs e)
 {
     DeptCode_txt.Text          = string.Empty;
     DeptName_txt.Text          = string.Empty;
     DeptDetails_dgv.DataSource = null;
     Update_btn.Enabled         = Delete_btn.Enabled = false;
     DeptCode_txt.Select();
 }
Exemplo n.º 2
0
 private void AddRankForm_Load(object sender, EventArgs e)
 {
     DeptCode_txt.Select();
     if (vo.DepartmentId > 0)
     {
         DeptCode_txt.Text = vo.DepartmentCode;
         DeptName_txt.Text = vo.DepartmentName;
     }
 }
Exemplo n.º 3
0
        private bool checkdate()
        {
            if (DeptCode_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, DeptCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                DeptCode_txt.Focus();
                return(false);
            }
            if (DeptName_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, DeptName_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                DeptName_txt.Focus();
                return(false);
            }
            DeptCode_txt.Text = DeptCode_txt.Text.Trim();
            DeptName_txt.Text = DeptName_txt.Text.Trim();
            DepartmentVo outVo = new DepartmentVo(),
                         inVo  = new DepartmentVo {
                DepartmentId = vo.DepartmentId, DepartmentCode = DeptCode_txt.Text
            };

            try
            {
                outVo = (DepartmentVo)DefaultCbmInvoker.Invoke(new CheckDepartmentVCBCbm(), inVo);
                if (outVo.AffectedCount > 0)
                {
                    messageData = new MessageData("mmcc00006", Properties.Resources.mmcc00006, DeptCode_lbl.Text);
                    popUpMessage.Warning(messageData, Text);
                    DeptCode_txt.Focus();
                    return(false);
                }
            }
            catch (Com.Nidec.Mes.Framework.ApplicationException exception)
            {
                popUpMessage.ApplicationError(exception.GetMessageData(), Text);
                logger.Error(exception.GetMessageData());
                return(false);
            }
            return(true);
        }