public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { OvenBarcodeVo inVo = (OvenBarcodeVo)vo; StringBuilder sql = new StringBuilder(); ValueObjectList <OvenBarcodeVo> voList = new ValueObjectList <OvenBarcodeVo>(); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append(@"select distinct process_cd from t_ovenmachine_ls where 1=1 "); if (!String.IsNullOrEmpty(inVo.Model)) { sql.Append(@" and model = :model "); sqlParameter.AddParameterString("model", inVo.Model); } sql.Append(" order by process_cd"); sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //execute SQL IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); while (dataReader.Read()) { OvenBarcodeVo outVo = new OvenBarcodeVo { Process = dataReader["process_cd"].ToString(), }; voList.add(outVo); } dataReader.Close(); return(voList); }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { AccountCodeVo inVo = (AccountCodeVo)vo; ValueObjectList <AccountCodeVo> voList = new ValueObjectList <AccountCodeVo>(); StringBuilder sql = new StringBuilder(); //CREATE SQL ADAPTER AND PARAMETER LIST DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append("select account_code_id, account_code_cd, account_code_name from m_account_code where 1=1 "); if (!string.IsNullOrEmpty(inVo.account_code_cd)) { sql.Append("and account_code_cd='").Append(inVo.account_code_cd).Append("' "); } if (!string.IsNullOrEmpty(inVo.account_code_name)) { sql.Append("and account_code_name='").Append(inVo.account_code_name).Append("' "); } sql.Append("order by account_code_id"); sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); sql.Clear(); //EXECUTE READER FROM COMMAND IDataReader datareader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); while (datareader.Read()) { AccountCodeVo outVo = new AccountCodeVo { account_code_id = (int)datareader["account_code_id"], account_code_cd = datareader["account_code_cd"].ToString(), account_code_name = datareader["account_code_name"].ToString() }; voList.add(outVo); } datareader.Close(); base.CloseConnection(trxContext); return(voList); }
/// <summary> /// Fills all user records to gridview control /// </summary> private void GridBind(StockLocationVo conditionInVo) { StockLocationData_dgv.DataSource = null; try { ValueObjectList <StockLocationVo> outVo = (ValueObjectList <StockLocationVo>)base.InvokeCbm(new GetStockLocationMasterMntCbm(), conditionInVo, false); if (outVo != null) { StockLocationData_dgv.AutoGenerateColumns = false; BindingSource bindingSource1 = new BindingSource(outVo.GetList(), null); if (bindingSource1.Count > 0) { StockLocationData_dgv.DataSource = bindingSource1; } } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); } StockLocationData_dgv.ClearSelection(); Update_btn.Enabled = false; Delete_btn.Enabled = false; } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
/// <summary> /// get sap group id /// </summary> /// <returns></returns> private string getSapItemGroupId() { Dictionary <string, string> getSapItemGroupName = new Dictionary <string, string>(); getSapItemGroupName.Add(GlobalMasterDataTypeEnum.CODE_COMMON.GetValue(), GlobalMasterDataTypeEnum.CODE_COMMON.ToString()); getSapItemGroupName.Add(GlobalMasterDataTypeEnum.CODE_MMC.GetValue(), GlobalMasterDataTypeEnum.CODE_MMC.ToString()); getSapItemGroupName.Add(GlobalMasterDataTypeEnum.CODE_MDCM.GetValue(), GlobalMasterDataTypeEnum.CODE_MDCM.ToString()); getSapItemGroupName.Add(GlobalMasterDataTypeEnum.CODE_CMC.GetValue(), GlobalMasterDataTypeEnum.CODE_CMC.ToString()); getSapItemGroupName.Add(GlobalMasterDataTypeEnum.CODE_FAN.GetValue(), GlobalMasterDataTypeEnum.CODE_FAN.ToString()); getSapItemGroupName.Add(GlobalMasterDataTypeEnum.CODE_PSC.GetValue(), GlobalMasterDataTypeEnum.CODE_PSC.ToString()); if (sapItemSearchVo != null && !string.IsNullOrEmpty(sapItemSearchVo.SapMaterialGroupId)) { return(getSapItemGroupName[sapItemSearchVo.SapMaterialGroupId]); } else { ValueObjectList <SapItemSearchVo> outVo = new ValueObjectList <SapItemSearchVo>(); SapItemSearchVo ItemInVo = new SapItemSearchVo(); ItemInVo.SapItemCode = ItemCode_txt.Text; try { outVo = (ValueObjectList <SapItemSearchVo>)DefaultCbmInvoker.Invoke(new GetSapItemSearchCbm(), ItemInVo); } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } if (outVo != null && outVo.GetList() != null && outVo.GetList().Count > 0 && !string.IsNullOrEmpty(outVo.GetList()[0].SapMaterialGroupId)) { return(getSapItemGroupName[outVo.GetList()[0].SapMaterialGroupId]); } } return(null); }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { PersonVo inVo = (PersonVo)vo; StringBuilder sql = new StringBuilder(); ValueObjectList <PersonVo> voList = new ValueObjectList <PersonVo>(); //PersonVo outVo = new PersonVo(); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append(@"select count(*) as counter from t_productioncontroller_person where 1=1 "); if (inVo.PersonId > 0) { sql.Append(" and person_id =:person_id"); sqlParameter.AddParameter("person_id", inVo.PersonId); } if (!String.IsNullOrEmpty(inVo.RegistrationUserCode)) { sql.Append(" and registration_user_cd =:registration_user_cd"); sqlParameter.AddParameterString("registration_user_cd", inVo.RegistrationUserCode); } sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //execute SQL string dataReader = sqlCommandAdapter.ExecuteScalar(sqlParameter).ToString(); PersonVo outVo = new PersonVo { AffectedCount = int.Parse(dataReader), }; return(outVo); }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { WareHouseMainVo inVo = ( WareHouseMainVo)vo; StringBuilder sql = new StringBuilder(); ValueObjectList <WareHouseMainVo> voList = new ValueObjectList <WareHouseMainVo>(); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append(@"select g.warehouse_main_id from t_warehouse_main g left join m_asset e on e.asset_id = g.asset_id where 1=1 "); if (!String.IsNullOrEmpty(inVo.AssetCode)) { sql.Append(@" and e.asset_cd =:asset_cd"); sqlParameter.AddParameterString("asset_cd", inVo.AssetCode); } sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); while (dataReader.Read()) { WareHouseMainVo outVo = new WareHouseMainVo { WareHouseMainId = int.Parse(dataReader["warehouse_main_id"].ToString()), }; voList.add(outVo); } dataReader.Close(); return(voList); }
private void GridBind() { oven_dgv.DataSource = null; try { OvenBarcodeVo vo = new OvenBarcodeVo { Model = model_cmb.Text, Line = line_cmb.Text, Barcode = barcode_cmb.Text, Lower = lower_txt.Text, Upper = upper_txt.Text, DateTimeForm = timefrom_dtp.Value, DateTimeTo = timeto_dtp.Value, }; ValueObjectList <OvenBarcodeVo> volist = (ValueObjectList <OvenBarcodeVo>)DefaultCbmInvoker.Invoke(new SearchOvenCbm(), vo); if (volist.GetList() != null && volist.GetList().Count > 0) { oven_dgv.AutoGenerateColumns = false; BindingSource bindingsource = new BindingSource(volist.GetList(), null); oven_dgv.DataSource = bindingsource; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); } oven_dgv.ClearSelection(); } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { RangeVo inVo = (RangeVo)vo; StringBuilder sql = new StringBuilder(); ValueObjectList <RangeVo> voList = new ValueObjectList <RangeVo>(); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append(@"select count(*) count_barcode from m_ovenmachine_range where 1=1 "); if (!String.IsNullOrEmpty(inVo.Model)) { sql.Append(@" and range_model = :range_model "); sqlParameter.AddParameterString("range_model", inVo.Model); } if (!String.IsNullOrEmpty(inVo.Line)) { sql.Append(@" and range_line = :range_line "); sqlParameter.AddParameterString("range_line", inVo.Line); } if (!String.IsNullOrEmpty(inVo.Barcode)) { sql.Append(@" and range_barcode = :range_barcode "); sqlParameter.AddParameterString("range_barcode", inVo.Barcode); } sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); RangeVo outVo = new RangeVo(); outVo.Count = int.Parse(sqlCommandAdapter.ExecuteScalar(sqlParameter).ToString()); return(outVo); }
private ValueObjectList <InspectionItemVo> FormDisplayOrder(ValueObjectList <InspectionItemVo> outvo, int parentId, ValueObjectList <InspectionItemVo> formattedVo) { ValueObjectList <InspectionItemVo> returnformattedVo = formattedVo; List <InspectionItemVo> getChilditem = outvo.GetList().Where(t => t.ParentInspectionItemId == parentId).ToList(); foreach (InspectionItemVo currvo in getChilditem) { if (currvo.ParentInspectionItemId == 0) { currvo.FormattedDisplayOrder = currvo.DisplayOrder.ToString(); } else { InspectionItemVo getdisplayorderVo = returnformattedVo.GetList().Where(t => t.InspectionItemId == parentId).FirstOrDefault(); currvo.FormattedDisplayOrder = getdisplayorderVo.FormattedDisplayOrder + GlobalMasterDataTypeEnum.CODE_SEPARATOR.GetValue() + currvo.DisplayOrder; } returnformattedVo.add(currvo); FormDisplayOrder(outvo, currvo.InspectionItemId, returnformattedVo); } return(returnformattedVo); }
private void GridBind() { person_dgv.DataSource = null; try { PersonVo vo = new PersonVo { Line = line_cmb.Text, Model = model_cmb.Text, Shift = int.Parse(shift_cmb.Text), TimeFrom = DateTime.Parse(timefrom_dtp.Value.ToShortDateString()), TimeTo = DateTime.Parse(timeto_dtp.Value.ToShortDateString()), }; ValueObjectList <PersonVo> volist = (ValueObjectList <PersonVo>)DefaultCbmInvoker.Invoke(new SearchPersonCbm(), vo); BindingSource bindingsource = new BindingSource(volist.GetList(), null); person_dgv.DataSource = bindingsource; } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
private void TranferInfoForm_Load(object sender, EventArgs e) { ValueObjectList <LocationVo> locationvolist = null; try { locationvolist = (ValueObjectList <LocationVo>)DefaultCbmInvoker.Invoke(getDeptCbm, new LocationVo()); } catch (Framework.ApplicationException ex) { logger.Error(ex.GetMessageData()); popUpMessage.ApplicationError(ex.GetMessageData(), Text); return; } Destination_cmb.DisplayMember = "LocationCode"; BindingSource b2 = new BindingSource(locationvolist.GetList(), null); Destination_cmb.DataSource = b2; Destination_cmb.Text = ""; GridBind(); setColor(); }
private void AddCategory(TransactionContext trxContext, ValueObjectList <MoldCategoryVo> moldCategoryInVo) { foreach (MoldCategoryVo moldCategoryVo in moldCategoryInVo.GetList()) { // Checking existing data ValueObjectList <MoldCategoryVo> moldCategoryCheckVo = (ValueObjectList <MoldCategoryVo>)checkMoldCategoryMasterMntCbm.Execute(trxContext, moldCategoryVo); if (moldCategoryCheckVo != null && moldCategoryCheckVo.GetList().Count > 0) { foreach (MoldCategoryVo curVo in moldCategoryCheckVo.GetList()) { if (!categoryList.ContainsKey(curVo.MoldCategoryCode)) { categoryList.Add(curVo.MoldCategoryCode, curVo.MoldCategoryId); } } } else { MoldCategoryVo moldCategoryOutVo = (MoldCategoryVo)addMoldCategoryMasterMntCbm.Execute(trxContext, moldCategoryVo); categoryList.Add(moldCategoryVo.MoldCategoryCode, moldCategoryOutVo.MoldCategoryId); } } }
private void JigRepairInformationForm_Load(object sender, EventArgs e) { ValueObjectList<ModelVo> modelvolist = (ValueObjectList<ModelVo>)DefaultCbmInvoker.Invoke(new GetModelCbm(), new ModelVo()); model_cmb.DisplayMember = "ModelCode"; BindingSource b = new BindingSource(modelvolist.GetList(), null); model_cmb.DataSource = b; model_cmb.Text = ""; ValueObjectList<JigResponseVo> respmachinevolist = (ValueObjectList<JigResponseVo>)DefaultCbmInvoker.Invoke(new GetJigResponseCbm(), new JigResponseVo()); jigresponse_cmb.DisplayMember = "JigResponseName"; jigresponse_cmb.DataSource = respmachinevolist.GetList(); jigresponse_cmb.Text = ""; ValueObjectList<JigCauseVo> respmachinevolist12 = (ValueObjectList<JigCauseVo>)DefaultCbmInvoker.Invoke(new GetJigCauseCbm(), new JigCauseVo()); jigause_cmb.DisplayMember = "JigCauseName"; jigause_cmb.DataSource = respmachinevolist12.GetList(); jigause_cmb.Text = ""; line_cmb.Text = ""; process_cmb.Text = ""; }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { ProductionControllerGA1Vo inVo = (ProductionControllerGA1Vo)vo; StringBuilder sql = new StringBuilder(); ValueObjectList <ProductionControllerGA1Vo> voList = new ValueObjectList <ProductionControllerGA1Vo>(); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append(@"select distinct process from " + inVo.TableName); sql.Append(" where 1=1 "); if (!string.IsNullOrEmpty(inVo.LineCode)) { sql.Append(@" and line =:line"); sqlParameter.AddParameterString("line", inVo.LineCode); } sql.Append(@" order by process"); sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //execute SQL IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); while (dataReader.Read()) { ProductionControllerGA1Vo outVo = new ProductionControllerGA1Vo { ProcessCode = dataReader["process"].ToString() }; voList.add(outVo); } dataReader.Close(); return(voList); }
private void GridBind() { AssetDetails_dgv.DataSource = null; try { AssetVo vo = new AssetVo { AssetCode = AssetCode_txt.Text, AssetName = AssetName_txt.Text, AssetNo = 10000, //ne vao trong gia tri o, nen chuyen database lai voi asset_no string Long }; ValueObjectList <AssetVo> volist = (ValueObjectList <AssetVo>)DefaultCbmInvoker.Invoke(new GetAssetCbm(), vo); if (volist.GetList() != null && volist.GetList().Count > 0) { BindingSource bindingsource = new BindingSource(volist.GetList(), null); AssetDetails_dgv.DataSource = bindingsource; AssetDetails_dgv.Columns["colAssetCode"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); } AssetDetails_dgv.ClearSelection(); setColor(); Update_btn.Enabled = false; Delete_btn.Enabled = false; } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { DetailPositionVo inVo = (DetailPositionVo)vo; ValueObjectList <DetailPositionVo> voList = new ValueObjectList <DetailPositionVo>(); StringBuilder sql = new StringBuilder(); //CREATE SQL ADAPTER AND PARAMETER LIST DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append("select distinct detail_postion_id, detail_postion_cd, detail_postion_name from m_detail_postion where 1=1 "); if (!string.IsNullOrEmpty(inVo.detail_postion_cd)) { sql.Append("and detail_postion_cd='").Append(inVo.detail_postion_cd).Append("' "); } if (!string.IsNullOrEmpty(inVo.detail_postion_name)) { sql.Append("and detail_postion_name='").Append(inVo.detail_postion_name).Append("' "); } sql.Append("order by detail_postion_id"); sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); sql.Clear(); //EXECUTE READER FROM COMMAND IDataReader datareader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); while (datareader.Read()) { DetailPositionVo outVo = new DetailPositionVo { detail_postion_id = (int)datareader["detail_postion_id"], detail_postion_cd = datareader["detail_postion_cd"].ToString(), detail_postion_name = datareader["detail_postion_name"].ToString() }; voList.add(outVo); } datareader.Close(); return(voList); }
/// <summary> /// Fills all user records to gridview control /// </summary> private void GridBind(ModelVo conditionInVo) { Model_dgv.DataSource = null; try { this.Cursor = Cursors.WaitCursor; ValueObjectList <ModelVo> outVo = (ValueObjectList <ModelVo>)base.InvokeCbm(new GetModelMasterMntCbm(), conditionInVo, false); if (outVo != null && outVo.GetList() != null && outVo.GetList().Count > 0) { Model_dgv.AutoGenerateColumns = false; BindingSource ModelSource1 = new BindingSource(outVo.GetList(), null); Model_dgv.DataSource = ModelSource1; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); //"Model" logger.Info(messageData); popUpMessage.Information(messageData, Text); } Model_dgv.ClearSelection(); Update_btn.Enabled = false; Delete_btn.Enabled = false; } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } finally { this.Cursor = Cursors.Default; } }
private void GridBind() { try { WareHouseMainVo whvos = new WareHouseMainVo() { AssetCode = asset_Code_txt.Text, RankCode = rank_code_cbm.Text, AssetType = asset_type_cbm.Text, AccountCodeCode = detail_position_cmb.Text, AccountLocationCode = select_search_cbm.Text, AssetInvoice = invoice_cbm.Text, AssetModel = asset_model_cbm.Text, AfterLocationCd = location_cbm.Text, AssetName = asset_name_cbm.Text, DetailPositionCd = detail_position_cmb.Text, //AssetNo = }; if (select_search_cbm.Text == "Search History") { ValueObjectList <WareHouseMainVo> listvo = (ValueObjectList <WareHouseMainVo>)DefaultCbmInvoker.Invoke(new Cbm.SearchWareHouseMainCbm(), whvos); warehouse_main_dgv.DataSource = listvo.GetList(); } else if (select_search_cbm.Text == "Search List") { ValueObjectList <WareHouseMainVo> listvo = (ValueObjectList <WareHouseMainVo>)DefaultCbmInvoker.Invoke(new Cbm.SearchListWareHouseMainCbm(), whvos); warehouse_main_dgv.DataSource = listvo.GetList(); } } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { GA1ModelVo inVo = (GA1ModelVo)vo; StringBuilder sql = new StringBuilder(); ValueObjectList <GA1ModelVo> voList = new ValueObjectList <GA1ModelVo>(); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append(@"select a90_barcode,a90_thurst_status from t_checkpusha90 where 1=1 "); if (!string.IsNullOrEmpty(inVo.A90Barcode)) { sql.Append(@" and oid = (select max(oid) oid from t_checkpusha90 where a90_barcode = :a90_barcode)"); sqlParameter.AddParameterString("a90_barcode", inVo.A90Barcode); } sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //execute SQL IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); while (dataReader.Read()) { GA1ModelVo outVo = new GA1ModelVo { A90Barcode = dataReader["a90_barcode"].ToString(), A90ThurstStatus = dataReader["a90_thurst_status"].ToString(), }; voList.add(outVo); } dataReader.Close(); return(voList); }
private void GridBind() { Draw_dgv.DataSource = null; try { DrawVo vo = new Vo.DrawVo { DrawCode = DrawCode_txt.Text, DrawName = DrawName_txt.Text }; ValueObjectList <DrawVo> volist = (ValueObjectList <DrawVo>)DefaultCbmInvoker.Invoke(new GetDrawCbm(), vo); if (volist.GetList() != null && volist.GetList().Count > 0) { Draw_dgv.AutoGenerateColumns = false; BindingSource bindingSource1 = new BindingSource(volist.GetList(), null); Draw_dgv.DataSource = bindingSource1; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); } Draw_dgv.ClearSelection(); Update_btn.Enabled = false; Delete_btn.Enabled = false; } catch (Com.Nidec.Mes.Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { WarehouseVTListVo inVo = (WarehouseVTListVo)vo; StringBuilder sql = new StringBuilder(); ValueObjectList <WarehouseVTListVo> voList = new ValueObjectList <WarehouseVTListVo>(); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sql.Append(@"select datalost_id, rfid, machine_serial,check_time, command from t_vt_datalost where 1=1 "); sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //check time ??? //execute SQL IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); while (dataReader.Read()) { WarehouseVTListVo outVo = new WarehouseVTListVo { DatalostId = int.Parse(dataReader["datalost_id"].ToString()), RFId = dataReader["rfid"].ToString(), MachineSerial = dataReader["machine_serial"].ToString(), CheckTime = int.Parse(dataReader["check_time"].ToString()), Comment = dataReader["command"].ToString(), }; voList.add(outVo); } dataReader.Close(); return(voList); }
private void GridBind() { try { FunctionDeptVo invo = new FunctionDeptVo() { DepartmentCode = DeptCode_cmb.Text, FunctionDeptCode = FunctionCode_txt.Text, FunctionDeptName = FunctionName_txt.Text, UserName = UserName_cmb.Text, //AssetNo = }; ValueObjectList <FunctionDeptVo> listvo = (ValueObjectList <FunctionDeptVo>)DefaultCbmInvoker.Invoke(new Cbm.SearchFunctionDeptVCBCbm(), invo); FunctionDeptDetails_dgv.DataSource = listvo.GetList(); } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
private void depart_cmb_TextUpdate(object sender, EventArgs e) { if (depart_cmb.Text != null) { ValueObjectList <DocumentVo> dpmlist = null; try { dpmlist = (ValueObjectList <DocumentVo>)DefaultCbmInvoker.Invoke(getDeptCbm, new DocumentVo { Department = depart_cmb.Text }); } catch (Framework.ApplicationException ex) { logger.Error(ex.GetMessageData()); popUpMessage.ApplicationError(ex.GetMessageData(), Text); return; } depart_cmb.DisplayMember = "Department"; BindingSource d1 = new BindingSource(dpmlist.GetList(), null); depart_cmb.DataSource = d1; depart_cmb.SelectedItem = true; } }
private void GridBind() { ProdutionWorkContentType_dgv.DataSource = null; try { ProdutionWorkContentTypeVo vo = new Vo.ProdutionWorkContentTypeVo { ProdutionWorkContentTypeCode = ProdutionWorkContentTypeCode_txt.Text, ProdutionWorkContentTypeName = ProdutionWorkContentTypeName_txt.Text }; ValueObjectList <ProdutionWorkContentTypeVo> volist = (ValueObjectList <ProdutionWorkContentTypeVo>)base.InvokeCbm(new GetProdutionWorkContentTypeCbm(), vo, false); if (volist.GetList() != null && volist.GetList().Count > 0) { ProdutionWorkContentType_dgv.AutoGenerateColumns = false; BindingSource bindingSource1 = new BindingSource(volist.GetList(), null); ProdutionWorkContentType_dgv.DataSource = bindingSource1; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); } ProdutionWorkContentType_dgv.ClearSelection(); Update_btn.Enabled = false; Delete_btn.Enabled = false; } catch (Com.Nidec.Mes.Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
private void AddJigDrawForm_Load(object sender, EventArgs e) { status_cmb.Items.Add("OK"); status_cmb.Items.Add("NG"); ValueObjectList <ModelVo> modelvolist = null; try { modelvolist = (ValueObjectList <ModelVo>)DefaultCbmInvoker.Invoke(getModelCbm, new ModelVo()); } catch (Com.Nidec.Mes.Framework.ApplicationException ex) { logger.Error(ex.GetMessageData()); popUpMessage.ApplicationError(ex.GetMessageData(), Text); return; } model_cmb.DisplayMember = "ModelCode"; BindingSource b1 = new BindingSource(modelvolist.GetList(), null); model_cmb.DataSource = b1; model_cmb.Text = ""; ValueObjectList <DrawVo> drawvolist = null; try { drawvolist = (ValueObjectList <DrawVo>)DefaultCbmInvoker.Invoke(new GetDrawCbm(), new DrawVo()); } catch (Com.Nidec.Mes.Framework.ApplicationException ex) { logger.Error(ex.GetMessageData()); popUpMessage.ApplicationError(ex.GetMessageData(), Text); return; } drawing_cmb.DisplayMember = "DrawCode"; BindingSource b = new BindingSource(drawvolist.GetList(), null); drawing_cmb.DataSource = b; drawing_cmb.Text = ""; LocalSupplierVo suppliervolist = null; try { suppliervolist = (LocalSupplierVo)DefaultCbmInvoker.Invoke(new GetLocalSupplierMasterMntCbm(), new LocalSupplierVo()); } catch (Com.Nidec.Mes.Framework.ApplicationException ex) { logger.Error(ex.GetMessageData()); popUpMessage.ApplicationError(ex.GetMessageData(), Text); return; } supplier_cmb.DisplayMember = "LocalSupplierName"; BindingSource b2 = new BindingSource(suppliervolist.LocalSupplierListVo, null); supplier_cmb.DataSource = b2; supplier_cmb.Text = ""; if (vo.JigID > 0) { model_cmb.Enabled = false; supplier_cmb.Enabled = false; model_cmb.Text = vo.ModelCode; supplier_cmb.Text = vo.SupplierName; process_cmb.Text = vo.ProcessName; jig_code_txt.Text = vo.JigBCode; drawing_cmb.Text = vo.DrawCode; place_cmb.Text = vo.JigPlace; status_cmb.Text = vo.Status; timereceive_dtp.Value = vo.TimeReceive; } }
/// <summary> /// save excel data to DB /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddExcel_btn_Click(object sender, EventArgs e) { if (DefectiveReason_dgv.RowCount > 0 && DefectiveReason_dgv.Columns["colRemarks"].Visible == true) { bool isRemarksNG = false; foreach (DataGridViewRow row in DefectiveReason_dgv.Rows) { if (DefectiveReason_dgv["colRemarks", row.Index].Value != null && !string.IsNullOrWhiteSpace(DefectiveReason_dgv["colRemarks", row.Index].Value.ToString())) { row.Cells["colRemarks"].Style.ForeColor = Color.Red; isRemarksNG = true; } } if (isRemarksNG) { messageData = new MessageData("mmci00015", Properties.Resources.mmci00015, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); return; } string previousReasonCode = string.Empty; int uploadedCount = 0; int insertedCount = 0; DefectiveReasonVo defectiveReasonInVo = new DefectiveReasonVo(); ProcessDefectiveReasonVo processDefectiveReasonInVo = new ProcessDefectiveReasonVo(); if (processWorkList.Count == 0) { GetProcessWork(); } this.StartProgress(Properties.Resources.mmci00009); foreach (DataRow row in excelUploadDt.Rows) { if (!string.IsNullOrEmpty(row["DefectiveReasonCode"].ToString()) && previousReasonCode != row["DefectiveReasonCode"].ToString()) { defectiveReasonInVo = new DefectiveReasonVo(); processDefectiveReasonInVo = new ProcessDefectiveReasonVo(); defectiveReasonInVo.DefectiveReasonCode = row["DefectiveReasonCode"].ToString(); defectiveReasonInVo.DefectiveReasonName = row["DefectiveReasonName"].ToString(); defectiveReasonInVo.DefectiveCategoryId = 0; defectiveReasonInVo.DisplayOrder = Convert.ToInt32(row["DisplayOrder"].ToString()); uploadedCount += 1; DataRow[] processWorkCodeList = excelUploadDt.Select("DefectiveReasonCode = '" + defectiveReasonInVo.DefectiveReasonCode + "'"); foreach (DataRow item in processWorkCodeList) { ProcessDefectiveReasonVo addVo = new ProcessDefectiveReasonVo(); ProcessWorkVo processWorkVo = processWorkList.Where(t => t.ProcessWorkCode == item["ProcessWorkCode"].ToString()).FirstOrDefault(); if (processWorkVo != null && processWorkVo.ProcessWorkId > 0) { addVo.ProcessWorkId = processWorkList.Where(t => t.ProcessWorkCode == item["ProcessWorkCode"].ToString()).FirstOrDefault().ProcessWorkId; processDefectiveReasonInVo.ProcessDefectiveReasonListVo.Add(addVo); } } ValueObjectList <ValueObject> inVoList = new ValueObjectList <ValueObject>(); inVoList.add(defectiveReasonInVo); inVoList.add(processDefectiveReasonInVo); DefectiveReasonVo outVo = null; try { outVo = (DefectiveReasonVo)base.InvokeCbm(new AddDefectiveReasonMasterMntNewCbm(), inVoList, false); } catch (Framework.ApplicationException exception) { this.CompleteProgress(); popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); return; } if (outVo != null && outVo.AffectedCount > 0) { insertedCount += outVo.AffectedCount; } } previousReasonCode = row["DefectiveReasonCode"].ToString(); } this.CompleteProgress(); if (insertedCount > 0 && uploadedCount > 0 && insertedCount == uploadedCount) { messageData = new MessageData("mmci00010", Properties.Resources.mmci00010, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); GridBind(FormConditionVo()); } } else { messageData = new MessageData("mmci00016", Properties.Resources.mmci00016, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); } }
public override ValueObject Execute(TransactionContext trxContext, ValueObject arg) { InspectionItemVo inVo = (InspectionItemVo)arg; StringBuilder sqlQuery = new StringBuilder(); //create SQL sqlQuery.Append("Select * from m_inspection_item "); sqlQuery.Append(" where factory_cd = :faccd "); if (inVo.InspectionProcessId > 0) { sqlQuery.Append(" and inspection_process_id = :inspectionprocessid "); } if (inVo.InspectionItemId > 0) { sqlQuery.Append(" and inspection_item_id != :inspectionitemid "); } if (inVo.InspectionItemCode != null) { sqlQuery.Append(" and UPPER(inspection_item_cd) like UPPER(:inspectionitemcd) "); } if (inVo.InspectionItemName != null) { sqlQuery.Append(" and UPPER(inspection_item_name) like UPPER(:inspectionitemname) "); } sqlQuery.Append(" order by display_order, inspection_item_cd"); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sqlParameter.AddParameterString("faccd", UserData.GetUserData().FactoryCode); if (inVo.InspectionProcessId > 0) { sqlParameter.AddParameterInteger("inspectionprocessid", inVo.InspectionProcessId); } if (inVo.InspectionItemId > 0) { sqlParameter.AddParameterInteger("inspectionitemid", inVo.InspectionItemId); } if (inVo.InspectionItemCode != null) { sqlParameter.AddParameterString("Insprocesscd", inVo.InspectionItemCode + "%"); } if (inVo.InspectionItemName != null) { sqlParameter.AddParameterString("Insprocessname", inVo.InspectionItemName + "%"); } //execute SQL IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); ValueObjectList <InspectionItemVo> outVo = null; while (dataReader.Read()) { InspectionItemVo currOutVo = new InspectionItemVo { InspectionItemCode = ConvertDBNull <string>(dataReader, "inspection_item_cd"), InspectionItemId = ConvertDBNull <int>(dataReader, "inspection_item_id"), InspectionItemName = ConvertDBNull <string>(dataReader, "inspection_item_name"), ParentInspectionItemId = ConvertDBNull <int>(dataReader, "inspection_process_id"), }; if (outVo == null) { outVo = new ValueObjectList <InspectionItemVo>(); outVo.add(new InspectionItemVo()); } outVo.add(currOutVo); } dataReader.Close(); return(outVo); }
public override ValueObject Execute(TransactionContext trxContext, ValueObject arg) { InspectionTestInstructionVo inVo = (InspectionTestInstructionVo)arg; StringBuilder sqlQuery = new StringBuilder(); sqlQuery.Append("select"); sqlQuery.Append(" inspection_test_instruction_id,"); sqlQuery.Append(" inspection_test_instruction_cd,"); sqlQuery.Append(" inspection_test_instruction_text"); sqlQuery.Append(" from m_inspection_test_instruction"); sqlQuery.Append(" where factory_cd = :faccd "); if (inVo.InspectionTestInstructionCode != null) { sqlQuery.Append(" and inspection_test_instruction_cd like :inspectiontestinstructioncd "); } if (inVo.InspectionTestInstructionText != null) { sqlQuery.Append(" and inspection_test_instruction_text like :inspectiontestinstructiontext "); } if (inVo.InspectionTestInstructionId > 0) { sqlQuery.Append(" and inspection_test_instruction_id = :inspectiontestinstructionid "); } sqlQuery.Append(" order by inspection_test_instruction_cd "); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sqlQuery.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); sqlParameter.AddParameterString("faccd", UserData.GetUserData().FactoryCode); if (inVo.InspectionTestInstructionCode != null) { sqlParameter.AddParameterString("inspectiontestinstructioncd", inVo.InspectionTestInstructionCode + "%"); } if (inVo.InspectionTestInstructionText != null) { sqlParameter.AddParameterString("inspectiontestinstructiontext", inVo.InspectionTestInstructionText + "%"); } if (inVo.InspectionTestInstructionId > 0) { sqlParameter.AddParameterInteger("inspectiontestinstructionid", inVo.InspectionTestInstructionId); } //execute SQL IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); ValueObjectList <InspectionTestInstructionVo> outVo = null; while (dataReader.Read()) { InspectionTestInstructionVo currOutVo = new InspectionTestInstructionVo(); currOutVo.InspectionTestInstructionId = ConvertDBNull <Int32>(dataReader, "inspection_test_instruction_id"); currOutVo.InspectionTestInstructionCode = ConvertDBNull <string>(dataReader, "inspection_test_instruction_cd"); currOutVo.InspectionTestInstructionText = ConvertDBNull <string>(dataReader, "inspection_test_instruction_text"); if (outVo == null) { outVo = new ValueObjectList <InspectionTestInstructionVo>(); } outVo.add(currOutVo); } dataReader.Close(); return(outVo); }
public override ValueObject Execute(TransactionContext trxContext, ValueObject vo) { WarehouseVTVo inVo = (WarehouseVTVo)vo; StringBuilder sql = new StringBuilder(); ValueObjectList <WarehouseVTVo> voList = new ValueObjectList <WarehouseVTVo>(); //create command DbCommandAdaptor sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //create parameter DbParameterList sqlParameter = sqlCommandAdapter.CreateParameterList(); if (inVo.ValueResult == "True") { sql.Append(@"select machine_id, rfid_cd, machine_cd, machine_name, machine_qty, machine_serial, machine_model, machine_location, machine_suppiler, machine_invoice, machine_costvalue, registration_user_cd ,registration_date_time,time_check_fi from t_vt_machine where 1=1 "); sql.Append(@" and time_check_fi =:time_check_fi"); sqlParameter.AddParameterInteger("time_check_fi", inVo.TimeCheck); sql.Append(" AND machine_status = 'Máy CTY' or machine_status = 'Đã Cho Mượn' "); } else if (inVo.ValueResult == "False") { sql.Append(@"select machine_id, rfid_cd, machine_cd, machine_name, machine_qty, machine_serial, machine_model, machine_location, machine_suppiler, machine_invoice, machine_costvalue, registration_user_cd ,registration_date_time,time_check_fi from t_vt_machine where 1=1 "); sql.Append(@" and time_check_fi !=:time_check_fi"); sqlParameter.AddParameterInteger("time_check_fi", inVo.TimeCheck); sql.Append(" AND machine_status = 'Máy CTY' or machine_status = 'Đã Cho Mượn' "); } if (!String.IsNullOrEmpty(inVo.MachineSerial)) { sql.Append(@" and machine_serial =:machine_serial"); sqlParameter.AddParameterString("machine_serial", inVo.MachineSerial); } if (!String.IsNullOrEmpty(inVo.RFId)) { sql.Append(@" and rfid_cd =:rfid_cd"); sqlParameter.AddParameter("rfid_cd", inVo.RFId); } sqlCommandAdapter = base.GetDbCommandAdaptor(trxContext, sql.ToString()); //execute SQL IDataReader dataReader = sqlCommandAdapter.ExecuteReader(trxContext, sqlParameter); while (dataReader.Read()) { WarehouseVTVo outVo = new WarehouseVTVo { MachineId = int.Parse(dataReader["machine_id"].ToString()), RFId = dataReader["rfid_cd"].ToString(), MachineCode = dataReader["machine_cd"].ToString(), MachineName = dataReader["machine_name"].ToString(), MachineQty = int.Parse(dataReader["machine_qty"].ToString()), MachineSerial = dataReader["machine_serial"].ToString(), MachineModel = dataReader["machine_model"].ToString(), MachineLocation = dataReader["machine_location"].ToString(), MachineSupplier = dataReader["machine_suppiler"].ToString(), MachineInvoice = dataReader["machine_invoice"].ToString(), MachineCostValue = (dataReader["machine_costvalue"].ToString()), RegistrationUserCode = dataReader["registration_user_cd"].ToString(), RegistrationDateTime = DateTime.Parse(dataReader["registration_date_time"].ToString()), TimeCheck = int.Parse(dataReader["time_check_fi"].ToString()), }; voList.add(outVo); } dataReader.Close(); return(voList); }
/// <summary> /// delete the selected record /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Delete_btn_Click(object sender, EventArgs e) { int selectedrowindex = InspectionTestInstructionDetail_dgv.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = InspectionTestInstructionDetail_dgv.Rows[selectedrowindex]; messageData = new MessageData("mmcc00004", Properties.Resources.mmcc00004, selectedRow.Cells["colInspectionTestInstructionDetailText"].Value.ToString()); // Logger.Info(messageData); DialogResult dialogResult = popUpMessage.ConfirmationOkCancel(messageData, Text); if (dialogResult == DialogResult.OK) { InspectionTestInstructionVo inVo = new InspectionTestInstructionVo(); inVo.InspectionTestInstructionDetailId = Convert.ToInt32(selectedRow.Cells["colInspectionTestInstructionDetailId"].Value.ToString()); inVo.InspectionTestInstructionId = Convert.ToInt32(selectedRow.Cells["colInspectionTestInstructionId"].Value.ToString()); inVo.DeleteFlag = true; string message = string.Format(Properties.Resources.mmci00038, "Inspection Test Instruction Detail", selectedRow.Cells["colInspectionTestInstructionDetailText"].Value.ToString()); StartProgress(message); ValueObjectList <ValueObject> inVoList = new ValueObjectList <ValueObject>(); InspectionFormatVo passformatVo = FormFormatVo(updateData.InspectionTestInstructionId); if (passformatVo == null || passformatVo.InspectionFormatId == 0) { return; } inVoList.add(passformatVo); inVoList.add(null); inVoList.add(null); inVoList.add(null); inVoList.add(null); inVoList.add(null); inVoList.add(inVo); InspectionReturnVo outVo = new InspectionReturnVo(); try { outVo = (InspectionReturnVo)base.InvokeCbm(new UpdateAllInspectionFunctionMasterMntCbm(), inVoList, false); } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } finally { CompleteProgress(); } if (outVo == null) { return; } InspectionTestInstructionId = outVo.InspectionTestInstructionId; updateData.InspectionTestInstructionId = outVo.InspectionTestInstructionId; GetInspTestCode(); GridBind(); this.messageData = new MessageData("mmci00003", Properties.Resources.mmci00003, null); logger.Info(this.messageData); popUpMessage.Information(this.messageData, Text); //inVo.InspectionTestInstructionDetailCode = selectedRow.Cells["colInspectionTestInstructionDetailCode"].Value.ToString(); //try //{ // InspectionTestInstructionVo outVo = (InspectionTestInstructionVo)base.InvokeCbm(new DeleteInspectionTestInstructionDetailMasterMntCbm(), inVo, false); // if (outVo.AffectedCount > 0) // { // this.messageData = new MessageData("mmci00003", Properties.Resources.mmci00003, null); // logger.Info(this.messageData); // popUpMessage.Information(this.messageData, Text); // GridBind(); // } // else if (outVo.AffectedCount == 0) // { // messageData = new MessageData("mmci00007", Properties.Resources.mmci00007, null); // logger.Info(messageData); // popUpMessage.Information(messageData, Text); // GridBind(); // } //} //catch (Framework.ApplicationException exception) //{ // popUpMessage.ApplicationError(exception.GetMessageData(), Text); // logger.Error(exception.GetMessageData()); //} } else if (dialogResult == DialogResult.Cancel) { //do something else } }