public ActionResult Save(SlsUnit slsUnit)
        {
            int userId = Convert.ToInt32(Session["userId"]);
            Operation objOperation = new Operation { Success = false };

            if (ModelState.IsValid)
            {
                if (slsUnit.Id == 0)
                {
                    if ((bool)Session["Add"])
                    {
                        slsUnit.CreatedBy = userId;
                        slsUnit.CreatedDate = DateTime.Now.Date;
                        objOperation = _unitOfMeasurementService.Save(slsUnit);
                    }
                    else { objOperation.OperationId = -1; }

                }
                else
                {
                    if ((bool)Session["Edit"])
                    {
                        slsUnit.ModifiedBy = userId;
                        slsUnit.ModifiedDate = DateTime.Now.Date;
                        objOperation = _unitOfMeasurementService.Update(slsUnit);
                    }
                    else { objOperation.OperationId = -2; }
                }
            }

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }
        public Operation Delete(SlsUnit objAnFMeasurementUnit)
        {
            Operation objOperation = new Operation { Success = true, OperationId = objAnFMeasurementUnit.Id };
            _AnFMeasurementUnitRepository.Delete(objAnFMeasurementUnit);

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception)
            {

                objOperation.Success = false;
            }
            return objOperation;
        }
        public Operation Save(SlsUnit objAnFMeasurementUnit)
        {
            Operation objOperation = new Operation { Success = true };

            long Id = _AnFMeasurementUnitRepository.AddEntity(objAnFMeasurementUnit);
            objOperation.OperationId = Id;

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception ex)
            {
                objOperation.Success = false;
            }
            return objOperation;
        }