public ActionResult Sign_up() { People_Model people = new People_Model(); ViewBag.genero = people.queryGenero(); return(View()); }
public List<People_Model> GetListGiaoVien(string BranchID) { List<People_Model> rs = new List<People_Model>(); ThuVien tv = new ThuVien(); try { DataTable tbBranch = tv.SP_SelectDataTable("USP_People_GetBySomeConditional", new string[] { "@flag", "@PeopleCode", "@BranchID" }, new object[] { 4,"GV", BranchID }); if (tbBranch.Rows.Count > 0) { for (int i = 0; i < tbBranch.Rows.Count; i++) { People_Model pmodel = new People_Model(); pmodel.PeopleID = tbBranch.Rows[i]["TeacherID"].ToString(); pmodel.PeopleName = tbBranch.Rows[i]["PeopleName"].ToString(); //pmodel.PeopleCode = tbBranch.Rows[i]["PeopleCode"].ToString(); rs.Add(pmodel); } } } catch (Exception ex) { throw (ex); } return rs; }
public ActionResult Sign_up(People_Model pm) { //ViewBag.test=Request["Email"]; if (pm.createPeople()) { return(RedirectToAction("../Home/Login")); } else { ViewBag.genero = pm.queryGenero(); return(View()); } }
public bool CrearPersona(People_Model pm) { try { System.Data.DataRow dd = conn.EjecutarConsulta("SELECT id_Genero as t FROM Genero WHERE Tipo='" + pm.Genero + "';").Rows[0]; int fk_genero = int.Parse(dd["t"].ToString()); conn.EjecutarOperacion("CALL insert_Persona('" + pm.Fecha_Nacimiento + "'," + pm.Identificacion + ",'" + pm.Nombre1 + "','" + pm.Nombre2 + "','" + pm.Apellido1 + "','" + pm.Apellido2 + "'," + pm.Telefono + "," + fk_genero + ")"); return(conn.EjecutarOperacion("CALL insert_Usuario('" + pm.Email + "','" + pm.Password + "'," + fk_genero + ");")); } catch (Exception) { return(false); } }
public List<People_Model> LayDSHV(string MaTV, int StudentStatusID) { ThuVien tv = new ThuVien(); List <People_Model> rs = new List <People_Model>(); DataTable tbPeople = tv.SP_SelectDataTable("USP_Student_GetBySomeConditional", // new string[] { "@ClassID", "@sWeek", "@sMonth" }, new object[] { 7, 2, 7 }); new string[] { "@flag", "@StudentStatusID" }, new object[] { 7, StudentStatusID }); for (int i = 0; i < tbPeople.Rows.Count; i++) { People_Model pmodel = new People_Model(); pmodel.PeopleID = tbPeople.Rows[i]["StudentID"].ToString(); pmodel.PeopleName = tbPeople.Rows[i]["StudentName"].ToString(); rs.Add(pmodel); } return rs; }