public JsonResult GetTaxFormula(TaxFormulaViewModel tViewModel)
        {
            PaginationInfo pager = new PaginationInfo();

            pager = tViewModel.Pager;

            PaginationViewModel pViewModel = new PaginationViewModel();

            try
            {
                pViewModel.dt = _tRepo.GetTaxFormula(tViewModel.TaxFormula.TaxFormulaName, ref pager);

                pViewModel.Pager = pager;

                Logger.Debug("TaxFormula Controller GetTaxFormula");
            }

            catch (Exception ex)
            {
                tViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("TaxFormula Controller - GetTaxFormula" + ex.ToString());
            }

            return(Json(JsonConvert.SerializeObject(pViewModel), JsonRequestBehavior.AllowGet));
        }
        public PartialViewResult GetFormulaCharges(int TaxFormulaId)
        {
            TaxFormulaViewModel tViewModel = new TaxFormulaViewModel();

            PaginationInfo pager = null;

            tViewModel.TaxFormulaCharges = _tRepo.GetTaxFormulaCharges(TaxFormulaId, ref pager);

            return(PartialView("_FormulaCharges", tViewModel));
        }
        public ActionResult Index(TaxFormulaViewModel tViewModel)
        {
            if (TempData["tViewModel"] != null)
            {
                tViewModel = (TaxFormulaViewModel)TempData["tViewModel"];
            }

            Set_Date_Session(tViewModel.TaxFormula);

            tViewModel.Charges = _tRepo.drpGetCharges();

            return(View("Index", tViewModel));
        }
        public ActionResult GetTaxFormulaById(TaxFormulaViewModel tViewModel)
        {
            try
            {
                tViewModel.TaxFormula = _tRepo.GetTaxFormulaById(tViewModel.TaxFormula.TaxFormulaId);

                Logger.Debug("TaxFormula Controller GetTaxFormulaById");
            }
            catch (Exception ex)
            {
                tViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("TaxFormula Controller - GetTaxFormulaById" + ex.ToString());
            }

            TempData["tViewModel"] = tViewModel;

            return(Index(tViewModel));
        }
        public JsonResult CheckTaxFormulaNameExist(string taxFormulaName, int taxFormulaId)
        {
            bool check = false;

            TaxFormulaViewModel tViewModel = new TaxFormulaViewModel();

            try
            {
                check = _tRepo.CheckTaxFormulaNameExist(taxFormulaName, taxFormulaId);

                Logger.Debug("TaxFormula Controller CheckTaxFormulaNameExist");
            }
            catch (Exception ex)
            {
                Logger.Error("TaxFormula Controller - CheckTaxFormulaNameExist" + ex.Message);
            }

            return(Json(check, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Update(TaxFormulaViewModel tViewModel)
        {
            try
            {
                Set_Date_Session(tViewModel.TaxFormula);

                _tRepo.UpdateTaxFormula(tViewModel.TaxFormula);

                tViewModel.FriendlyMessage.Add(MessageStore.Get("TF02"));

                Logger.Debug("TaxFormula Controller Update");
            }
            catch (Exception ex)
            {
                tViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("TaxFormula Controller - Update  " + ex.Message);
            }

            return(Json(tViewModel));
        }
        public JsonResult Insert(TaxFormulaViewModel tViewModel)
        {
            try
            {
                Set_Date_Session(tViewModel.TaxFormula);

                tViewModel.TaxFormula.TaxFormulaId = _tRepo.InsertTaxFormula(tViewModel.TaxFormula);

                tViewModel.FriendlyMessage.Add(MessageStore.Get("TF01"));

                Logger.Debug("TaxFormula Controller Insert");
            }

            catch (Exception ex)
            {
                tViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("TaxFormula Controller - Insert " + ex.Message);
            }

            return(Json(tViewModel));
        }
 public ActionResult Search(TaxFormulaViewModel tViewModel)
 {
     return(View("Search", tViewModel));
 }