コード例 #1
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                FeeStructures feestructure = new Cateloge().SelectFeeStructures(id);

                if (feestructure == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    FeeStructure Formelements = new FeeStructure
                    {
                        Name_of_lvl = feestructure.Name_of_lvl,
                        Reg_fee     = feestructure.Reg_fee,
                        Monthly_fee = feestructure.Monthly_fee
                    };
                    return(PartialView("_CreateNewFeeSTructure", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #2
0
        public ActionResult Create(FeeStructure Add)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    FeeStructures AddFeeStructure = new FeeStructures();
                    AddFeeStructure.Name_of_lvl = Add.Name_of_lvl;
                    AddFeeStructure.Reg_fee     = Add.Reg_fee;
                    AddFeeStructure.Monthly_fee = Add.Monthly_fee;
                    AddFeeStructure.Date        = DateTime.Today.ToString("dd-MM-yyyy");
                    AddFeeStructure.Month       = DateTime.Today.ToString("MMM");
                    AddFeeStructure.Year        = DateTime.Today.ToString("yyyy");
                    AddFeeStructure.Time        = DateTime.Now.ToString("HH:mm:ss");
                    new Cateloge().AddFeeStructure(AddFeeStructure);
                    TempData["Msg"] = "New Fee Structure Have Added Successfully";
                    return(RedirectToAction("Index"));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #3
0
        public async Task <ActionResult> DeleteConfirmed(string id)
        {
            FeeStructure feeStructure = await db.FeeStructures.FindAsync(id);

            db.FeeStructures.Remove(feeStructure);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #4
0
        public async Task <ActionResult> Edit([Bind(Include = "FeeID,RID,AdmissionFee,TotalFee,TransportFee,AnnualCharges,OtherCharges,Status,Session")] FeeStructure feeStructure)
        {
            if (ModelState.IsValid)
            {
                db.Entry(feeStructure).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(feeStructure));
        }
コード例 #5
0
        public async Task <ActionResult> Create([Bind(Include = "FeeID,RID,AdmissionFee,TotalFee,TransportFee,AnnualCharges,OtherCharges,Status,Session")] FeeStructure feeStructure)
        {
            if (ModelState.IsValid)
            {
                db.FeeStructures.Add(feeStructure);
                await db.SaveChangesAsync();

                TempData["Success"] = "Saved Successfully";
                return(RedirectToAction("Index"));
            }

            return(View(feeStructure));
        }
コード例 #6
0
        // GET: FeeStructures/Delete/5
        public async Task <ActionResult> Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FeeStructure feeStructure = await db.FeeStructures.FindAsync(id);

            if (feeStructure == null)
            {
                return(HttpNotFound());
            }
            return(View(feeStructure));
        }
コード例 #7
0
        private ModelFeeStructure CopyFSToMFS(FeeStructure FS)
        {
            ModelFeeStructure MFS = new ModelFeeStructure
            {
                Id          = FS.Id,
                FkProgramId = FS.FkProgramId,
                Shift       = FS.Shift,
                Year1       = FS.Year1,
                Year2       = FS.Year2,
                DateCreated = FS.DateCreated,
                DateUpdated = FS.DateUpdated,
            };

            return(MFS);
        }
コード例 #8
0
        private FeeStructure CopyMFSToFS(ModelFeeStructure MFS)
        {
            FeeStructure FS = new FeeStructure
            {
                Id          = MFS.Id,
                FkProgramId = MFS.FkProgramId,
                Shift       = MFS.Shift,
                Year1       = MFS.Year1,
                Year2       = MFS.Year2,
                DateCreated = MFS.DateCreated,
                DateUpdated = MFS.DateUpdated,
            };

            return(FS);
        }
コード例 #9
0
        public IActionResult UpdateFeeStructure(int id)
        {
            if (id < 1)
            {
                return(NotFound());
            }
            FeeStructure FS = OurdbContext.FeeStructure.Find(id);

            if (FS.Id < 1)
            {
                return(NotFound());
            }
            IList <Program> ILP = OurdbContext.Program.ToList();

            ViewBag.vb = ILP;
            IList <Shift> ILS = OurdbContext.Shift.ToList();

            ViewBag.vbs = ILS;
            return(View("AddUpdateFeeStructure", CopyFSToMFS(FS)));
        }
コード例 #10
0
        public ActionResult Publish(FeeStructure pfs, int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    FeeStructures PublishFeeStructures = new FeeStructures();
                    PublishFeeStructures.Publish = pfs.Publish;
                    new Cateloge().PublishFeeStructure(PublishFeeStructures, id);
                    TempData["Msg"] = "This Star Have Published Successfully";
                    return(RedirectToAction("View", new { id = id }));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #11
0
        //public IActionResult FeeStructureDelete(int FeeStructureID)
        //{
        //    FeeStructure obj = OurdbContext.FeeStructure.Where(abc => abc.Id == FeeStructureID).FirstOrDefault<FeeStructure>();
        //    OurdbContext.FeeStructure.Remove(obj);
        //    OurdbContext.SaveChanges();
        //    return RedirectToAction(nameof(AdministratorController.FeeStructureList));
        //}

        public bool DeleteFeeStructure(int Id)
        {
            try
            {
                FeeStructure FS = OurdbContext.FeeStructure.Find(Id);
                if (FS != null)
                {
                    OurdbContext.FeeStructure.Remove(FS);
                    OurdbContext.SaveChanges();
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
コード例 #12
0
 public ActionResult Edit(FeeStructure Update, int id)
 {
     if (Session["Username"] == null && Session["Password"] == null)
     {
         return(RedirectToAction("Index", "Admin", new { area = "" }));
     }
     else
     {
         if (ModelState.IsValid)
         {
             FeeStructures UpdateFeeStructure = new FeeStructures();
             UpdateFeeStructure.Name_of_lvl = Update.Name_of_lvl;
             UpdateFeeStructure.Reg_fee     = Update.Reg_fee;
             UpdateFeeStructure.Monthly_fee = Update.Monthly_fee;
             new Cateloge().UpdateFeeStructure(UpdateFeeStructure, id);
             TempData["Msg"] = "Fee Stucture Have Updated Successfully";
             return(RedirectToAction("Index"));
         }
         return(View(Update));
     }
 }
コード例 #13
0
        public async Task <ActionResult> Create([Bind(Include = "REGId,Session,Type,AddmissionNumber,RollNumber,CID,SCID,FirstName,LastName,Gender,DOB,CatID,Mobile,Email,AdmissionDate,Image,FatherName,FatherPhone,FatherOccupation,MotherName,MotherPhone,MotherOccupation,CurrentAddress,ParmanentAddress,AadharNumber,TID,SpecialCase,Remarks,AdmissionFee")] Registration registration, string admission, HttpPostedFileBase file, Helper Help)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    registration.Image = Help.uploadfile(file);
                    var check = db.Registrations.Where(x => x.AddmissionNumber == registration.AddmissionNumber).FirstOrDefault();
                    if (check != null)
                    {
                        this.SetNotification("Admission Number Busy", NotificationEnumeration.Error);
                        ViewBag.CatID = new SelectList(db.CatDatas, "CatID", "CategoryName", registration.CatID);
                        ViewBag.CID   = new SelectList(db.SchoolClasses, "CID", "ClassName", registration.CID);
                        ViewBag.SCID  = new SelectList(db.Sections, "SCID", "SectionName", registration.SCID);
                        ViewBag.TID   = new SelectList(db.TransportCharges, "TID", "AreaName", registration.TID);
                        return(View());
                    }
                    else
                    {
                        db.Registrations.Add(registration);
                        await db.SaveChangesAsync();

                        FeeModule        sm = db.FeeModules.Where(x => x.CID == registration.CID).FirstOrDefault();
                        TransportCharges tc = db.TransportCharges.Where(x => x.TID == registration.TID).FirstOrDefault();
                        if (sm != null)
                        {
                            #region Fee Structure
                            FeeStructure fs = new FeeStructure();
                            fs.Date          = registration.AdmissionDate;
                            fs.AdmissionFee  = Convert.ToDouble(admission);
                            fs.AnnualCharges = sm.AnnualCharges;
                            fs.TotalFee      = (sm.Fee * Convert.ToDouble(12));
                            fs.TransportFee  = (tc.Amount * Convert.ToDouble(12));
                            fs.RID           = Convert.ToInt32(registration.AddmissionNumber);
                            fs.Status        = "Pending";
                            fs.Session       = Session["session"].ToString();
                            fs.AnnualCharges = 0;
                            fs.OtherCharges  = 0;
                            fs.Pay           = 0;

                            fs.Discount = 0.0;
                            fs.Fine     = 0.0;
                            db.FeeStructures.Add(fs);
                            db.SaveChanges();
                            #endregion
                        }
                    }
                }
                catch (DbEntityValidationException dbEx)
                {
                    foreach (var validationErrors in dbEx.EntityValidationErrors)
                    {
                        foreach (var validationError in validationErrors.ValidationErrors)
                        {
                            System.Console.WriteLine("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage);
                        }
                    }

                    throw;
                }
                TempData["Success"] = "Saved Successfully";
                return(RedirectToAction("Index"));
            }

            ViewBag.CatID = new SelectList(db.CatDatas, "CatID", "CategoryName", registration.CatID);
            ViewBag.CID   = new SelectList(db.SchoolClasses, "CID", "ClassName", registration.CID);
            ViewBag.SCID  = new SelectList(db.Sections, "SCID", "SectionName", registration.SCID);
            ViewBag.TID   = new SelectList(db.TransportCharges, "TID", "AreaName", registration.TID);
            return(View(registration));
        }
コード例 #14
0
        public ActionResult Fee(string bill, string date, string totalvalue, string annual, string transport, string pay, string balance, string period, int regno, string discount, string reason, string other, MonthlyFee Month, FeeStructure fee, MasterFee Master)
        {
            try
            {
                string[] array = new string[12];
                array = period.Split(',');
                if (array.Length > 0)
                {
                    double total       = (Convert.ToDouble(totalvalue) / Convert.ToDouble(array.Length));
                    double paymonthly  = (Convert.ToDouble(pay) / Convert.ToDouble(array.Length));
                    double paybal      = (Convert.ToDouble(balance) / Convert.ToDouble(array.Length));
                    double paydiscount = (Convert.ToDouble(discount) / Convert.ToDouble(array.Length));
                    double payother    = (Convert.ToDouble(other) / Convert.ToDouble(array.Length));
                    for (int i = 1; i <= array.Length; i++)
                    {
                        int a = i - 1;
                        Month.Date       = date;
                        Month.BillNo     = Convert.ToInt32(bill);
                        Month.TimePeriod = array[a];
                        Month.Paid       = paymonthly;
                        Month.TotalFee   = total;
                        Month.session    = Session["session"].ToString();
                        Month.Balance    = paybal;
                        Month.status     = "Paid";
                        Month.Discount   = paydiscount;
                        Month.Reason     = reason;
                        Month.Other      = payother;
                        Month.RID        = regno;
                        db.MonthlyFees.Add(Month);
                        db.SaveChanges();
                    }
                    Master.Date       = date;
                    Master.BillNo     = Convert.ToInt32(bill);
                    Master.TimePeriod = period;
                    Master.Paid       = Convert.ToDouble(pay);
                    Master.TotalFee   = Convert.ToDouble(totalvalue);
                    Master.session    = Session["session"].ToString();
                    Master.Balance    = Convert.ToDouble(balance);
                    Master.status     = "Paid";
                    Master.Discount   = Convert.ToDouble(discount);
                    Master.Reason     = reason;
                    Master.Other      = Convert.ToDouble(other);
                    Master.RID        = regno;
                    db.MasterFees.Add(Master);
                    db.SaveChanges();
                }

                var id = db.FeeStructures.Where(x => x.RID == regno).FirstOrDefault().FeeID;
                fee = db.FeeStructures.Find(id);
                if (fee != null)
                {
                    fee.Pay           = (Convert.ToDouble(fee.Pay) + Convert.ToDouble(pay));
                    fee.Discount      = (Convert.ToDouble(fee.Discount) + Convert.ToDouble(discount));
                    fee.AnnualCharges = (Convert.ToDouble(fee.AnnualCharges) + Convert.ToDouble(annual));
                    //fee.AdmissionFee = (Convert.ToDouble(fee.Discount) + Convert.ToDouble(discount));
                    db.Entry(fee).State = EntityState.Modified;

                    db.SaveChanges();
                }



                return(RedirectToAction("Index", "Invoice", new { id = bill }));
            }
            catch
            {
                return(View());
            }
        }
コード例 #15
0
        public IActionResult FeeStructureDetail(int FeeStructureID)
        {
            FeeStructure obj = OurdbContext.FeeStructure.Where(abc => abc.Id == FeeStructureID).FirstOrDefault <FeeStructure>();

            return(View(obj));
        }
コード例 #16
0
        public ActionResult Index(string Search_key)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                if (!string.IsNullOrEmpty(Search_key))
                {
                    List <FeeStructures> Searched = new Cateloge().SearchFeeStructures(Search_key);

                    if (Searched == null)
                    {
                        ViewBag.StatusMessage = " No Any Data Found ! ";
                    }
                    else
                    {
                        AllClasses Data = new AllClasses();
                        Data.FeeStructure_s = new List <FeeStructure>();
                        foreach (var gdfc in Searched)
                        {
                            FeeStructure dbr = new FeeStructure();
                            dbr.Id          = gdfc.db_Id;
                            dbr.Name_of_lvl = gdfc.Name_of_lvl;
                            dbr.Reg_fee     = gdfc.Reg_fee;
                            dbr.Monthly_fee = gdfc.Monthly_fee;
                            Data.FeeStructure_s.Add(dbr);
                        }
                        Data.FeeStructure_s.TrimExcess();
                        return(View(Data));
                    }
                }
                else
                {
                    List <FeeStructures> feestructures = new Cateloge().FeeStructures();

                    if (feestructures == null)
                    {
                        ViewBag.StatusMessage = " No Any Data Found ! ";
                    }
                    else
                    {
                        AllClasses Data = new AllClasses();
                        Data.FeeStructure_s = new List <FeeStructure>();
                        foreach (var gdfc in feestructures)
                        {
                            FeeStructure dbr = new FeeStructure();
                            dbr.Id          = gdfc.db_Id;
                            dbr.Name_of_lvl = gdfc.Name_of_lvl;
                            dbr.Reg_fee     = gdfc.Reg_fee;
                            dbr.Monthly_fee = gdfc.Monthly_fee;
                            Data.FeeStructure_s.Add(dbr);
                        }
                        Data.FeeStructure_s.TrimExcess();
                        return(View(Data));
                    }
                }
                return(View());
            }
        }