Esempio n. 1
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);
        }