public Operation Delete(SlsFreeProduct obj)
        {
            Operation objOperation = new Operation { Success = true, OperationId = obj.Id };
            _FreeProductRepository.Delete(obj);

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

                objOperation.Success = false;
            }
            return objOperation;
        }
        public ActionResult Save(SlsFreeProduct obj)
        {
            int userId = Convert.ToInt32(Session["userId"]);
            Operation objOperation = new Operation { Success = false };
            int companyId = Convert.ToInt32(Session["companyId"]);

            if (ModelState.IsValid)
            {
                if (obj.Id == 0)
                {
                    if ((bool)Session["Add"])
                    {

                        obj.CreatedBy = userId;
                        obj.CreatedDate = DateTime.Now.Date;
                        obj.SecCompnayId = companyId;
                        objOperation = _FreeProductService.Save(obj);
                    }
                    else { objOperation.OperationId = -1; }

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

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }
        public Operation Save(SlsFreeProduct obj)
        {
            Operation objOperation = new Operation { Success = true };

            long Id = _FreeProductRepository.AddEntity(obj);
            objOperation.OperationId = Id;

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