/// <summary> /// load data from db /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddInspectionItemForm_Load(object sender, EventArgs e) { if (updateData != null && updateData.InspectionItemIdCopy > 0) { InspectionItemCopyId = updateData.InspectionItemIdCopy; CopyItem_txt.Text = updateData.InspectionItemName; } //LoadInspectionProcessCombo(); InspectionProcess_cmb.Text = updateData.InspectionProcessName; LoadParentInspectionCombo(); LoadDataTypeCombo(InspectionItemDataType_cmb); InspectionItemName_txt.Select(); if (string.Equals(mode, CommonConstants.MODE_UPDATE)) { LoadInspectionItemData(updateData); CopyItem_txt.Enabled = false; CopyItem_btn.Enabled = false; } else { try { InspectionItemVo outVo = (InspectionItemVo)base.InvokeCbm(new GetInspectionItemDisplayOrderNextValCbm(), updateData, false); if (outVo != null && outVo.DisplayOrder > 0) { InspectionItemDisplayOrder_txt.Text = outVo.DisplayOrder.ToString(); } else { InspectionItemDisplayOrder_txt.Text = "1"; } InspectionItemVo inVo = new InspectionItemVo(); inVo.InspectionProcessId = updateData.InspectionProcessId; inVo.ParentInspectionItemId = updateData.ParentInspectionItemId; checkRunningCount(inVo); InspectionItemCode = updateData.InspectionProcessCode + GlobalMasterDataTypeEnum.CODE_SEPARATOR.GetValue() + GlobalMasterDataTypeEnum.ITEM_CODE.GetValue() + GlobalMasterDataTypeEnum.CODE_SEPARATOR.GetValue() + RunningNumber; UpdateResultVo updateResultVo = (UpdateResultVo)base.InvokeCbm(new DeleteInspectionItemSelectionValueCbm(), null, false); } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } } }
/// <summary> /// load data from db /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddInspectionItemForm_Load(object sender, EventArgs e) { LoadInspectionProcessCombo(); LoadParentInspectionCombo(); InspectionItemCode_txt.Select(); if (string.Equals(mode, CommonConstants.MODE_UPDATE)) { LoadInspectionItemData(updateData); InspectionItemCode_txt.Enabled = false; InspectionItemName_txt.Select(); } }