示例#1
0
 private void AddRankForm_Load(object sender, EventArgs e)
 {
     Ratio_txt.Select();
     if (RatelId > 0)
     {
         RateCode_txt.Text = RateCode;
         Ratio_txt.Text    = RateRatio;
         model_cmb.Text    = RateModel;
         line_cmb.Text     = RateLine;
     }
     else
     {
         CallModel();
     }
 }
示例#2
0
        private bool checkdate()
        {
            if (RateCode_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, RankCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                RateCode_txt.Focus();
                return(false);
            }
            if (Ratio_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, RankName_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                Ratio_txt.Focus();
                return(false);
            }
            RateCode_txt.Text = RateCode_txt.Text.Trim();
            Ratio_txt.Text    = Ratio_txt.Text.Trim();
            RateNGVo outVo = new RateNGVo(), inVo = new RateNGVo {
                RateCode = RateCode_txt.Text, RateModel = model_cmb.Text, RateLine = line_cmb.Text
            };

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