Esempio n. 1
0
        public ActionResult ViewChalan()
        {
            if (Session["StudentLgnFlag"] != null)
            {
                var temp = (Student)Session["StudentLgnFlag"];
                ViewData["student"] = temp;
                List <ParentFeeModel> fee = new List <ParentFeeModel>();
                var result = from x in db.Fees where x.Student_Id == temp.Id select x;
                result.Reverse <Fee>();
                foreach (var x in result)
                {
                    ParentFeeModel tmp = new ParentFeeModel();
                    tmp.Fee = x;

                    Student tmpstd = new Student();
                    tmpstd = db.Students.Find(x.Student_Id);

                    tmp.Student = tmpstd;

                    Class tmpcls = new Class();
                    tmpcls = db.Classes.Find(x.Class_Id);

                    tmp.Class = tmpcls;
                    fee.Add(tmp);
                }
                return(View(fee));
            }
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public ActionResult SaveChalan(int id)
        {
            ParentFeeModel model = new ParentFeeModel();

            model.Fee              = db.Fees.Find(id);
            model.Class            = db.Classes.Find(model.Fee.Class_Id);
            model.Student          = db.Students.Find(model.Fee.Student_Id);
            ViewData["chalandata"] = model;
            var report = new ViewAsPdf("SaveChalan")
            {
                FileName        = "FeeChallan[" + model.Student.Std_Name + "]",
                PageSize        = Rotativa.Options.Size.A4,
                PageOrientation = Rotativa.Options.Orientation.Portrait
            };

            return(report);
        }
Esempio n. 3
0
 public ActionResult GenerateChallan()
 {
     if (Session["AdminLgnFlag"] != null)
     {
         var temp = (Admin)Session["AdminLgnFlag"];
         ViewData["admin"] = temp;
         List <Fee> collection = new List <Fee>();
         collection = db.Fees.ToList <Fee>();
         List <ParentFeeModel> modelList = new List <ParentFeeModel>();    //model list
         foreach (var item in collection)
         {
             ParentFeeModel model = new ParentFeeModel();
             model.Fee     = item;
             model.Class   = db.Classes.Find(item.Class_Id);
             model.Student = db.Students.Find(item.Student_Id);
             modelList.Add(model);
         }
         return(View(modelList));
     }
     return(RedirectToAction("Index"));
 }