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 })); } }
public ActionResult EditFeeCalcucate(int id) { FeePerAmount fee = new FeePerAmount(); fee = feeService.GetFee(id); var JSON = Json(new { fee = fee, success = true }); return(JSON); }
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 })); } }
public void UpdateFee(FeePerAmount Fee) { FeeRepository.Update(Fee); }
public void InsertFee(FeePerAmount Fee) { FeeRepository.Insert(Fee); }
public void DeleteFee(int id) { FeePerAmount Fee = FeeRepository.Get(id); FeeRepository.Remove(Fee); }