コード例 #1
0
        //=========================
        public ActionResult AddFeeType()
        {
            FeeTypeDetailViewModel model = new FeeTypeDetailViewModel();

            model.FeeTypeList     = feeManegementService.GetFeeTypeList();
            model.SessionNameList = feeManegementService.GetSessionList();
            model.CourseList      = feeManegementService.GetCourseList();
            return(View(model));
        }
コード例 #2
0
        public ActionResult CreateFee()
        {
            FeeTypeDetailViewModel model = new FeeTypeDetailViewModel();

            model.FeeTypeList     = feeCollectionService.GetFeeTypeList();
            model.SessionNameList = feeCollectionService.GetSessionList();
            model.CourseList      = feeCollectionService.GetCourseList();
            return(View(model));
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 public ActionResult AddFeeType(FeeTypeDetailViewModel model)
 {
     TempData["msg"] = feeCollectionService.AddUpdateFeeTypeDetail(model);
     return(Redirect("CreateFee"));
 }
コード例 #5
0
 public ActionResult AddFeeType(FeeTypeDetailViewModel model)
 {
     model.EnteredBy = Convert.ToInt32(Session["UserId"]);
     TempData["msg"] = feeManegementService.AddUpdateFeeTypeDetail(model);
     return(Redirect("AddFeeType"));
 }