示例#1
0
        /// <summary>
        /// Обновление информации отделения.
        /// </summary>
        /// <param name="department">Отделение, информацию которого следует обновить.</param>
        public async void Update(IEntity department)
        {
            ID       = department.ID;
            DeptName = (department as Department).DeptName;
            DeptInfo = (department as Department).DeptInfo;

            DataServiceStub ds = new DataServiceStub();
            await ds.UpdateDepartment(this);
        }
 /// <summary>
 /// Обновление данных отделения.
 /// </summary>
 /// <param name="department">отделение, данные которого требуется обновить.</param>
 /// <returns>Статус выполнения запроса</returns>
 public HttpResponseMessage Put([FromBody] Department department)
 {
     try
     {
         DataServiceStub ds = new DataServiceStub();
         ds.UpdateDepartment(department);
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, ex));
     }
 }