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

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

                }
                else
                {
                    if ((bool)Session["Edit"])
                    {
                        objT.ModifiedBy = userId;
                        objT.ModifiedDate = DateTime.Now.Date;
                        objOperation = _CommissionPackageService.Update(objT);
                    }
                    else { objOperation.OperationId = -2; }
                }
            }
            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }
        public ActionResult Delete(SlsCommissionPackage objT)
        {
            Operation objOperation = new Operation { Success = false };

            if (objT!= null && objT.Id != 0)
            {
                objOperation = _CommissionPackageService.Delete(objT);
            }
            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }
        public Operation Delete(SlsCommissionPackage obj)
        {
            Operation objOperation = new Operation { Success = true, OperationId = obj.Id };

            try
            {
                SlsCommissionPackage objD = _CommissionPackageRepository.GetById(obj.Id);
                _CommissionPackageRepository.Delete(objD);
                _UnitOfWork.Commit();
            }
            catch (Exception ex)
            {

                objOperation.Success = false;
            }
            return objOperation;
        }
        public Operation Update(SlsCommissionPackage obj)
        {
            Operation objOperation = new Operation { Success = true, OperationId = obj.Id };

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

            }
            return objOperation;
        }
        public Operation Save(SlsCommissionPackage obj)
        {
            Operation objOperation = new Operation { Success = true };

            try
            {
                int newId = 1;
                try
                {
                    newId = _CommissionPackageRepository.GetTableContext().Max(i => i.Id) + 1;
                }
                catch(Exception ex)
                {

                }
                obj.Id = newId;
                objOperation.OperationId = newId;
                _CommissionPackageRepository.Add(obj);

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