private static void updateWorkPlan() { WorkPlanProider _Provider = new WorkPlanProider(); WorkPlan _WorkPlan = new WorkPlan(); _WorkPlan.id = 5; _WorkPlan.address = "sd"; _WorkPlan.addressCity = "sdsd"; _WorkPlan.addressCityID = 1; _WorkPlan.addressProvince = "sddd"; _WorkPlan.addressProvinceID = 1; _WorkPlan.content = "sddd"; _WorkPlan.scale = 10; _WorkPlan.startTime = DateTime.Now; _WorkPlan.endTime = DateTime.Now; _WorkPlan.workPlanTypeID = 1; _WorkPlan.year = "2017"; _WorkPlan.name = "工作计划3"; WorkPlanContacts _WorkPlanContacts = new WorkPlanContacts(); _WorkPlanContacts.id = 2; _WorkPlanContacts.phone = "13811961223"; _WorkPlanContacts.statue = "edit"; _WorkPlanContacts.contactsName = "test2ee"; _WorkPlan.Contacts.Add(_WorkPlanContacts); _Provider.UpdateWorkPlan(_WorkPlan); }
public HttpResponseMessage UpdateWorkPlan([FromBody] WorkPlan Data) { try { WorkPlanProider _Provider = new WorkPlanProider(); var result = _Provider.UpdateWorkPlan(Data); return(Request.CreateResponse(HttpStatusCode.OK, result)); } catch (Exception ex) { LogFactory _LogFactory = new LogFactory(this.GetType()); _LogFactory.CreateLog(LogType.Error, "修改工作计划", "UpdateWorkPlan", ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }