Example #1
0
        public ActionResult UpdateFeeCalcucate(IFormCollection form)
        {
            FeePerAmount fee   = JsonConvert.DeserializeObject <FeePerAmount>(form["feeInfo"]);
            var          feeDB = feeService.GetFee(fee.Id);

            try
            {
                if (feeDB.Id > 0)
                {
                    feeDB.Amount1    = fee.Amount1;
                    feeDB.Amount2    = fee.Amount2;
                    feeDB.Percentage = fee.Percentage;
                    feeDB.TotalFees  = fee.TotalFees;
                    feeDB.UpdateDate = DateTime.Now;
                    feeService.UpdateFee(feeDB);
                    return(Json(new { success = true }));
                }
                else
                {
                    return(Json(new { success = false }));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { success = false }));
            }
        }
Example #2
0
        public ActionResult EditFeeCalcucate(int id)
        {
            FeePerAmount fee = new FeePerAmount();

            fee = feeService.GetFee(id);

            var JSON = Json(new { fee = fee, success = true });

            return(JSON);
        }
Example #3
0
        public ActionResult AddFeeCalcucate(IFormCollection form)
        {
            FeeCalculateVM fee = JsonConvert.DeserializeObject <FeeCalculateVM>(form["feeInfo"]);

            try
            {
                FeePerAmount data = new FeePerAmount();
                data.Amount1    = fee.Amount1;
                data.Amount2    = fee.Amount2;
                data.Percentage = fee.Percentage;
                data.TotalFees  = fee.TotalFees;
                data.AddDate    = DateTime.Now;
                data.Status     = 1;
                feeService.InsertFee(data);
                return(Json(new { success = true }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false }));
            }
        }
Example #4
0
 public void UpdateFee(FeePerAmount Fee)
 {
     FeeRepository.Update(Fee);
 }
Example #5
0
 public void InsertFee(FeePerAmount Fee)
 {
     FeeRepository.Insert(Fee);
 }
Example #6
0
        public void DeleteFee(int id)
        {
            FeePerAmount Fee = FeeRepository.Get(id);

            FeeRepository.Remove(Fee);
        }