Esempio n. 1
0
        /// <summary>
        /// load  the form with  combobox bind
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InspectionSpecificationForm_Load(object sender, EventArgs e)
        {
            FormDatatableFromVo();

            ComboBind(InspectionItemId_cmb, inspectionitemDatatable, "Name", "Id");

            InspectionSpecificationCode_txt.Select();

            Update_btn.Enabled = Delete_btn.Enabled = Copy_btn.Enabled = false;
        }
Esempio n. 2
0
        /// <summary>
        /// Checks mandatory fields
        /// </summary>
        /// <returns></returns>
        private bool CheckMandatory()
        {
            if (InspectionSpecificationCode_txt.Text == string.Empty)
            {
                messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, InspectionSpecificationCode_lbl.Text);
                popUpMessage.Warning(messageData, Text);

                InspectionSpecificationCode_txt.Focus();

                return(false);
            }

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

                InspectionSpecificationText_txt.Focus();

                return(false);
            }

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

                ValueFrom_txt.Focus();

                return(false);
            }

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

                InspectionItem_cmb.Focus();

                return(false);
            }

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

                SpecificationResultJudgeType_cmb.Focus();

                return(false);
            }

            return(true);
        }
Esempio n. 3
0
        /// <summary>
        /// clear the condition control values
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Clear_btn_Click(object sender, EventArgs e)
        {
            InspectionSpecificationCode_txt.Text = string.Empty;

            InspectionSpecificationText_txt.Text = string.Empty;

            InspectionItemId_cmb.SelectedIndex = -1;

            InspectionSpecificationDetails_dgv.DataSource = null;

            InspectionSpecificationCode_txt.Select();

            Update_btn.Enabled = Delete_btn.Enabled = Copy_btn.Enabled = false;
        }
Esempio n. 4
0
        /// <summary>
        /// form load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddInspectionProcessForm_Load(object sender, EventArgs e)
        {
            FormDatatableFromVo();

            ComboBind(InspectionItem_cmb, inspectionitemDatatable, "Name", "Id");

            LoadJudgeTypeCombo(SpecificationResultJudgeType_cmb);

            InspectionSpecificationCode_txt.Select();

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

                InspectionSpecificationCode_txt.Enabled = false;

                InspectionSpecificationText_txt.Select();
            }
            else if (string.Equals(mode, CommonConstants.MODE_SELECT))
            {
                LoadInspectionSpecificationData(updateData);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// inserts new record
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Ok_btn_Click(object sender, EventArgs e)
        {
            InspectionSpecificationVo inVo = new InspectionSpecificationVo();
            var sch = StringCheckHelper.GetInstance();

            if (CheckMandatory() == true)
            {
                if (string.IsNullOrEmpty(InspectionSpecificationCode_txt.Text) || string.IsNullOrEmpty(InspectionSpecificationText_txt.Text))
                {
                    messageData = new MessageData("mmce00003", Properties.Resources.mmce00003);
                    logger.Info(messageData);
                    popUpMessage.ConfirmationOkCancel(messageData, Text);

                    if (string.IsNullOrEmpty(InspectionSpecificationCode_txt.Text))
                    {
                        InspectionSpecificationCode_txt.Focus();
                    }
                    else if (string.IsNullOrEmpty(InspectionSpecificationText_txt.Text))
                    {
                        InspectionSpecificationText_txt.Focus();
                    }
                    return;
                }

                if (string.Equals(mode, CommonConstants.MODE_SELECT))
                {
                    if (InspectionSpecificationCode_txt.Text == updateData.InspectionSpecificationCode)
                    {
                        messageData = new MessageData("mmce00001", Properties.Resources.mmce00001, InspectionSpecificationCode_lbl.Text + " : " + InspectionSpecificationCode_txt.Text);
                        logger.Info(messageData);
                        popUpMessage.ConfirmationOkCancel(messageData, Text);

                        return;
                    }
                    if (InspectionSpecificationText_txt.Text == updateData.InspectionSpecificationText)
                    {
                        messageData = new MessageData("mmce00001", Properties.Resources.mmce00001, InspectionSpecificationText_lbl.Text + " : " + InspectionSpecificationText_txt.Text);
                        logger.Info(messageData);
                        popUpMessage.ConfirmationOkCancel(messageData, Text);

                        return;
                    }
                }

                inVo.InspectionSpecificationCode = InspectionSpecificationCode_txt.Text.Trim();

                inVo.InspectionSpecificationText = InspectionSpecificationText_txt.Text.Trim();

                // inVo.ValueFrom = Convert.ToDecimal(ValueFrom_txt.Text.Trim());

                if (!string.IsNullOrWhiteSpace(ValueTo_txt.Text.Trim()))
                {
                    //  inVo.ValueTo = Convert.ToDecimal(ValueTo_txt.Text.Trim());
                }

                if (!string.IsNullOrWhiteSpace(Unit_txt.Text.Trim()))
                {
                    inVo.Unit = Unit_txt.Text.Trim();
                }

                if (!string.IsNullOrWhiteSpace(OperatorFrom_txt.Text.Trim()))
                {
                    inVo.OperatorFrom = OperatorFrom_txt.Text.Trim();
                }

                if (!string.IsNullOrWhiteSpace(OperatorTo_txt.Text.Trim()))
                {
                    inVo.OperatorTo = OperatorTo_txt.Text.Trim();
                }

                inVo.InspectionItemId = Convert.ToInt32(InspectionItem_cmb.SelectedValue.ToString());

                inVo.SpecificationResultJudgeType = Convert.ToInt32(SpecificationResultJudgeType_cmb.SelectedValue.ToString());

                if (mode.Equals(CommonConstants.MODE_UPDATE))
                {
                    inVo.InspectionSpecificationId = updateData.InspectionSpecificationId;
                }

                inVo.Mode = mode;

                InspectionSpecificationVo checkVo = DuplicateCheck(inVo);

                if (checkVo != null && checkVo.AffectedCount > 0)
                {
                    messageData = new MessageData("mmce00001", Properties.Resources.mmce00001, InspectionSpecificationCode_lbl.Text + " : " + InspectionSpecificationCode_txt.Text +
                                                  Environment.NewLine + " OR " + Environment.NewLine + InspectionItem_lbl.Text + " : " + InspectionItem_cmb.Text);
                    logger.Info(messageData);
                    popUpMessage.ConfirmationOkCancel(messageData, Text);

                    return;
                }

                try
                {
                    if (string.Equals(mode, CommonConstants.MODE_ADD) || string.Equals(mode, CommonConstants.MODE_SELECT))
                    {
                        UpdateResultVo outVo = (UpdateResultVo)base.InvokeCbm(new AddInspectionSpecificationMasterMntCbm(), inVo, false);

                        IntSuccess = outVo.AffectedCount;
                    }
                    else if (mode.Equals(CommonConstants.MODE_UPDATE))
                    {
                        InspectionSpecificationVo outVo = (InspectionSpecificationVo)base.InvokeCbm(new UpdateInspectionSpecificationMasterMntCbm(), inVo, false);

                        IntSuccess = outVo.AffectedCount;
                    }
                }
                catch (Framework.ApplicationException exception)
                {
                    popUpMessage.ApplicationError(exception.GetMessageData(), Text);
                    logger.Error(exception.GetMessageData());
                    return;
                }

                if ((IntSuccess > 0) || (IntSuccess == 0))
                {
                    this.Close();
                }
            }
        }