public async Task <HttpResponseMessage> UpdateOrgUnit([FromUri] int id, [FromBody] EditOrgUnitModel model)
        {
            Log.Out.BeginInfo(model.ToJson(), "UpdateOrgUnit Id: {0}", id);
            await Service.Get <IManagementSevice>().UpdateOrgUnit(id, model);

            Log.Out.EndInfo("UpdateOrgUnit Id: {0}", id);
            return(Request.CreateResponse(HttpStatusCode.OK));
        }
        public async Task <HttpResponseMessage> AddOrgUnit([FromBody] EditOrgUnitModel model)
        {
            Log.Out.BeginInfo(model.ToJson(), "AddOrgUnit");
            var id = await Service.Get <IManagementSevice>().AddOrgUnit(model);

            Log.Out.EndInfo("AddOrgUnit Id: {0}", id);
            return(Request.CreateResponse(HttpStatusCode.OK, new { Id = id }));
        }
Beispiel #3
0
 public Task UpdateOrgUnit(int id, EditOrgUnitModel model)
 {
     return(Update <OrgUnit, IOrgUnitRepository>(id, orgUnit =>
     {
         var entity = model.GetEntity();
         orgUnit.Name = entity.Name;
         orgUnit.Address = entity.Address;
         orgUnit.OwnerId = entity.OwnerId;
         orgUnit.ParentId = entity.ParentId;
         orgUnit.ModificationTime = entity.ModificationTime;
         orgUnit.WorkspaceTemplateId = entity.WorkspaceTemplateId;
     }));
 }
Beispiel #4
0
 public Task <int> AddOrgUnit(EditOrgUnitModel model)
 {
     return(Add <OrgUnit, IOrgUnitRepository>(orgUnit => orgUnit.Id, model.GetEntity));
 }