Exemple #1
0
        public ResponseUpdateWorkprice UpdateWorkprice(int id, RequestUpdateWorkprice request)
        {
            var workpriceItem = dbManager.GetWorkpriceById(id);

            if (workpriceItem == null)
            {
                throw new Exception("Не найдена работа в БД");
            }

            workpriceItem.ContactPrice = request.ContactPrice;
            workpriceItem.ExactPrice   = request.ExactPrice;
            workpriceItem.Name         = request.Name;
            workpriceItem.Price        = request.Price;
            workpriceItem.Unity        = request.Unity;

            dbManager.UpdateWorkprice(workpriceItem);

            return(new ResponseUpdateWorkprice());
        }
Exemple #2
0
 public ResponseUpdateWorkprice UpdateWorkprice(int id, [FromBody] RequestUpdateWorkprice request)
 {
     return(ExecuteWrapper.Execute(() => { return aManager.UpdateWorkprice(id, request); }));
 }