Beispiel #1
0
 private void Clear_btn_Click(object sender, EventArgs e)
 {
     UnitCode_txt.Text          = string.Empty;
     UnitName_txt.Text          = string.Empty;
     UnitDetails_dgv.DataSource = null;
     Update_btn.Enabled         = Delete_btn.Enabled = false;
     UnitCode_txt.Select();
 }
Beispiel #2
0
 private void AddUnitForm_Load(object sender, EventArgs e)
 {
     UnitCode_txt.Select();
     if (vo.UnitId > 0)
     {
         UnitCode_txt.Text = vo.UnitCode;
         UnitName_txt.Text = vo.UnitName;
     }
 }
Beispiel #3
0
        private bool checkdate()
        {
            if (UnitCode_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, UnitCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                UnitCode_txt.Focus();
                return(false);
            }
            if (UnitName_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, UnitName_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                UnitName_txt.Focus();
                return(false);
            }
            UnitCode_txt.Text = UnitCode_txt.Text.Trim();
            UnitName_txt.Text = UnitName_txt.Text.Trim();
            UnitVo outVo = new UnitVo(),
                   inVo  = new UnitVo {
                UnitId = vo.UnitId, UnitCode = UnitCode_txt.Text
            };

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