//========================= public ActionResult AddFeeType() { FeeTypeDetailViewModel model = new FeeTypeDetailViewModel(); model.FeeTypeList = feeManegementService.GetFeeTypeList(); model.SessionNameList = feeManegementService.GetSessionList(); model.CourseList = feeManegementService.GetCourseList(); return(View(model)); }
public ActionResult CreateFee() { FeeTypeDetailViewModel model = new FeeTypeDetailViewModel(); model.FeeTypeList = feeCollectionService.GetFeeTypeList(); model.SessionNameList = feeCollectionService.GetSessionList(); model.CourseList = feeCollectionService.GetCourseList(); return(View(model)); }
public string AddUpdateFeeTypeDetail(FeeTypeDetailViewModel model) { string Message = ""; try { ptaFeeTypeDetail obj; if (model.Id > 0) { obj = _context.ptaFeeTypeDetails.Where(f => f.Id == model.Id).FirstOrDefault(); Message = "Successfully Updated!"; } else { var data = _context.ptaFeeTypeDetails .Where(f => f.PTACourseMasterId == model.CourseId && f.PTASessionMasterId == model.SessionMasterId && f.PTAFeeTypeId == model.FeeTypeId).FirstOrDefault(); if (data != null) { Message = "This FeeType Detail record already exist!"; return(Message); } obj = new ptaFeeTypeDetail(); Message = "Successfully Inserted!"; } obj.PTACourseMasterId = model.CourseId; obj.Amount = model.Amount.Value; obj.PTAFeeTypeId = model.FeeTypeId; obj.IsActive = model.IsActive; obj.PTASessionMasterId = model.SessionMasterId; if (model.Id == 0) { _context.ptaFeeTypeDetails.Add(obj); } _context.SaveChanges(); return(Message); } catch (Exception ex) { return(ex.Message); } }
public ActionResult AddFeeType(FeeTypeDetailViewModel model) { TempData["msg"] = feeCollectionService.AddUpdateFeeTypeDetail(model); return(Redirect("CreateFee")); }
public ActionResult AddFeeType(FeeTypeDetailViewModel model) { model.EnteredBy = Convert.ToInt32(Session["UserId"]); TempData["msg"] = feeManegementService.AddUpdateFeeTypeDetail(model); return(Redirect("AddFeeType")); }