public Operation Delete(InvRequisitionDetail objInvRequisitionDetail)
        {
            Operation objOperation = new Operation { Success = true, OperationId = objInvRequisitionDetail.Id };
            _RequisitionDetailRepository.Delete(objInvRequisitionDetail);

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception)
            {
                objOperation.Success = false;
            }
            return objOperation;
        }
 public void Update(InvRequisitionDetail objInvRequisitionDetail)
 {
     _RequisitionDetailRepository.Update(objInvRequisitionDetail);
 }
 public void Add(InvRequisitionDetail objInvRequisitionDetail)
 {
     _RequisitionDetailRepository.Add(objInvRequisitionDetail);
 }
        public ActionResult SaveDetail(List<RequisitionDetailViewModel> reqDetail)
        {
            Operation objOperation = new Operation { Success = false };

            if (ModelState.IsValid && reqDetail != null)
            {
                int Id = _RequisitionDetailService.GetLastId();
                foreach (var item in reqDetail)
                {
                    InvRequisitionDetail objInvRequisitionDetail = _RequisitionDetailService.GetById(item.Id);
                    if (objInvRequisitionDetail != null)
                    {
                        objInvRequisitionDetail.InvRequisitionId = item.InvRequisitionId;
                        objInvRequisitionDetail.SlsProductId = item.SlsProductId;
                        objInvRequisitionDetail.RequiredQuantity = item.RequiredQuantity;
                        objInvRequisitionDetail.SlsUnitId = item.SlsUnitId;
                        _RequisitionDetailService.Update(objInvRequisitionDetail);
                    }
                    else
                    {
                        objInvRequisitionDetail = new InvRequisitionDetail();
                        objInvRequisitionDetail.Id = Id;
                        objInvRequisitionDetail.InvRequisitionId = item.InvRequisitionId;
                        objInvRequisitionDetail.SlsProductId = item.SlsProductId;
                        objInvRequisitionDetail.RequiredQuantity = item.RequiredQuantity;
                        objInvRequisitionDetail.SlsUnitId = item.SlsUnitId;
                        _RequisitionDetailService.Add(objInvRequisitionDetail);
                        Id = Id + 1;
                    }

                }

                objOperation = _RequisitionDetailService.Commit();
            }

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }