private void AddJigResponseMasterForm_Load(object sender, EventArgs e)
 {
     JigResponseCode_txt.Select();
     if (vo.JigResponseId > 0)
     {
         JigResponseCode_txt.Text = vo.JigResponseCode;
         JigResponseName_txt.Text = vo.JigResponseName;
     }
 }
Пример #2
0
        private void Clear_btn_Click(object sender, EventArgs e)
        {
            JigResponseCode_txt.Text = string.Empty;

            JigResponseName_txt.Text = string.Empty;

            JigResponse_dgv.DataSource = null;

            JigResponseCode_txt.Select();
        }
        private bool CheckDate()
        {
            if (JigResponseCode_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, JigResponseCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                JigResponseCode_txt.Focus();
                return(false);
            }
            if (JigResponseName_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, JigResponseName_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                JigResponseName_txt.Focus();
                return(false);
            }
            JigResponseCode_txt.Text = JigResponseCode_txt.Text.Trim();
            JigResponseName_txt.Text = JigResponseName_txt.Text.Trim();
            JigResponseVo outVo = new JigResponseVo(),
                          inVo  = new JigResponseVo {
                JigResponseId = vo.JigResponseId, JigResponseCode = JigResponseCode_txt.Text
            };

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