Exemplo n.º 1
0
 private void Clear_btn_Click(object sender, EventArgs e)
 {
     AccountCode_txt.Text          = string.Empty;
     AccountName_txt.Text          = string.Empty;
     AccountDetails_dgv.DataSource = null;
     Update_btn.Enabled            = Delete_btn.Enabled = false;
     AccountCode_txt.Select();
 }
Exemplo n.º 2
0
 private void AddAccountCodeForm_Load(object sender, EventArgs e)
 {
     AccountCode_txt.Select();
     if (vo.AccountCodeId > 0)
     {
         AccountCode_txt.Text = vo.AccountCodeCode;
         AccountName_txt.Text = vo.AccountCodeName;
     }
 }
Exemplo n.º 3
0
        private bool checkdate()
        {
            if (AccountCode_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, AccountCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                AccountCode_txt.Focus();
                return(false);
            }
            if (AccountName_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, AccountName_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                AccountName_txt.Focus();
                return(false);
            }
            AccountCode_txt.Text = AccountCode_txt.Text.Trim();
            AccountName_txt.Text = AccountName_txt.Text.Trim();
            AccountCodeVo outVo = new AccountCodeVo(),
                          inVo  = new AccountCodeVo {
                AccountCodeId = vo.AccountCodeId, AccountCodeCode = AccountCode_txt.Text
            };

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