public OperationResult CheckItemDetail(PlanTimeJob_Items item) { try { var updateResult = db.ExecuteStoredProcedure("PlanSchedule_AddTimeJobDetail", new string[] { "EQID", "Month", "Year" }, new object[] { item.EQID, item.Month, item.Year }); operationResult.Success = true; operationResult.Message = "Update Successed!"; operationResult.Caption = "Successed!"; } catch (Exception ex) { operationResult.Success = false; operationResult.Message = "There are some things wrong: " + ex.ToString(); operationResult.Caption = "Error!"; Loger.Error(ex); } return(operationResult); }
public bool CreateSchedule(PlanTimeJob plan, List <string> propertylist) { Console.WriteLine("DOCPlanTimeJobDAL-CreateSchedule():" + DateTime.Now); var trans = acQC.BeginTransaction(); try { plan.ScheduleName = string.Format("Schedule_{0:yyyyMMdd_HHmmss}", DateTime.Now); plan.ScheduleUID = Guid.NewGuid(); plan.UserID = Shawoo.GenuineChannels.GenuineUtility.CurrentSession["UID"].ToString(); plan.Remark = CreateRemark(plan); //1.Create Schedule db.Insert(plan, trans); //2.Save To PlanTimeJob_Items for (int i = 0; i < propertylist.Count; i++) { var planitem = new PlanTimeJob_Items { JobID = plan.JobID, ScheduleUID = plan.ScheduleUID, ItemOrder = i + 1, SampleName = plan.SampleName, PropertyName = propertylist[i] }; db.Insert(planitem, trans); } trans.Commit(); return(true); } catch (Exception e) { trans.Rollback(); log.Error(e); throw new Exception(e.Message); } }
public IHttpActionResult CheckItemDetail(PlanTimeJob_Items item) => Ok(_planScheduleService.CheckItemDetail(item));