Ejemplo n.º 1
0
        private static void AddWorkPlan()
        {
            WorkPlanProider _Provider = new WorkPlanProider();
            WorkPlan        _WorkPlan = new WorkPlan();

            _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 = "工作计划";
            WorkPlanContacts _WorkPlanContacts = new WorkPlanContacts();

            _WorkPlanContacts.phone        = "13811961223";
            _WorkPlanContacts.statue       = "add";
            _WorkPlanContacts.contactsName = "test1";
            _WorkPlan.Contacts.Add(_WorkPlanContacts);
            _Provider.AddWorkPlan(_WorkPlan);
        }
Ejemplo n.º 2
0
 public HttpResponseMessage AddWorkPlan([FromBody] WorkPlan Data)
 {
     try
     {
         WorkPlanProider _Provider = new WorkPlanProider();
         var             result    = _Provider.AddWorkPlan(Data);
         return(Request.CreateResponse(HttpStatusCode.OK, result));
     }
     catch (Exception ex)
     {
         LogFactory _LogFactory = new LogFactory(this.GetType());
         _LogFactory.CreateLog(LogType.Error, "新建工作计划", "AddWorkPlan", ex);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }