public ProductionLineProbablySaveResponse Execute(ProductionLineProbablySaveRequest request) { ProductionLineProbablySaveResponse probablySaveResponse = new ProductionLineProbablySaveResponse(); ProductionLineProbablyInfo productionLineProbably = ServiceHelper.LoadService <IProductionService>().GetProductionLineProbably(request.DID); productionLineProbably.Name = request.Name; productionLineProbably.TargetYield = request.TargetYield; ServiceHelper.LoadService <IProductionService>().SaveProductionLineProbably(productionLineProbably); return(probablySaveResponse); }
public ProductionLineProbablyGetResponse Execute(ProductionLineProbablyGetRequest request) { ProductionLineProbablyGetResponse probablyGetResponse = new ProductionLineProbablyGetResponse(); ProductionLineProbablyInfo productionLineProbably = ServiceHelper.LoadService <IProductionService>().GetProductionLineProbably(request.DID); if (productionLineProbably != null) { probablyGetResponse.ProductionLineProbably = productionLineProbably.ToModel(); } return(probablyGetResponse); }
public void SaveProductionLineProbably(ProductionLineProbablyInfo productionLineProbablyInfo) { Database equipDB = dataProvider.EQUIPDataBase; string sql = string.Format( @"update production_line_probably t set t.name = '{1}', t.production_type = '{2}', t.nowYield = {3}, t.targetYield = {4}, t.userName = '******' where t.did = {0}" , productionLineProbablyInfo.DID, productionLineProbablyInfo.Name, productionLineProbablyInfo.ProductionType , int.Parse(productionLineProbablyInfo.NowYield), int.Parse(productionLineProbablyInfo.TargetYield), productionLineProbablyInfo.UserName); equipDB.ExecuteScalar(CommandType.Text, sql); }
public ProductionLineProbablyInfo GetProductionLineProbably(int did) { DataTable tb = getProductionLineProbably(did); if (tb != null && tb.Rows.Count > 0) { int i = (tb.Rows.Count - 1); ProductionLineProbablyInfo info = new ProductionLineProbablyInfo(); info.DID = int.Parse(tb.Rows[i][0].ToString()); info.Name = tb.Rows[i][1].ToString(); info.ProductionType = tb.Rows[0][2].ToString(); info.NowYield = tb.Rows[i][3].ToString(); info.TargetYield = tb.Rows[i][4].ToString(); info.UserName = tb.Rows[i][5].ToString(); return(info); } else { throw new Exception("执行 getProductionLineProbably 查询到空值"); } }
public void SaveProductionLineProbably(ProductionLineProbablyInfo productionLineProbablyInfo) { this.DataContext.SaveChanges(); }
public static ProductionLineProbablyModel ToModel(this ProductionLineProbablyInfo entity) { return(Mapper.Map <ProductionLineProbablyInfo, ProductionLineProbablyModel>(entity)); }