public void Add(InvStoreOpening objAnFOpeningBalance) { int lastId=_InvStoreOpeningRepository.GetLastId(); objAnFOpeningBalance.Id = lastId; _InvStoreOpeningRepository.Add(objAnFOpeningBalance); }
public ActionResult Update(List<InvStoreOpeningViewModel> viewModelList) { Operation objOperation = new Operation { Success = false }; int userId = Convert.ToInt32(Session["userId"]); if (ModelState.IsValid && viewModelList != null) { foreach (var item in viewModelList) { InvStoreOpening objInvStoreOpening = _StoreOpeningService.GetById(item.Id); SlsUnit objSlsUnit = _unitOfMeasurementService.GetByName(item.Unit); if (objInvStoreOpening != null) { objInvStoreOpening.Quantity = item.Quantity; objInvStoreOpening.SlsUnitId = objSlsUnit.Id; objInvStoreOpening.ModifiedBy = userId; objInvStoreOpening.ModifiedDate = DateTime.Now; _StoreOpeningService.Update(objInvStoreOpening); } else { objInvStoreOpening = new InvStoreOpening(); objInvStoreOpening.InvStoreId = item.InvStoreId; objInvStoreOpening.SlsProductId = item.SlsProductId; objInvStoreOpening.Quantity = item.Quantity; objInvStoreOpening.SlsUnitId = objSlsUnit.Id; objInvStoreOpening.CreatedBy = userId; objInvStoreOpening.CreatedDate = DateTime.Now; _StoreOpeningService.Add(objInvStoreOpening); } } objOperation = _StoreOpeningService.Commit(); } return Json(objOperation, JsonRequestBehavior.DenyGet); }
public Operation Delete(InvStoreOpening objAnFOpeningBalance) { throw new NotImplementedException(); }
public void Update(InvStoreOpening objAnFOpeningBalance) { _InvStoreOpeningRepository.Update(objAnFOpeningBalance); }
public void Remove(InvStoreOpening objAnFOpeningBalance) { _InvStoreOpeningRepository.Delete(objAnFOpeningBalance); }