private void AddModelMasterForm_Load(object sender, EventArgs e)
 {
     if (vo.DrawId > 0)
     {
         DrawCode_txt.Text = vo.DrawCode;
         DrawName_txt.Text = vo.DrawName;
     }
     DrawCode_txt.Select();
 }
        private void Clear_btn_Click(object sender, EventArgs e)
        {
            DrawCode_txt.Text = string.Empty;

            DrawName_txt.Text = string.Empty;

            Draw_dgv.DataSource = null;

            DrawCode_txt.Select();
        }
示例#3
0
        private bool CheckDate()
        {
            if (DrawCode_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, DrawCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                DrawCode_txt.Focus();
                return(false);
            }
            if (DrawName_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, DrawName_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                DrawName_txt.Focus();
                return(false);
            }
            DrawCode_txt.Text = DrawCode_txt.Text.Trim();
            DrawName_txt.Text = DrawName_txt.Text.Trim();
            DrawVo outVo = new DrawVo(),
                   inVo  = new DrawVo {
                DrawId = vo.DrawId, DrawCode = DrawCode_txt.Text
            };

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