public ActionResult Index() { EJobEntities db = new EJobEntities(); var model = db.Recruitments.Where(x => x.Status_id == 2 && x.Is_Show == true).ToList(); var num_member = db.Student_Info.Where(x => x.Status_Id == 1).Count(); var num_company = db.Company_Info.ToList().Count(); ViewBag.com = num_company; ViewBag.mem = num_member; ViewBag.count = model.Count(); return(View(model)); }
//create student_info public bool CreateStudent(ApplicationUser user) { using (EJobEntities db = new EJobEntities()) { Student_Info nStudent = new Student_Info { Account_Id = user.Id, Status_Id = 1, Student_Name = user.UserName, Student_Create_at = DateTime.Now }; db.Student_Info.Add(nStudent); try { db.SaveChanges(); var check = UserManager.AddToRole(user.Id, "Student"); return(true); } catch { } } return(false); }