Beispiel #1
0
        /// <summary>
        /// form load, loads item data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AddStockLocationForm_Load(object sender, EventArgs e)
        {
            if (!this.DesignMode)
            {
                StockLocationCode_txt.Select();

                LoadUnityType();
                LoadLocationType();

                if (string.Equals(mode, CommonConstants.MODE_UPDATE))
                {
                    LoadUserData(updateData);

                    StockLocationCode_txt.Enabled = false;

                    StockLocationName_txt.Select();

                    var resourceMngr = new ResourceManager(this.GetType());
                    this.Text = resourceMngr.GetString("UpdateForm");
                }
                else
                {
                    StockLocationVo outVo = (StockLocationVo)base.InvokeCbm(new GetDisplayOrderNextValForStockLocCbm(), null, false);
                    if (outVo != null)
                    {
                        DisplayOrder_txt.Text = outVo.DisplayOrder.ToString();
                    }
                    else
                    {
                        DisplayOrder_txt.Text = "1";
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Checks mandatory fields
        /// </summary>
        /// <returns></returns>
        private bool CheckMandatory()
        {
            if (StockLocationCode_txt.Text == string.Empty)
            {
                messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, StockLocationCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);

                StockLocationCode_txt.Focus();

                return(false);
            }
            if (StockLocationName_txt.Text == string.Empty)
            {
                messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, StockLocationName_lbl.Text);
                popUpMessage.Warning(messageData, Text);

                StockLocationName_txt.Focus();

                return(false);
            }

            if (DisplayOrder_txt.Text == string.Empty)
            {
                messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, DisplayOrder_lbl.Text);
                popUpMessage.Warning(messageData, Text);

                DisplayOrder_txt.Focus();

                return(false);
            }

            if (LocationType_cmb.Text == string.Empty || LocationType_cmb.SelectedIndex < 0)
            {
                messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, LocationType_lbl.Text);
                popUpMessage.Warning(messageData, Text);

                LocationType_cmb.Focus();

                return(false);
            }

            return(true);
        }