Ejemplo n.º 1
0
        /*_______________________________________________________________________________________________________________________________________________________
         *  JISHNU*/
        public static List <checkfeesmodel> checkfees(int year, int sem)
        {
            Database DB = new Database();
            List <checkfeesmodel> FeeDefault = new List <checkfeesmodel>();
            var BatchList = DB.Batches.Where(i => i.Year == year && i.Semester == sem);

            foreach (var n in BatchList)
            {
                var SDIDs = DB.StudentDetails.Where(i => i.BID == n.BID).Select(i => i.SDID);
                foreach (int k in SDIDs)
                {
                    var feesid = DB.Feess.Where(i => i.SDID == k).FirstOrDefault();
                    if (feesid == null)
                    {
                        checkfeesmodel fees = new checkfeesmodel();
                        fees.SID    = DB.StudentDetails.Where(i => i.SDID == k).Select(i => i.SID).First();
                        fees.name   = DB.Logins.Where(i => i.LoginId == fees.SID).Select(i => i.UserName).First();
                        fees.branch = DB.Departments.Where(i => i.DID == n.DID).Select(i => i.DepartmentName).First();
                        fees.year   = n.Year;
                        fees.sem    = n.Semester;
                        FeeDefault.Add(fees);
                    }
                }
            }
            return(FeeDefault);
        }
 public ActionResult Checkfee(checkfeesmodel cfm)
 {
     try
     {
         int j    = (int)Session["id"];
         var role = Data.roles(j);
         if (role == "Management")
         {
             List <checkfeesmodel> cf = Data.checkfees(cfm.year, cfm.sem);
             return(View(cf));
         }
         else
         {
             return(Redirect("/Teacher/Access"));
         }
     }
     catch
     {
         return(Redirect("/Login/Login"));
     }
 }