public JsonResult addNatural(EMPRESA_NAT en) { string result = "No se pudieron registrar sus datos, intentelo nuevamente"; int inicio = en.ID_PROFESION.IndexOf("["); int final = en.ID_PROFESION.IndexOf("]"); if (inicio == -1) { return(Json("Por favor seleccion un numero de la lista !!!")); } en.ID_PROFESION = en.ID_PROFESION.Substring((inicio + 1), (final - 1)); if (ModelState.IsValid) { result = en.addPropuesta(System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]); if (result == "OK") { armarEmail(en.NIT); } } return(Json(result)); }
public JsonResult updateNatural(EMPRESA_NAT em) { string result = "No se pudo modicar, intento nuevamente"; int id = 0; if (Session["id"] != null) { id = Convert.ToInt32(Session["id"]); int inicio = em.ID_PROFESION.IndexOf("["); int final = em.ID_PROFESION.IndexOf("]"); if (inicio == -1) { return(Json("Por favor seleccion un numero de la lista !!!")); } em.ID_PROFESION = em.ID_PROFESION.Substring((inicio + 1), (final - 1)); if (ModelState.IsValid) { result = em.updEmpresa(System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"], id); } } return(Json(result)); }
public ActionResult Natural() { EMPRESA_NAT en = new EMPRESA_NAT(); ViewBag.profesiones = PROFESION.getProfesiones(); return(View(en)); }
public ActionResult updNatural() { if (Session["id"] == null) { return(RedirectToAction("Login")); } int id = Convert.ToInt32(Session["id"]); if (EMPRESA.getTipoEmpresa(id) != 0) { return(RedirectToAction("Login")); } EMPRESA_NAT en = EMPRESA_NAT.getEmpresa(id); ViewBag.profesiones = PROFESION.getProfesiones(); return(View(en)); }