Пример #1
0
        /// <summary>
        /// Checks mandatory fields
        /// </summary>
        /// <returns></returns>
        private bool CheckMandatory()
        {
            if (DefectiveReasonCode_txt.Text == string.Empty)
            {
                messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, DefectiveReasonCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);

                DefectiveReasonCode_txt.Focus();

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

                DefectiveReasonName_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);
            }
            return(true);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddDefectiveReasonForm_Load(object sender, EventArgs e)
        {
            FormDatatableFromVo();

            if (defectiveCategoryDatatable.Rows.Count > 0)
            {
                ComboBind(DefectiveCategory_cmb, defectiveCategoryDatatable, "name", "id");
            }
            else
            {
                DefectiveCategory_cmb.Enabled = false;
            }


            DefectiveReasonCode_txt.Select();

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

                DefectiveReasonCode_txt.Enabled = false;

                DefectiveReasonName_txt.Select();
            }
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddDefectiveReasonNewForm_Load(object sender, EventArgs e)
        {
            FormDatatableFromVo();

            if (defectiveCategoryDatatable.Rows.Count > 0)
            {
                ComboBind(DefectiveCategory_cmb, defectiveCategoryDatatable, "name", "id");
            }
            else
            {
                DefectiveCategory_cmb.Enabled = false;
            }

            DefectiveReasonCode_txt.Select();
            int defectRsnId = 0;

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

                defectRsnId = updateData.DefectiveReasonId;

                DefectiveReasonCode_txt.Enabled = false;

                DefectiveReasonName_txt.Select();
            }
            else
            {
                DefectiveReasonVo outVo = null;
                try
                {
                    outVo = (DefectiveReasonVo)base.InvokeCbm(new GetDefectiveReasonDisplayOrderCbm(), null, false);
                }
                catch (Framework.ApplicationException ex)
                {
                    popUpMessage.ApplicationError(ex.GetMessageData(), this.TitleText);
                }

                if (outVo != null)
                {
                    DisplayOrder_txt.Text = outVo.DisplayOrder.ToString();
                }
                else
                {
                    DisplayOrder_txt.Text = "1";
                }
            }

            BindGrid(defectRsnId);
        }