Beispiel #1
0
 public SaleControlViewModel(SaleControl entity)
 {
     SaleControlID = entity.SaleControlID;
     FoodMenuID    = entity.FoodMenuID;
     OrderID       = entity.OrderID;
     Quantity      = entity.Quantity;
     StatusService = entity.StatusService;
 }
Beispiel #2
0
        // PUT: api/SaleControl/5
        public async Task <HttpResponseMessage> Put(int id, [FromBody] SaleControl value)
        {
            var response = new SingleResponse <SaleControlViewModel>();

            try
            {
                var entity = await Task.Run(() =>
                {
                    return(BusinessObject.UpdateSaleControl(value));
                });

                response.Model = new SaleControlViewModel(entity);
            }
            catch (Exception ex)
            {
                response.DidError     = true;
                response.ErrorMessage = ex.Message;
            }
            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Beispiel #3
0
 public SaleControl CreateSaleControl(SaleControl entity)
 {
     UnitOfWork.SaleControlRepository.Add(entity);
     UnitOfWork.CommitChanges();
     return(entity);
 }
Beispiel #4
0
 public SaleControl DeleteSaleControl(SaleControl entity)
 {
     UnitOfWork.SaleControlRepository.Remove(entity);
     UnitOfWork.CommitChanges();
     return(entity);
 }
Beispiel #5
0
 public SaleControl GetSaleControl(SaleControl entity)
 {
     return(UnitOfWork.SaleControlRepository.Get(entity));
 }