Example #1
0
        public ActionResult RazonSocial(string rutempresa)
        {
            System.Xml.XmlDocument xDocumento = new System.Xml.XmlDocument();
            servMEDAtencionProxy.servMEDAtencion obj = new servMEDAtencionProxy.servMEDAtencion();
            var sRespuesta = obj.wsValidaEmpSiso(rutempresa);

            if (sRespuesta != null)
            {
                xDocumento.LoadXml(sRespuesta);

                XMLReader readXML = new XMLReader();
                var data = readXML.ReturnListOfEmpresa(xDocumento);

                if (data[0].GlsError != null)
                {
                    string razonsocial = data[0].GlsError;
                    string[] razonsocial2 = razonsocial.Split(';');

                    if (razonsocial2.Count() > 1)
                    {
                        return Json(new { razonsocial = razonsocial2[1] });
                    }
                    else
                    {
                        return Json(new { razonsocial = razonsocial2[0] });
                    }
                }
            }

            return Json(new { razonsocial = "No existe" });
        }
Example #2
0
        public ActionResult ShowEmpresa(Empresa e)
        {
            if (ModelState.IsValid)
            {

                Session["RutEmpresa"] = e.RutEmpresa;
                Session["NombreEmpresa"] = e.NombreEmpresa;
                Session["RutEmpresa"] = e.RutEmpresa;
                Session["RepCargo"] = e.RepCargo;
                Session["RepEmail"] = e.RepEmail;
                Session["RepNombre"] = e.RepNombre;
                Session["RepRut"] = e.RepRut;
                Session["RepTelefono"] = e.RepTelefono;

                if (TempData["Correo"] != null)
                {
                    TempData.Remove("Correo");
                }

                TempData.Add("Correo", e.RepEmail);

                servMEDAtencionProxy.servMEDAtencion obj = new servMEDAtencionProxy.servMEDAtencion();
                var sRespuesta = obj.wsValidaEmpSiso(e.RutEmpresa);

                System.Xml.XmlDocument xDocumento = new System.Xml.XmlDocument();

                if (sRespuesta != null)
                {

                    xDocumento.LoadXml(sRespuesta);

                    XMLReader readXML = new XMLReader();
                    var data = readXML.ReturnListOfEmpresa(xDocumento);

                    if (data[0].Codigo == 1)
                    {
                        return RedirectToAction("Index", "Encuesta");
                    }

                }
            }
            return View();
        }