Example #1
0
        /// <summary>
        /// Checks mandatory fields
        /// </summary>
        /// <returns></returns>
        private bool CheckMandatory()
        {
            if (ItemId_cmb.Text == string.Empty || ItemId_cmb.SelectedIndex < 0)
            {
                messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, ItemId_lbl.Text);
                popUpMessage.Warning(messageData, Text);

                ItemId_cmb.Focus();

                return(false);
            }

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

                LineId_cmb.Focus();

                return(false);
            }

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

                InspectionFormat_cmb.Focus();

                return(false);
            }

            return(true);
        }
        /// <summary>
        /// load  the form with  combobox bind
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InspectionProcessForm_Load(object sender, EventArgs e)
        {
            FormDatatableFromVo();

            ComboBind(InspectionFormatId_cmb, inspectionformatDatatable, "Name", "Id");
            ComboBind(ItemId_cmb, itemDatatable, "Name", "Id");
            ComboBind(LineId_cmb, lineDatatable, "Name", "Id");
            Update_btn.Enabled = Delete_btn.Enabled = false;
            ItemId_cmb.Select();
        }
        /// <summary>
        /// clear the condition control values
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Clear_btn_Click(object sender, EventArgs e)
        {
            ItemId_cmb.SelectedIndex = -1;

            LineId_cmb.SelectedIndex = -1;

            InspectionFormatId_cmb.SelectedIndex = -1;

            ItemLineInspectionFormatDetails_dgv.DataSource = null;

            Update_btn.Enabled = Delete_btn.Enabled = false;

            ItemId_cmb.Select();
        }
        /// <summary>
        /// form load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddItemLineInspectionFormatForm_Load(object sender, EventArgs e)
        {
            FormDatatableFromVo();

            ComboBind(InspectionFormat_cmb, inspectionformatDatatable, "Name", "Id");
            ComboBind(ItemId_cmb, itemDatatable, "Name", "Id");
            ComboBind(LineId_cmb, lineDatatable, "Name", "Id");

            ItemId_cmb.Select();

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

                ItemId_cmb.Enabled = false;
                LineId_cmb.Enabled = false;
                InspectionFormat_cmb.Select();
            }
        }