Exemplo n.º 1
0
 private void Clear_btn_Click(object sender, EventArgs e)
 {
     AccountLocationCode_txt.Text          = string.Empty;
     AccountLocationName_txt.Text          = string.Empty;
     AccountLocationDetails_dgv.DataSource = null;
     Update_btn.Enabled = Delete_btn.Enabled = false;
     AccountLocationCode_txt.Select();
 }
Exemplo n.º 2
0
 private void AddAccountLocationForm_Load(object sender, EventArgs e)
 {
     AccountLocationCode_txt.Select();
     if (vo.AccountLocationId > 0)
     {
         AccountLocationCode_txt.Text = vo.AccountLocationCode;
         AccountLocationName_txt.Text = vo.AccountLocationName;
         AccountLocationType_txt.Text = vo.AccountLocationType;
     }
 }
Exemplo n.º 3
0
        private bool checkdate()
        {
            if (AccountLocationCode_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, AccountLocationCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                AccountLocationCode_txt.Focus();
                return(false);
            }
            if (AccountLocationName_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, AccountLocationName_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                AccountLocationName_txt.Focus();
                return(false);
            }
            if (AccountLocationType_txt.Text.Trim().Length == 0)
            {
                messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, AccountLocationType_lbl.Text);
                popUpMessage.Warning(messageData, Text);
                AccountLocationType_txt.Focus();
                return(false);
            }
            AccountLocationCode_txt.Text = AccountLocationCode_txt.Text.Trim();
            AccountLocationName_txt.Text = AccountLocationName_txt.Text.Trim();
            AccountLocationVo outVo = new AccountLocationVo(),
                              inVo  = new AccountLocationVo {
                AccountLocationId = vo.AccountLocationId, AccountLocationCode = AccountLocationCode_txt.Text
            };

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