Пример #1
0
 /// <summary>
 /// form loading
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DefectiveReasonForm_Load(object sender, EventArgs e)
 {
     FormDatatableFromVo();
     ComboBind(DefectiveCategory_cmb, defectiveCategoryDatatable, "name", "id");
     AddExcel_btn.Enabled = Update_btn.Enabled = Delete_btn.Enabled = false;
     DefectiveReasonCode_txt.Select();
 }
        /// <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);
        }