public JsonResult GetClassInFaculty(string id) { var model = new FacultyDAO().getclassinfaculty(id).Select(x => new { CLASSes = x.CLASSes.Select(a => new { IDCLASS = a.ID, NAMECLASS = a.NAME, MAJORCLASS = a.MAJOR }) }); return(Json(new { data = model }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetTeacherInFaculy(string id) { var model = new FacultyDAO().getteacherinfaculty(id).Select(x => new { C_USER = x.C_USER.Select(a => new { IDTEA = a.ID, FIRST_NAME = a.FIRST_NAME, LAST_NAME = a.LAST_NAME, MIDDLE_NAME = a.MIDDLE_NAME }) }); return(Json(new { data = model }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetSubjectsInFaculty(string id) { var model = new FacultyDAO().getsubjectsinfaculty(id).Select(x => new { SUBJECTs = x.SUBJECTs.Select(a => new { IDSUBS = a.ID, NAMESUBS = a.NAME }) }); return(Json(new { data = model }, JsonRequestBehavior.AllowGet)); }
public JsonResult ChangeStatus(Guid?Id) { var result = new FacultyDAO().ChangeStatus(Id); return(Json(new { Status = result })); }
public ActionResult FacultyResponse() { Faculty facultymodel = new Faculty(); FacultyDAO facultyDao = new FacultyDAO(); facultymodel.faculty_username = Session["faculty_uname"].ToString(); facultymodel.faculty_userpassword = Session["faculty_password"].ToString(); facultymodel.faculty_response = Int32.Parse(Request["approve"].ToString()); int student_id = Int32.Parse(Request["student_id"].ToString()); int result = facultyDao.Facultyvalidate(facultymodel.faculty_username, facultymodel.faculty_userpassword); if (result == 1) { List <Faculty> faculty = facultyDao.FacultySelectData(facultymodel); foreach (Faculty faculties in faculty) { facultymodel.faculty_id = faculties.faculty_id; ViewBag.faculty_name = faculties.faculty_username; ViewBag.faculty_lab = faculties.faculty_lab; } string connectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Starkushal\Desktop\QueryBoxdb\QueryBoxdb.mdf;Integrated Security=True;Connect Timeout=30"; DataTable dtblStudent = new DataTable(); using (SqlConnection sqlCon = new SqlConnection(connectionString)) { sqlCon.Open(); string sqlquery = "select* from Student where id_student = any(select Id_student from Query where Id_faculty =" + facultymodel.faculty_id + " )"; SqlDataAdapter sqlDa = new SqlDataAdapter(sqlquery, sqlCon); sqlDa.Fill(dtblStudent); sqlCon.Close(); } //update faculty response int responseres = facultyDao.facultyresponse(facultymodel, student_id); if (responseres == 0) { ViewBag.response = "you have already responded query !!!"; } else { ViewBag.response = "responded to student sucessfully "; } return(View("FacultyHome", dtblStudent)); } else { ViewBag.status = "Invalid Credentials try Again!!!"; return(View("FacultyLogin")); } }
public ActionResult ImagesApproved(string fACULTY_Code) { var session = (UserLogin)Session[CommonConstants.USER_SESSION]; if (session.RoleGroup == "MARKETINGMANAGER") { var model = new FacultyDAO().ImagesApproved(fACULTY_Code); ViewBag.fACULTY_Code = fACULTY_Code; return(View(model)); } else { return(RedirectToAction("Error403", "Error", new { area = "" })); } }
public ActionResult Delete(Guid?Id) { var result = new FacultyDAO().Delete(Id); if (result) { SetAlert("Deleted successfully", "success"); return(RedirectToAction("Index", "Faculty")); } else { SetAlert("Deletion failed!", "warning"); return(RedirectToAction("Index", "Faculty")); } }
public ActionResult FacultyHome(Object sender, EventArgs args) { Faculty facultymodel = new Faculty(); FacultyDAO facultyDao = new FacultyDAO(); facultymodel.faculty_username = Request.Form["uname"]; facultymodel.faculty_userpassword = Request.Form["psw"]; Session["faculty_uname"] = facultymodel.faculty_username; Session["faculty_password"] = facultymodel.faculty_userpassword; int result = facultyDao.Facultyvalidate(facultymodel.faculty_username, facultymodel.faculty_userpassword); if (result == 1) { List <Faculty> faculty = facultyDao.FacultySelectData(facultymodel); foreach (Faculty faculties in faculty) { facultymodel.faculty_id = faculties.faculty_id; ViewBag.faculty_name = faculties.faculty_username; ViewBag.faculty_lab = faculties.faculty_lab; } Session["faculty_id"] = facultymodel.faculty_id; string connectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Starkushal\Desktop\QueryBoxdb\QueryBoxdb.mdf;Integrated Security=True;Connect Timeout=30"; DataTable dtblStudent = new DataTable(); using (SqlConnection sqlCon = new SqlConnection(connectionString)) { sqlCon.Open(); string sqlquery = "select * from Student where id_student = any(select Id_student from Query where Id_faculty =" + facultymodel.faculty_id + " )"; SqlDataAdapter sqlDa = new SqlDataAdapter(sqlquery, sqlCon); sqlDa.Fill(dtblStudent); sqlCon.Close(); } return(View(dtblStudent)); } else { ViewBag.status = "Invalid Credentials try Again!!!"; return(View("FacultyLogin")); } }
public ActionResult Index() { var model = new FacultyDAO().ListAll(); return(View(model)); }
public JsonResult GetFacultyID_NAME() { var model = new FacultyDAO().getfaculty().Select(x => new { ID = x.ID, NAME = x.NAME }); return(Json(new { data = model }, JsonRequestBehavior.AllowGet)); }