//IE public PagedListModel <IEPlanManagerVM> QueryProcessIEMGData(int masterUID, DateTime date) { var totalCount = 0; var flChartList = flowChartMasterRepository.QueryFlowIEMGData(masterUID, date, out totalCount); var result = new List <IEPlanManagerVM>(); foreach (var item in flChartList) { var returnItem = new IEPlanManagerVM(); returnItem.Detail_UID = item.Detail_UID; returnItem.Process_seq = item.Process_seq; returnItem.Process = item.Process; returnItem.Place = item.Place; returnItem.date = item.date; returnItem.Color = item.Color; returnItem.ShiftTimeID = item.ShiftTimeID; returnItem.MondayIE_TargetEfficacy = item.MondayIE_TargetEfficacy; returnItem.MondayIE_DeptHuman = item.MondayIE_DeptHuman; returnItem.ThursdayIE_TargetEfficacy = item.ThursdayIE_TargetEfficacy; returnItem.ThursdayIE_DeptHuman = item.ThursdayIE_DeptHuman; returnItem.WednesdayIE_TargetEfficacy = item.WednesdayIE_TargetEfficacy; returnItem.WednesdayIE_DeptHuman = item.WednesdayIE_DeptHuman; returnItem.TuesdayIE_TargetEfficacy = item.TuesdayIE_TargetEfficacy; returnItem.TuesdayIE_DeptHuman = item.TuesdayIE_DeptHuman; returnItem.FridayIE_TargetEfficacy = item.FridayIE_TargetEfficacy; returnItem.FridayIE_DeptHuman = item.FridayIE_DeptHuman; returnItem.SaterdayIE_TargetEfficacy = item.SaterdayIE_TargetEfficacy; returnItem.SaterdayIE_DeptHuman = item.SaterdayIE_DeptHuman; returnItem.SundayIE_TargetEfficacy = item.SundayIE_TargetEfficacy; returnItem.SundayIE_DeptHuman = item.SundayIE_DeptHuman; result.Add(returnItem); } return(new PagedListModel <IEPlanManagerVM>(totalCount, result)); }
public string FlowIEChartPlan(IEPlanManagerVM ent) { var items = flowChartMasterRepository.UpdateIEPlan(ent.Detail_UID, ent.date, ent.ShiftTimeID); int i = 0; foreach (var item in items) { i++; // item.ShiftTimeID = int.Parse(ent.ShiftTimeID.ToString()); if (Week(item.IE_TargetDate) == "星期一") { item.IE_TargetEfficacy = int.Parse(ent.MondayIE_TargetEfficacy.ToString()); item.IE_DeptHuman = int.Parse(ent.MondayIE_DeptHuman.ToString()); flowChartIEMgDataRepository.Update(item); } if (Week(item.IE_TargetDate) == "星期二") { item.IE_TargetEfficacy = int.Parse(ent.TuesdayIE_TargetEfficacy.ToString()); item.IE_DeptHuman = int.Parse(ent.TuesdayIE_DeptHuman.ToString()); flowChartIEMgDataRepository.Update(item); } if (Week(item.IE_TargetDate) == "星期三") { item.IE_TargetEfficacy = int.Parse(ent.WednesdayIE_TargetEfficacy.ToString()); item.IE_DeptHuman = int.Parse(ent.WednesdayIE_DeptHuman.ToString()); flowChartIEMgDataRepository.Update(item); } if (Week(item.IE_TargetDate) == "星期四") { item.IE_TargetEfficacy = int.Parse(ent.ThursdayIE_TargetEfficacy.ToString()); item.IE_DeptHuman = int.Parse(ent.ThursdayIE_DeptHuman.ToString()); flowChartIEMgDataRepository.Update(item); } if (Week(item.IE_TargetDate) == "星期五") { item.IE_TargetEfficacy = int.Parse(ent.FridayIE_TargetEfficacy.ToString()); item.IE_DeptHuman = int.Parse(ent.FridayIE_DeptHuman.ToString()); flowChartIEMgDataRepository.Update(item); } if (Week(item.IE_TargetDate) == "星期六") { item.IE_TargetEfficacy = int.Parse(ent.SaterdayIE_TargetEfficacy.ToString()); item.IE_DeptHuman = int.Parse(ent.SaterdayIE_DeptHuman.ToString()); flowChartIEMgDataRepository.Update(item); } if (Week(item.IE_TargetDate) == "星期日") { item.IE_TargetEfficacy = int.Parse(ent.SundayIE_TargetEfficacy.ToString()); item.IE_DeptHuman = int.Parse(ent.SundayIE_DeptHuman.ToString()); flowChartIEMgDataRepository.Update(item); } } unitOfWork.Commit(); return("SUCCESS"); }