Пример #1
0
 public ResponseViewModel GetOldQuantity(InwardOutwardVM inwardOutwardVM)
 {
     try
     {
         decimal OldQty = 0;
         if (!string.IsNullOrEmpty(inwardOutwardVM.CreatedBy) && inwardOutwardVM.ItemId > 0)
         {
             var Data = itemOldQuantityRepository.FindBy(x => x.IsDeleted == false && x.CreatedBy == inwardOutwardVM.CreatedBy && x.ItemId == inwardOutwardVM.ItemId).FirstOrDefault();
             //inwardOutwardRepository.FindBy(x => x.IsDeleted == false && x.CreatedBy == inwardOutwardVM.CreatedBy && x.ItemId == inwardOutwardVM.ItemId).FirstOrDefault();
             if (Data != null && Data.Id > 0)
             {
                 OldQty = Data.TotalQuantity;
             }
             response.IsSuccess = true;
             response.Status    = "SUCCESS";
             response.Message   = "Get Old Quantity successfully...";
             response.Content   = OldQty;
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Status    = "FAILED";
         response.Message   = "Something went wrong";
     }
     return(response);
 }
        public HttpResponseMessage SaveInwardOutwardData(InwardOutwardVM inwardOutwardVM)
        {
            var response = inwardOutwardService.SaveInwardOutwardData(inwardOutwardVM);

            if (response.IsSuccess)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, response, "application/json"));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, response, "application/json"));
            }
        }
Пример #3
0
        public HttpResponseMessage GetOldQuantity(InwardOutwardVM inwardOutwardVM)
        {
            var response = commonService.GetOldQuantity(inwardOutwardVM);

            if (response.IsSuccess)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, response, "application/json"));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, response, "application/json"));
            }
        }