public void UpdateSMTDashBoardInfo(SMT_DashBoard_MantainInfo conditicon) { string methodName = MethodBase.GetCurrentMethod().Name; logger.DebugFormat("BEGIN: {0}()", methodName); SMT_Dashboard_Line_Time_Qty smtDashBoardMaintain = new SMT_Dashboard_Line_Time_Qty(); try { using (UnitOfWork uow = new UnitOfWork()) { smtDashBoardMaintain.ID = conditicon.id; smtDashBoardMaintain.Line = conditicon.line; smtDashBoardMaintain.Qty = conditicon.standardOutput; smtDashBoardMaintain.DurTime = conditicon.durTime; smtDashBoardMaintain.Editor = conditicon.editor; smtDashBoardMaintain.Cdt = conditicon.StandardOutputCdt; smtDashBoardMaintain.Udt = DateTime.Now; SMTDashBoardRep.Update(smtDashBoardMaintain); uow.Commit(); } } catch (Exception e) { BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e); throw; } finally { BaseLog.LoggingEnd(logger, methodName); } }
public IList<ECOModelInfo> SaveECOModelChange(ECOModelInfo item) { string methodName = MethodBase.GetCurrentMethod().Name; BaseLog.LoggingBegin(logger, methodName); try { ECOModel items = new ECOModel(); string preStatus = item.PreStatus; string model = item.Model; items.Udt = DateTime.Now; items.PreStatus = preStatus; items.Status = item.Status; items.Remark = item.Remark; items.Editor = item.Editor; items.Cdt = item.Cdt; items.Plant = item.Plant; items.ValidateFromDate = item.ValidateFromDate; items.ECONo = item.ECONo; items.ECRNo = item.ECRNo; items.Model = model; items.ID = item.ID; using (UnitOfWork uow = new UnitOfWork()) { IRepository<ECOModel> ecoModelRep = new Repository<ECOModel>("HPIMESDB"); IRepository<ConstValueType> constValueTypeRep = new Repository<ConstValueType>("HPIMESDB"); IList<ConstValueType> constvaluetemp = new List<ConstValueType>(); if (preStatus == "HoldTravelCard") { constvaluetemp = (from q in constValueTypeRep.Query() where q.Type == "HolTravelCardModel" && q.Value.Contains(model) select q).ToList(); if (constvaluetemp.Count != 0) { constValueTypeRep.Delete(constvaluetemp[0], false); } } ecoModelRep.Update(items); uow.Commit(); } return GetECOModelList(item.ID); } catch (Exception e) { BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e); throw; } finally { BaseLog.LoggingEnd(logger, methodName); } }
public void AddSMTDashboardInfo(SMT_DashBoard_MantainInfo conditicon) { string methodName = MethodBase.GetCurrentMethod().Name; logger.DebugFormat("BEGIN: {0}()", methodName); try { using (UnitOfWork uow = new UnitOfWork()) { SMT_Dashboard_Line_Time_Qty smtDashBoardMaintain = new SMT_Dashboard_Line_Time_Qty(); SMT_Dashboard_Result smtDashboardResult = new SMT_Dashboard_Result(); smtDashBoardMaintain.Line = conditicon.line; smtDashBoardMaintain.Qty = conditicon.standardOutput; smtDashBoardMaintain.DurTime = "08:00--10:00"; smtDashBoardMaintain.Editor = conditicon.editor; smtDashBoardMaintain.Cdt = DateTime.Now; smtDashBoardMaintain.Udt = DateTime.Now; smtDashboardResult.Line = conditicon.line; smtDashboardResult.DurTime = "08:00--10:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); // 将数据塞入Maintain 表中 SMTDashBoardResultRep.Insert(smtDashboardResult);//将Line和时间段塞入 结果表中 uow.Commit(); smtDashBoardMaintain.DurTime = "10:00--12:00"; smtDashboardResult.DurTime = "10:00--12:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "12:00--14:00"; smtDashboardResult.DurTime = "12:00--14:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "14:00--16:00"; smtDashboardResult.DurTime = "14:00--16:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "16:00--18:00"; smtDashboardResult.DurTime = "16:00--18:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "18:00--20:30"; smtDashboardResult.DurTime = "18:00--20:30"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "20:30--22:00"; smtDashboardResult.DurTime = "20:30--22:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "22:00--00:00"; smtDashboardResult.DurTime = "22:00--00:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "00:00--02:00"; smtDashboardResult.DurTime = "00:00--02:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "02:00--04:00"; smtDashboardResult.DurTime = "02:00--04:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "04:00--06:00"; smtDashboardResult.DurTime = "04:00--06:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); smtDashBoardMaintain.DurTime = "06:00--08:00"; smtDashboardResult.DurTime = "06:00--08:00"; SMTDashBoardRep.Insert(smtDashBoardMaintain); SMTDashBoardResultRep.Insert(smtDashboardResult); uow.Commit(); } } catch (Exception e) { BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e); throw; } finally { BaseLog.LoggingEnd(logger, methodName); } }