Beispiel #1
0
        private void InspectionSpecification_btn_Click(object sender, EventArgs e)
        {
            int selectedrowindex             = InspectionItem_dgv.SelectedCells[0].RowIndex;
            InspectionItemVo InspectionAddVo = (InspectionItemVo)InspectionItem_dgv.Rows[selectedrowindex].DataBoundItem;
            AddInspectionSpecificationForItemForm newAddForm = new AddInspectionSpecificationForItemForm(CommonConstants.MODE_ADD, null);

            newAddForm.InspectionItemId = InspectionAddVo.InspectionItemId;
            newAddForm.ShowDialog();
        }
Beispiel #2
0
        private void InspectionSpecification_btn_Click(object sender, EventArgs e)
        {
            int selectedrowindex             = InspectionItem_dgv.SelectedCells[0].RowIndex;
            InspectionItemVo InspectionAddVo = (InspectionItemVo)InspectionItem_dgv.Rows[selectedrowindex].DataBoundItem;
            AddInspectionSpecificationForItemForm newAddForm = new AddInspectionSpecificationForItemForm(CommonConstants.MODE_ADD, null);

            newAddForm.InspectionItemId       = InspectionAddVo.InspectionItemId;
            newAddForm.InspectionItemCode     = InspectionAddVo.InspectionItemCode;
            newAddForm.InspectionItemName     = InspectionAddVo.InspectionItemName;
            newAddForm.InspectionItemDataType = InspectionAddVo.InspectionItemDataType;
            newAddForm.InspectionProcessId    = InspectionAddVo.InspectionProcessId;
            newAddForm.ShowDialog();
            if (newAddForm.InspectionItemId > 0)
            {
                InspectionFormatProcessBuzzLogic getprocessid = new InspectionFormatProcessBuzzLogic();
                InspectionReturnVo invo = new InspectionReturnVo();
                invo.InspectionItemId = newAddForm.InspectionItemId;
                InspectionReturnVo getInspectionVo = getprocessid.RefreshAllFormGrid(invo);
                if (getInspectionVo != null && getInspectionVo.InspectionProcessId > 0)
                {
                    InspectionProcessId = getInspectionVo.InspectionProcessId;
                    //LoadInspectionProcessCombo();
                    //InspectionProcess_cmb.SelectedValue = InspectionProcessId;
                }
            }

            if (newAddForm.InspectionItemId == -1)
            {
                return;
            }

            GridBind();

            if (InspectionItem_dgv.Rows.Count > 0 && InspectionItem_dgv.Columns.Count > 0 && InspectionItem_dgv.Columns["ColInspectionItemId"] != null)
            {
                int searchItemId;
                if (newAddForm.InspectionItemId > 0)
                {
                    searchItemId = newAddForm.InspectionItemId;
                }
                else
                {
                    searchItemId = InspectionAddVo.InspectionItemId;
                }

                DataGridViewRow row = InspectionItem_dgv.Rows
                                      .Cast <DataGridViewRow>()
                                      .FirstOrDefault(r => r.Cells["ColInspectionItemId"].Value.ToString().Equals(searchItemId.ToString()));

                if (row == null)
                {
                    return;
                }

                InspectionItem_dgv.Rows[row.Index].Selected = true;
                InspectionItem_dgv_CellClick(sender, new DataGridViewCellEventArgs(0, row.Index));
                InspectionItem_dgv.FirstDisplayedScrollingRowIndex = row.Index;

                //(InspectionItem_dgv.Rows[row.Index].Cells["colComments"].Value != null &&
                //InspectionItem_dgv.Rows[row.Index].Cells["colComments"].Value.ToString() == Properties.Resources.mmci00035)

                if ((InspectionItem_dgv.Rows[row.Index].Cells["colTestInstruction"].Value != null &&
                     InspectionItem_dgv.Rows[row.Index].Cells["colTestInstruction"].Value.ToString() == Properties.Resources.mmci00025) || is_Copied == true)
                {
                    InspectionTestInstruction_btn_Click(sender, e);
                }
            }
        }