Ejemplo n.º 1
0
        // GET: Organization
        public ActionResult Index()
        {
            JECRCEntities       db            = new JECRCEntities();
            List <Organization> organizations = db.Organization.ToList();

            ViewBag.organizationList = organizations;
            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult BranchCoordinatorDetails()
        {
            JECRCEntities db          = new JECRCEntities();
            List <Branch> FigCoorlist = db.Branch.ToList();

            ViewBag.FIGCoordDEtails = FigCoorlist;
            return(View());
        }
Ejemplo n.º 3
0
        // GET: Student
        public ActionResult Index()
        {
            JECRCEntities  db          = new JECRCEntities();
            List <Student> studentlist = db.Student.ToList();

            ViewBag.students = studentlist;
            return(View());
        }
Ejemplo n.º 4
0
        public ActionResult DisplayStudentsByBranch(int id)
        {
            JECRCEntities  db          = new JECRCEntities();
            List <Student> studentlist = db.Student.Where(i => i.BranchID == id).ToList();

            ViewBag.students = studentlist;
            return(View());
        }
Ejemplo n.º 5
0
        public ActionResult Display()
        {
            JECRCEntities db     = new JECRCEntities();
            List <Login>  logins = db.Login.ToList();

            ViewBag.loginList = logins;
            return(View());
        }
Ejemplo n.º 6
0
        public ActionResult ProfilDetails()
        {
            JECRCEntities db = new JECRCEntities();
            List <University_FIG_Coor> FigCoorunilist = db.University_FIG_Coor.ToList();

            ViewBag.FIGCoordDEtails = FigCoorunilist;
            return(View());
        }
Ejemplo n.º 7
0
        public ActionResult ListOfAllFIGsU()
        {
            JECRCEntities db = new JECRCEntities();

            List <FIG> Figlist = db.FIG.ToList();

            ViewBag.FIGDEtails = Figlist;

            return(View());
        }
Ejemplo n.º 8
0
        public ActionResult Create()
        {
            JECRCEntities db = new JECRCEntities();
            IEnumerable <SelectListItem> items = db.Branch.Select(b => new SelectListItem
            {
                Value = b.ID.ToString(),
                Text  = b.Name
            });

            ViewBag.Name = items;
            return(View(new StudentModel()));
        }
Ejemplo n.º 9
0
        public ActionResult DisplayStudentsByFIG(int id)
        {
            JECRCEntities  db          = new JECRCEntities();
            List <Student> studentlist = db.Student.Where(i => i.FigID == id).ToList();
            var            FIGDetails  = db.FIG.Where(i => i.ID == id).FirstOrDefault();

            Session["FIGID"]    = FIGDetails.ID;
            ViewData["FIGID"]   = FIGDetails.ID;
            ViewData["FIGName"] = FIGDetails.Name;
            ViewBag.students    = studentlist;
            return(View());
        }
Ejemplo n.º 10
0
        public ActionResult DisplayFIGByBranch(int id)
        {
            JECRCEntities db      = new JECRCEntities();
            List <FIG>    figlist = db.FIG.Where(i => i.BranchID == id).ToList();

            ViewBag.FIGs = figlist;
            var BranchDetails = db.Branch.Where(i => i.ID == id).FirstOrDefault();
            var branchName    = BranchDetails.Name;

            ViewData["branchName"] = branchName;

            return(View());
        }
Ejemplo n.º 11
0
 public ActionResult Add(Login login)
 {
     using (JECRCEntities db = new JECRCEntities())
     { if (db.Login.Any(x => x.Username == login.Username))
       {
           ViewBag.DuplicateMessage = "UserName already taken";
           return(View("Add", login));
       }
       db.Login.Add(login);
       db.SaveChanges(); }
     ModelState.Clear();
     ViewBag.SuccessMessage = "Registration successful";
     return(RedirectToAction("Create", "Organizations"));
 }
Ejemplo n.º 12
0
        public ActionResult Authorize(WebApplicationJECRC.Models.LoginModel loginModel)
        {
            using (JECRCEntities db = new JECRCEntities())
            {
                var loginDetails = db.Login.Where(x => x.Username == loginModel.Username && x.Password == loginModel.Password).FirstOrDefault();
                if (loginDetails == null)
                {
                    loginModel.LoadingErrorMessage = "Wrong username or password";
                    return(View("LoginForm", loginModel));
                }
                else
                {
                    Session["ID"] = loginDetails.ID;


                    var FIGUniDetails  = db.University_FIG_Coor.Where(x => x.LoginID == loginDetails.ID).FirstOrDefault();
                    var FIGCoorDetails = db.FIG_Coor.Where(x => x.LoginID == loginDetails.ID).FirstOrDefault();
                    var FIGDetails     = db.FIG.Where(x => x.LoginID == loginDetails.ID).FirstOrDefault();
                    var studentDetails = db.Student.Where(x => x.LoginID == loginDetails.ID).FirstOrDefault();
                    if (FIGCoorDetails != null)
                    {
                        var branchDetails = db.Branch.Where(i => i.FigCorrID == FIGCoorDetails.ID).FirstOrDefault();
                        var branchID      = branchDetails.ID;
                        return(RedirectToAction("DisplayFIGByBranch", "FIG", new { id = branchID }));
                    }
                    else if (FIGUniDetails != null)
                    {
                        return(RedirectToAction("Index", "FIG_University_Coor"));
                    }
                    else if (FIGDetails != null)
                    {
                        return(RedirectToAction("DisplayFIGDetails", "Student", new { id = FIGDetails.ID }));
                    }
                    else if (studentDetails != null)
                    {
                        return(RedirectToAction("StudentDetails", "Students", new { id = studentDetails.ID }));
                    }

                    else if (loginDetails.Username == "admin" && loginDetails.Password == "admin")
                    {
                        return(RedirectToAction("Index", "Admin"));
                    }
                }
            }
            return(View());
        }
Ejemplo n.º 13
0
        public ActionResult DisplayFIGDetails(int id)
        {
            JECRCEntities db = new JECRCEntities();


            ViewData["internsNbr"]           = db.Student.Where(i => i.FigID == id).Count();
            ViewData["internshipAllotedNbr"] = db.Student.Where(i => i.FigID == id && i.LetterAlloted == true).Count();
            ViewData["applied"]     = db.Student.Where(i => i.FigID == id && i.HasApplied == true).Count();
            ViewData["stipened"]    = db.Student.Where(i => i.FigID == id && i.IsPaid == true).Count();
            ViewData["NonStipened"] = db.Student.Where(i => i.FigID == id && i.IsPaid == false).Count();

            var Student    = db.Student.Where(i => i.FigID == id).FirstOrDefault();
            var branchName = Student.Branch.Name;

            ViewData["BranchName"] = branchName;
            var FIGDetails = db.FIG.Where(i => i.ID == id).FirstOrDefault();

            ViewData["FIGID"] = FIGDetails.ID;
            List <FIG> FIGlist = db.FIG.Where(i => i.ID == id).ToList();

            ViewBag.FIGs = FIGlist;

            return(View(id));
        }