public ActionResult btnEnviar() { var per = new MPersona(); var dir = new MDireccion(); var user = Request.Form["inUsuario"].ToString(); var pass = Request.Form["inpPass"].ToString(); var con = new ConPG(); var rol = ConPG.rolUsuario(ConPG.autenticar(user, pass)); //con.ingresarPersona(per, dir); if (rol == 1) { //FormsAuthentication.RedirectFromLoginPage(user, false) return(View("~\\Views\\Principal\\Principal.cshtml")); } else { if (rol == 3 || rol == 4) { return(View("~\\Views\\Tickets\\Index.cshtml")); } else { return(View("~\\Views\\Home\\Index.cshtml")); } } }
public ActionResult guardarPersona(MPersona per) { if (!ModelState.IsValid) { return(View("~\\Views\\Register\\IngresoPersona.cshtml", per)); } per.CodDireccion = ConPG.codDireccion(); ConPG.ingresarPersona(per); return(View("~\\Views\\Principal\\Principal.cshtml")); }
//Ingresar persona public static void ingresarPersona(MPersona per) { using (myticketEntities myticket = new myticketEntities()) { var mtPer = new mt_tab_persona { persona_cod_persona = per.CodPersona, persona_dsc_apmaterno = per.AppMaterno, persona_dsc_appaterno = per.AppPaterno, persona_dsc_nombre = per.nombre, persona_fec_nacimiento = per.Fnac, persona_num_celular = per.Celular, persona_num_fono = per.Fono, persona_num_rut = per.Rut, persona_num_dv = per.DV, direccion_cod_direccion = per.CodDireccion, persona_dsc_mail = per.Mail }; myticket.mt_tab_persona.Add(mtPer); myticket.SaveChanges(); } }
public ActionResult IngresoPersona() { var Mper = new MPersona(); return(View("~\\Views\\Register\\IngresoPersona.cshtml", Mper)); }
// GET: Principal public ActionResult Principal() { var pers = new MPersona(); return(View(pers)); }