public ActionResult ConstanciasRetencionAnualPeriodo()
        {
            if ((sesion = SessionDB.start(Request, Response, false, db)) == null)
            {
                return(Content("-1"));
            }

            try
            {
                Main view = new Main();
                ViewBag.MainUser = this.CreateMenuInfoUser(sesion);
                Scripts.SCRIPTS  = new string[]
                {
                    "js/Pagos/EstadodeCuentaWeb/ECW_RetencionesAnualesPeriodo.js"
                };

                ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion);

                EstadodeCuentaWebModel model = new EstadodeCuentaWebModel();
                this.setDatosProfesor(sesion, model);

                // Datos persona
                model.GetDatos();
                ViewBag.Profesor = model.Profesor;
                ViewBag.SEDES    = view.createSelectSedesWeb("Sedes", sesion, model.ID_PERSONA);

                sesion.vdata["CVE_TIPOFACTURA"] = model.CveTipoFactura;
                sesion.saveSession();

                ViewBag.ConstanciasRetencionAnualPeriodo = model.ConstanciasRetencionAnualPeriodo(Request);

                Log.write(this, "Start", LOG.CONSULTA, "Ingresa Pantalla Estado de cuenta Web", sesion);
            }
            catch (Exception e)
            {
                ViewBag.Notification = Notification.Error(e.Message);
                Log.write(this, "Start", LOG.ERROR, "Ingresa Pantalla Estado de cuenta Web" + e.Message, sesion);  //MODIFICAR LA REFERENCIA DE LA PAGINA A INGRESAR
            }
            return(View(Factory.View.Access + "Pagos/EstadodeCuentaWeb/ConstanciasRetencionAnualPeriodo.cshtml"));
        }
        public ActionResult Start()
        {
            try
            {
                string Token = this.Request.QueryString["token"];
                string json  = Decode(Token);

                var    dict   = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(json);
                string IDSIU  = dict["IDSIU"].ToString();
                string CAMPUS = dict["CAMPUS"].ToString();
                // string[] result = dict.Select(kv => kv.Value.ToString()).ToArray();
                EstadodeCuentaWebModel model = new EstadodeCuentaWebModel();

                if ((sesion = SessionDB.start(Request, Response, false, db)) == null)
                {
                    return(Content("-1"));
                }

                sesion.vdata["IDSIU"]      = IDSIU;
                sesion.vdata["Sede"]       = CAMPUS;
                sesion.vdata["ID_PERSONA"] = model.GetIdPersona(sesion.vdata["IDSIU"], sesion.vdata["Sede"]).ToString();
                sesion.saveSession();

                //Intercom
                ViewBag.User     = sesion.nickName.ToString();
                ViewBag.Email    = sesion.nickName.ToString();
                ViewBag.FechaReg = DateTime.Today;

                Response.Redirect("/EstadodeCuentaWeb/Home");

                return(Content(""));                //View(Factory.View.Access + "Pagos/EstadodeCuentaWeb/Home.cshtml");
            }
            catch (Exception)
            {
                //return View(Factory.View.Access + "Pagos/EstadodeCuentaWeb/Start.cshtml");
                return(RedirectToAction("Home", "EstadodeCuentaWeb"));
            }
        }
        public ActionResult _Contratos(EstadodeCuentaWebModel model)
        {
            if ((sesion = SessionDB.start(Request, Response, false, db, SESSION_BEHAVIOR.AJAX)) == null)
            {
                return(Content("-1"));
            }

            sesion.vdata["Sede"] = Request.Params["filter_Sede"];
            this.setDatosProfesor(sesion, model);
            //model.Sede = sesion.vdata["Sede"];
            //ViewBag.IDSIU = model.IDSIU;

            sesion.vdata["Sede"]       = model.Sede;
            sesion.vdata["ID_PERSONA"] = model.ID_PERSONA;
            ViewBag.IDSIU = model.IDSIU;

            sesion.saveSession();

            return(Json(new
            {
                Contratos = model.GetContratos(Request),
            }));
        }
        public ActionResult Perfil2_(EstadodeCuentaWebModel model)
        {
            if ((sesion = SessionDB.start(Request, Response, false, db, SESSION_BEHAVIOR.AJAX)) == null)
            {
                return(Content("-1"));
            }

            this.setDatosProfesor(sesion, model);

            sesion.vdata["Sede"] = Request.Params["filter_Sede"];
            model.Sede           = sesion.vdata["Sede"];

            model.GetDatos();
            model.GetDatosFiscales();

            sesion.vdata["CVE_TIPOFACTURA"] = model.CveTipoFactura;
            sesion.saveSession();

            return(Json(new
            {
                Profesor = model.Profesor,
                NoCuenta = model.NoCuenta,
                Banco = model.Banco,
                RFC = model.RFC,
                Direccion = model.Direccion,
                Fis_Sede = model.Sede,
                Fis_RecibiDe = model.Fis_Recibide,
                Fis_RFC = model.Fis_RFC,
                Fis_Domicilio = model.Fis_Domicilio,
                Fis_Concepto = model.Fis_Concepto,
                IDSIU = model.IDSIU,
                pensiones = model.GetPensiones(),
                CuentaClabe = model.CuentaClabe,
                Email_Sociedad = model.Email_Sociedad,
            }));
        }
        public bool validarMySuite(string XML, out string msg, EstadodeCuentaWebModel model)
        {
            msg = "";
            using (var client = new MySuiteService.FactWSFrontSoapClient("FactWSFrontSoap"))
            {
                /*string requestor = "0cd45d8a-8b89-46f3-8b59-a3afd8fc3de2";
                 *              string transaction = "VALIDATE_DOCUMENT_EX";
                 *              string country = "MX";
                 *              string entity = "UAS8705319I3";
                 *              string user = "******";
                 *              string username = "******";*/

                string requestor   = "";
                string transaction = "";
                string country     = "";
                string entity      = "";
                string user        = "";
                string username    = "";

                string data1 = XML; // ****************************************************
                //  string data1 = "";
                string data2       = "";
                string data3       = "";
                string mensaje     = "";
                string nombrefile1 = "";
                string nombrefile2 = "";
                string success     = "";
                string archivo     = "";
                string uuid        = "";


                string    sql = "SELECT * FROM MYSUITE";
                ResultSet res = db.getTable(sql);
                if (res.Next())
                {
                    requestor   = res.Get("MYSUITE_REQUESTOR");
                    transaction = res.Get("MYSUTE_TRANSACTION");
                    country     = res.Get("MYSUITE_COUNTRY");
                    entity      = res.Get("MYSUITE_ENTITY");
                    user        = res.Get("MYSUITE_USER");
                    username    = res.Get("MYSUITE_USERNAME");


                    //   string data1 = XML;

                    data2       = res.Get("MYSUITE_DATA2");
                    data3       = res.Get("MYSUITE_DATA3");
                    mensaje     = res.Get("MYSUITE_MENSAJE");
                    nombrefile1 = res.Get("MYSUITE_NOMBRE_FIEL1");
                    nombrefile2 = res.Get("MYSUITE_NOMBRE_FIEL2");
                    success     = res.Get("MYSUITE_SUCCESS");
                    archivo     = res.Get("MYSUITE_ARCHIVO");
                    uuid        = res.Get("MYSUITE_UUID");
                }



                // string data1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <cfdi:Comprobante xmlns:cfdi=\"http://www.sat.gob.mx/cfd/3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv32.xsd\" version=\"3.2\" serie=\"A\" folio=\"22\" fecha=\"2016-11-15T12:54:55\" sello=\"Dkj9WUo40KbVlH/XDsSfO0gMRZkn0CfNF7LlDOj54Qm15SSUablrMARhfNd8oMT8sV+QtIEKIdwzYGs3qtwdsvXKygqjAlVp+dtmkdfZdHRmDPFewMWCCslvx8pZi417WdJtKhznL+APVyk0E3iDQLw7b4waCf6eqZ3be3bGx+0=\" formaDePago=\"PAGO EN UNA SOLA EXHIBICION\" noCertificado=\"00001000000303464201\" certificado=\"MIIEZjCCA06gAwIBAgIUMDAwMDEwMDAwMDAzMDM0NjQyMDEwDQYJKoZIhvcNAQEFBQAwggGKMTgwNgYDVQQDDC9BLkMuIGRlbCBTZXJ2aWNpbyBkZSBBZG1pbmlzdHJhY2nDs24gVHJpYnV0YXJpYTEvMC0GA1UECgwmU2VydmljaW8gZGUgQWRtaW5pc3RyYWNpw7NuIFRyaWJ1dGFyaWExODA2BgNVBAsML0FkbWluaXN0cmFjacOzbiBkZSBTZWd1cmlkYWQgZGUgbGEgSW5mb3JtYWNpw7NuMR8wHQYJKoZIhvcNAQkBFhBhY29kc0BzYXQuZ29iLm14MSYwJAYDVQQJDB1Bdi4gSGlkYWxnbyA3NywgQ29sLiBHdWVycmVybzEOMAwGA1UEEQwFMDYzMDAxCzAJBgNVBAYTAk1YMRkwFwYDVQQIDBBEaXN0cml0byBGZWRlcmFsMRQwEgYDVQQHDAtDdWF1aHTDqW1vYzEVMBMGA1UELRMMU0FUOTcwNzAxTk4zMTUwMwYJKoZIhvcNAQkCDCZSZXNwb25zYWJsZTogQ2xhdWRpYSBDb3ZhcnJ1YmlhcyBPY2hvYTAeFw0xNDAzMjUxODA3MTdaFw0xODAzMjUxODA3MTdaMIGyMSIwIAYDVQQDExlKT1NFIERFIEpFU1VTIEFCQUQgTU9SRU5PMSIwIAYDVQQpExlKT1NFIERFIEpFU1VTIEFCQUQgTU9SRU5PMSIwIAYDVQQKExlKT1NFIERFIEpFU1VTIEFCQUQgTU9SRU5PMRYwFAYDVQQtEw1BQU1KNTMxMjI0VVo3MRswGQYDVQQFExJBQU1KNTMxMjI0SERGQlJTMDMxDzANBgNVBAsTBk1BVFJJWjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwRNQOYtE5k+u8hYdaRo3OtsTSnyUzLRLAuaXGO7H+cq39kui+ppB16IUQG40Lyuves78ZB86V+Yafm50yX4Red/ZYrLDVNXWL640SHHqA+rE1v8uJJT8SXbX9+eA8T3/Ky0JTODJqcT3EJoI0KzPvsATBj5+2+pBp+17J8cv7qMCAwEAAaMdMBswDAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCBsAwDQYJKoZIhvcNAQEFBQADggEBABf35T1hhj9ENayN4yHVs71sI4BD18Gu831+wv+fjeu+Avqbuq79zCBwJCteIA1NYw6ebFIAv/ot0HVYpg+pdBWdYPdANlxxyRnh1qXbCyfJB/I7K/QW8pSyGu6FsFkgw3klxQx2bFLpGH8iE7RiIjJNaRfUjFqddzrwuuTli0DLm3ipBx+9WnQU5neA7KpuwuwDtQLH7LFs53RQ8zX/UOh8ql19sKqGinAm8ILHdE3pXZKSA+fVgJQUtWpWO72g2dyqWnwoVSULT05qxyemKROzlaagk3tvRqbmHyOKQxFBYR5JjHjX6OSJVVZhKzWouCZe2TJQCZ887bd1iYJUpcU=\" subTotal=\"19712.50\" TipoCambio=\"1.00\" Moneda=\"Peso Mexicano\" total=\"18792.60\" tipoDeComprobante=\"ingreso\" metodoDePago=\"03\" LugarExpedicion=\"CARRILLO PUERTO 301 DEPTO 6, COLONIA PEDRO MARIA ANAYA, 03340, DELEGACION BENITO JUAREZ, MEXICO, CDMX, MEXICO\" NumCtaPago=\"3181 SANTANDER\">  <cfdi:Emisor rfc=\"AAMJ531224UZ7\" nombre=\"ABAD MORENO JOSE DE JESUS\">        <cfdi:DomicilioFiscal calle=\"CARRILLO PUERTO\" noExterior=\"301\" noInterior=\"DEPTO 6\" colonia=\"COLONIA PEDRO MARIA ANAYA\" localidad=\"MEXICO\" municipio=\"DELEGACION BENITO JUAREZ\" estado=\"CDMX\" pais=\"MEXICO\" codigoPostal=\"03340\"/><cfdi:RegimenFiscal Regimen=\"REGIMEN DE LAS PERSONAS FISICAS CON ACTIVIDADES EMPRESARIALES Y PROFESIONALES\"/></cfdi:Emisor>   <cfdi:Receptor rfc=\"IES870531FU5\" nombre=\"INVESTIGACIONES Y ESTUDIOS SUPERIORES S.C.\">      <cfdi:Domicilio calle=\"AV. UNIVERSIDAD ANAHUAC\" noExterior=\"46\" colonia=\"COL LOMAS ANAHUAC\" municipio=\"HUIXQUILUCAN\" estado=\"ESTADO DE MEXICO\" pais=\"MEXICO\" codigoPostal=\"52786\"/></cfdi:Receptor>   <cfdi:Conceptos>        <cfdi:Concepto cantidad=\"1.00\" unidad=\"No aplica\" noIdentificacion=\"HONORARIOS\" descripcion=\"HONORARIOS PROFESIONALES SERVICIOS ACADEMICOS\" valorUnitario=\"19712.50\" importe=\"19712.50\"/></cfdi:Conceptos><cfdi:Impuestos totalImpuestosRetenidos=\"4073.90\" totalImpuestosTrasladados=\"3154.00\">        <cfdi:Retenciones><cfdi:Retencion impuesto=\"ISR\" importe=\"1971.25\"/><cfdi:Retencion impuesto=\"IVA\" importe=\"2102.65\"/></cfdi:Retenciones><cfdi:Traslados><cfdi:Traslado impuesto=\"IVA\" tasa=\"16.00\" importe=\"3154.00\"/></cfdi:Traslados></cfdi:Impuestos><cfdi:Complemento><tfd:TimbreFiscalDigital xmlns:tfd=\"http://www.sat.gob.mx/TimbreFiscalDigital\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sat.gob.mx/TimbreFiscalDigital http://www.sat.gob.mx/TimbreFiscalDigital/TimbreFiscalDigital.xsd\" selloCFD=\"Dkj9WUo40KbVlH/XDsSfO0gMRZkn0CfNF7LlDOj54Qm15SSUablrMARhfNd8oMT8sV+QtIEKIdwzYGs3qtwdsvXKygqjAlVp+dtmkdfZdHRmDPFewMWCCslvx8pZi417WdJtKhznL+APVyk0E3iDQLw7b4waCf6eqZ3be3bGx+0=\" FechaTimbrado=\"2016-11-15T12:54:57\" UUID=\"7F75B044-A3B8-4BA6-BBD1-8BFB89F95A32\" noCertificadoSAT=\"00001000000202864883\" version=\"1.0\" selloSAT=\"IKTAoalk2XswOOuPbLxq/yJ75EyXBrFtrq64vg4WBcglwUY/62RZV1uvue3N2t0nPBfSDGQuVJ3+SU8YLWul3EGeulPmwQF5+ueYr3Nlw7geQu9fczuSSKtYQYDL+MCRZ4uuYe/l+qWvQxRamnyDIQi7hhZIGwGnoUcd+yg6/TY=\"/></cfdi:Complemento></cfdi:Comprobante>";

                //string data1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <cfdi:Comprobante xmlns:cfdi=\"http://www.sat.gob.mx/cfd/3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv32.xsd\" version=\"3.2\" serie=\"A\" folio=\"22\" fecha=\"2016-11-15T12:54:55\" sello=\"Dkj9WUo40KbVlH/XDsSfO0gMRZkn0CfNF7LlDOj54Qm15SSUablrMARhfNd8oMT8sV+QtIEKIdwzYGs3qtwdsvXKygqjAlVp+dtmkdfZdHRmDPFewMWCCslvx8pZi417WdJtKhznL+APVyk0E3iDQLw7b4waCf6eqZ3be3bGx+0=\" formaDePago=\"PAGO EN UNA SOLA EXHIBICION\" noCertificado=\"00001000000303464201\" certificado=\"MIIEZjCCA06gAwIBAgIUMDAwMDEwMDAwMDAzMDM0NjQyMDEwDQYJKoZIhvcNAQEFBQAwggGKMTgwNgYDVQQDDC9BLkMuIGRlbCBTZXJ2aWNpbyBkZSBBZG1pbmlzdHJhY2nDs24gVHJpYnV0YXJpYTEvMC0GA1UECgwmU2VydmljaW8gZGUgQWRtaW5pc3RyYWNpw7NuIFRyaWJ1dGFyaWExODA2BgNVBAsML0FkbWluaXN0cmFjacOzbiBkZSBTZWd1cmlkYWQgZGUgbGEgSW5mb3JtYWNpw7NuMR8wHQYJKoZIhvcNAQkBFhBhY29kc0BzYXQuZ29iLm14MSYwJAYDVQQJDB1Bdi4gSGlkYWxnbyA3NywgQ29sLiBHdWVycmVybzEOMAwGA1UEEQwFMDYzMDAxCzAJBgNVBAYTAk1YMRkwFwYDVQQIDBBEaXN0cml0byBGZWRlcmFsMRQwEgYDVQQHDAtDdWF1aHTDqW1vYzEVMBMGA1UELRMMU0FUOTcwNzAxTk4zMTUwMwYJKoZIhvcNAQkCDCZSZXNwb25zYWJsZTogQ2xhdWRpYSBDb3ZhcnJ1YmlhcyBPY2hvYTAeFw0xNDAzMjUxODA3MTdaFw0xODAzMjUxODA3MTdaMIGyMSIwIAYDVQQDExlKT1NFIERFIEpFU1VTIEFCQUQgTU9SRU5PMSIwIAYDVQQpExlKT1NFIERFIEpFU1VTIEFCQUQgTU9SRU5PMSIwIAYDVQQKExlKT1NFIERFIEpFU1VTIEFCQUQgTU9SRU5PMRYwFAYDVQQtEw1BQU1KNTMxMjI0VVo3MRswGQYDVQQFExJBQU1KNTMxMjI0SERGQlJTMDMxDzANBgNVBAsTBk1BVFJJWjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwRNQOYtE5k+u8hYdaRo3OtsTSnyUzLRLAuaXGO7H+cq39kui+ppB16IUQG40Lyuves78ZB86V+Yafm50yX4Red/ZYrLDVNXWL640SHHqA+rE1v8uJJT8SXbX9+eA8T3/Ky0JTODJqcT3EJoI0KzPvsATBj5+2+pBp+17J8cv7qMCAwEAAaMdMBswDAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCBsAwDQYJKoZIhvcNAQEFBQADggEBABf35T1hhj9ENayN4yHVs71sI4BD18Gu831+wv+fjeu+Avqbuq79zCBwJCteIA1NYw6ebFIAv/ot0HVYpg+pdBWdYPdANlxxyRnh1qXbCyfJB/I7K/QW8pSyGu6FsFkgw3klxQx2bFLpGH8iE7RiIjJNaRfUjFqddzrwuuTli0DLm3ipBx+9WnQU5neA7KpuwuwDtQLH7LFs53RQ8zX/UOh8ql19sKqGinAm8ILHdE3pXZKSA+fVgJQUtWpWO72g2dyqWnwoVSULT05qxyemKROzlaagk3tvRqbmHyOKQxFBYR5JjHjX6OSJVVZhKzWouCZe2TJQCZ887bd1iYJUpcU=\" subTotal=\"19712.50\" TipoCambio=\"1.00\" Moneda=\"Peso Mexicano\" total=\"18792.60\" tipoDeComprobante=\"ingreso\" metodoDePago=\"03\" LugarExpedicion=\"CARRILLO PUERTO 301 DEPTO 6, COLONIA PEDRO MARIA ANAYA, 03340, DELEGACION BENITO JUAREZ, MEXICO, CDMX, MEXICO\" NumCtaPago=\"3181 SANTANDER\">   <cfdi:Emisor rfc=\"AAMJ531224UZ7\" nombre=\"ABAD MORENO JOSE DE JESUS\">        <cfdi:DomicilioFiscal calle=\"CARRILLO PUERTO\" noExterior=\"301\" noInterior=\"DEPTO 6\" colonia=\"COLONIA PEDRO MARIA ANAYA\" localidad=\"MEXICO\" municipio=\"DELEGACION BENITO JUAREZ\" estado=\"CDMX\" pais=\"MEXICO\" codigoPostal=\"03340\"/><cfdi:RegimenFiscal Regimen=\"REGIMEN DE LAS PERSONAS FISICAS CON ACTIVIDADES EMPRESARIALES Y PROFESIONALES\"/></cfdi:Emisor>   <cfdi:Receptor rfc=\"IES8705des31FU5\" nombre=\"INVESTIGACIONES Y ESTUDIOS SUPERIORES S.C.\">       <cfdi:Domicilio calle=\"AV. UNIVERSIDAD ANAHUAC\" noExterior=\"46\" colonia=\"COL LOMAS ANAHUAC\" municipio=\"HUIXQUILUCAN\" estado=\"ESTADO DE MEXICO\" pais=\"MEXICO\" codigoPostal=\"52786\"/></cfdi:Receptor>   <cfdi:Conceptos>        <cfdi:Concepto cantidad=\"1.00\" unidad=\"No aplica\" noIdentificacion=\"HONORARIOS\" descripcion=\"HONORARIOS PROFESIONALES SERVICIOS ACADEMICOS\" valorUnitario=\"19712.50\" importe=\"19712.50\"/></cfdi:Conceptos><cfdi:Impuestos totalImpuestosRetenidos=\"4073.90\" totalImpuestosTrasladados=\"3154.00\">        <cfdi:Retenciones><cfdi:Retencion impuesto=\"ISR\" importe=\"1971.25\"/><cfdi:Retencion impuesto=\"IVA\" importe=\"2102.65\"/></cfdi:Retenciones><cfdi:Traslados><cfdi:Traslado impuesto=\"IVA\" tasa=\"16.00\" importe=\"3154.00\"/></cfdi:Traslados></cfdi:Impuestos><cfdi:Complemento><tfd:TimbreFiscalDigital xmlns:tfd=\"http://www.sat.gob.mx/TimbreFiscalDigital\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sat.gob.mx/TimbreFiscalDigital http://www.sat.gob.mx/TimbreFiscalDigital/TimbreFiscalDigital.xsd\" selloCFD=\"Dkj9WUo40KbVlH/XDsSfO0gMRZkn0CfNF7LlDOj54Qm15SSUablrMARhfNd8oMT8sV+QtIEKIdwzYGs3qtwdsvXKygqjAlVp+dtmkdfZdHRmDPFewMWCCslvx8pZi417WdJtKhznL+APVyk0E3iDQLw7b4waCf6eqZ3be3bGx+0=\" FechaTimbrado=\"2016-11-15T12:54:57\" UUID=\"7F75B044-A3B8-4BA6-BBD1-8BFB89F95A32\" noCertificadoSAT=\"00001000000202864883\" version=\"1.0\" selloSAT=\"IKTAoalk2XswOOuPbLxq/yJ75EyXBrFtrq64vg4WBcglwUY/62RZV1uvue3N2t0nPBfSDGQuVJ3+SU8YLWul3EGeulPmwQF5+ueYr3Nlw7geQu9fczuSSKtYQYDL+MCRZ4uuYe/l+qWvQxRamnyDIQi7hhZIGwGnoUcd+yg6/TY=\"/></cfdi:Complemento></cfdi:Comprobante>";


                var result = client.RequestTransaction(requestor, transaction, country, entity, user, username, data1, data2, data3);

                if (result.ResponseData.ResponseData1 == "1" &&
                    result.ResponseData.ResponseData2 == "0")
                {
                    return(true);
                }
                else
                {
                    string observaciones = "no está previsto en el esquema";
                    if (result.ResponseData.ResponseData3.Contains(observaciones))
                    {
                        return(true);
                    }
                    else
                    {
                        msg = result.ResponseData.ResponseData3;

                        try
                        {
                            model.savelOG(msg, 3);
                        }
                        catch (Exception) { }
                    }

                    /* msg = result.ResponseData.ResponseData3;
                     *
                     * try
                     * {
                     *   model.savelOG(msg, 3);
                     * }
                     * catch (Exception) { }*/
                }
            }



            return(false);
        }
        public ActionResult processXML(EstadodeCuentaWebModel model)
        {
            if ((sesion = SessionDB.start(Request, Response, false, db, SESSION_BEHAVIOR.AJAX)) == null)
            {
                return(Content("-1"));
            }


            model.IDSIU  = sesion.vdata["IDSIU"];
            model.Sede   = sesion.vdata.ContainsKey("Sede") ? model.Sede = sesion.vdata["Sede"] : "";
            model.sesion = sesion;

            List <string> errores     = new List <string>();
            List <string> errores_stx = new List <string>();
            string        str_xml     = "";

            string msg = "";

            if (model.FileNameXML != null)
            {
                XmlDocument xmldoc = new XmlDocument();
                str_xml = Load(model.FileNameXML);

                xmldoc.LoadXml(str_xml.ToLower());
                XmlNode        node;
                List <XmlNode> listNodes;

                //node = xmldoc.DocumentElement.SelectSingleNode("/cfdi_Comprobante");
                node = SelectFirstNode(xmldoc, "/cfdi:comprobante");
                if (node == null)
                {
                    node = SelectFirstNode(xmldoc, "/comprobante");
                }

                FormatoXML XML = new FormatoXML(model);

                if (node == null)
                {
                    //  return Content(msg);

                    msg = "xml no cumple con las especificaciones como la etiqueta Comprobante";
                    errores_stx.Add(msg);

                    // return Content(Notification.Error2(msg));
                }
                else
                {
                    XML.Fecha = node.Attributes["fecha"]?.InnerText;
                }


                //XML.Total = node.Attributes["total"]?.InnerText;

                node = SelectFirstNode(xmldoc, "/cfdi:comprobante/cfdi:emisor");
                if (node == null)
                {
                    node = SelectFirstNode(xmldoc, "/comprobante/emisor");
                }

                if (node == null)
                {
                    msg = "xml no cumple con las especificaciones como la etiqueta Emisor";
                    errores_stx.Add(msg);

                    //  return Content(Notification.Error2(msg)); ;
                }
                else
                {
                    XML.RFC_Emisor = node.Attributes["rfc"]?.InnerText;
                }


                node = SelectFirstNode(xmldoc, "/cfdi:comprobante/cfdi:receptor");
                if (node == null)
                {
                    node = SelectFirstNode(xmldoc, "/comprobante/receptor");
                }

                if (node == null)
                {
                    msg = "xml no cumple con las especificaciones como la etiqueta Receptor";
                    errores_stx.Add(msg);
                    //  return Content(Notification.Error2(msg));
                }
                else
                {
                    XML.RFC_Receptor = node.Attributes["rfc"]?.InnerText;
                }


                listNodes = SelectListNode(xmldoc, "/cfdi:comprobante/cfdi:impuestos/cfdi:retenciones/cfdi:retencion");
                if (listNodes == null)
                {
                    listNodes = SelectListNode(xmldoc, "/comprobante/impuestos/retenciones/retencion");
                }


                if (listNodes != null)
                {
                    foreach (XmlNode item in listNodes)
                    {
                        string importe = item.Attributes["importe"]?.InnerText;


                        switch (item.Attributes["impuesto"]?.InnerText)
                        {
                        case "IVA": XML.IVA_Ret = importe; break;

                        case "ISR": XML.ISR_Ret = importe; break;
                        }
                    }
                }
                else
                {
                    msg = "xml no tiene Impuestos y/o Retenciones";
                    errores_stx.Add(msg);
                    //  return Content(Notification.Error2(msg));
                }

                //XML.IVA_Ret = node.Attributes["IVA"]?.InnerText;
                //XML.ISR_Ret = node.Attributes["ISR"]?.InnerText;

                listNodes = SelectListNode(xmldoc, "/cfdi:comprobante/cfdi:conceptos/cfdi:concepto");
                if (listNodes == null)
                {
                    listNodes = SelectListNode(xmldoc, "/comprobante/conceptos/concepto");
                }

                if (listNodes != null)
                {
                    if (listNodes.Count > 0)//checar el importe es obligatorio
                    {
                        XML.Importe = listNodes[0].Attributes["importe"]?.InnerText;
                    }
                }
                else
                {
                    msg = "xml no tiene Conceptos";
                    errores_stx.Add(msg);
                    //  return Content(Notification.Error2(msg));
                }



                if (errores_stx.Count == 0)
                {
                    if (model.ValidarXML)
                    {
                        errores = model.validarXML(XML);
                    }
                }
            }
            // Si no hay errores (localmente) ...



            if (errores_stx.Count == 0)
            {
                if (errores.Count == 0)
                {
                    bool correcto = true;
                    //  model.ValidarMySuite = true;
                    if (model.FileNameXML != null && model.ValidarMySuite)
                    {
                        correcto = validarMySuite(str_xml, out msg, model);
                    }

                    //  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    //  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    //  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    //correcto = true;
                    //  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    //  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    //  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

                    if (correcto)
                    {
                        // Se mueven los archivos organizandolos a una carpeta del mes actual.
                        model.FileNameXML = moveFile(model.FileNameXML);
                        model.FileNamePDF = moveFile(model.FileNamePDF);
                        model.saveXMLyPDF();
                        return(Content("0"));
                    }
                }
                else
                {
                    msg = string.Join <string>("<br/>\n", errores);
                }
            }
            else
            {
                try
                {
                    msg = string.Join <string>("<br/>\n", errores_stx);
                    model.savelOG(msg, 1);
                }
                catch (Exception) { }
            }

            //guarda pdf y xml en carperta: Upload/Error_Facturas


            try
            {
                model.FileNameXML = moveFile_Error(model.FileNameXML);
                model.FileNamePDF = moveFile_Error(model.FileNamePDF);
                model.savelOG(msg, 0);
            }catch (Exception) { }


            // return Content(msg);
            return(Content(Notification.Error3(msg)));
        }
        //#EXPORT EXCEL
        public void ExportExcel()
		{
			SessionDB sesion = SessionDB.start(Request, Response, false, db);

            try
            {
                string sede = Request.Params["sedes"];
                string sql = string.Empty;
                /**
                 * Inicio - Primera pestaña
                 * */
                System.Data.DataTable tbl = new System.Data.DataTable();
                tbl.Columns.Add("ID_PERSONA", typeof(string));
                tbl.Columns.Add("ORIGEN", typeof(string));
                tbl.Columns.Add("IDSIU", typeof(string));
                tbl.Columns.Add("NOMBRES", typeof(string));
                tbl.Columns.Add("APELLIDOS", typeof(string));
                tbl.Columns.Add("CORREO", typeof(string));
                tbl.Columns.Add("TIPODEPAGO", typeof(string));
                tbl.Columns.Add("RFC", typeof(string));
                tbl.Columns.Add("CURP", typeof(string));
                tbl.Columns.Add("CVE_BANCO", typeof(string));
                tbl.Columns.Add("CUENTACLABE", typeof(string));
                tbl.Columns.Add("RAZONSOCIAL", typeof(string));
                tbl.Columns.Add("DIRECCION_PAIS", typeof(string));
                tbl.Columns.Add("DIRECCION_ESTADO", typeof(string));
                tbl.Columns.Add("DIRECCION_CIUDAD", typeof(string));
                tbl.Columns.Add("DIRECCION_ENTIDAD", typeof(string));
                tbl.Columns.Add("DIRECCION_COLONIA", typeof(string));
                tbl.Columns.Add("DIRECCION_CALLE", typeof(string));
                tbl.Columns.Add("DIRECCION_NUMERO", typeof(string));
                tbl.Columns.Add("DIRECCION_CP", typeof(string));

                sql = "SELECT * FROM QPersonas WHERE CVE_SEDE = '" + sede + "'";

                ResultSet res = db.getTable(sql);

                while (res.Next()) // Here we add five DataRows.
                    tbl.Rows.Add(
                        res.Get("ID_PERSONA"),
                        res.Get("ORIGEN"),
                        res.Get("IDSIU"),
                        res.Get("NOMBRES"),
                        res.Get("APELLIDOS"),
                        res.Get("CORREO"),
                        res.Get("TIPODEPAGO"),
                        res.Get("RFC"),
                        res.Get("CURP"),
                        res.Get("CVE_BANCO"),
                        res.Get("CUENTACLABE"),
                        res.Get("RAZONSOCIAL"),
                        res.Get("DIRECCION_PAIS"),
                        res.Get("DIRECCION_ESTADO"),
                        res.Get("DIRECCION_CIUDAD"),
                        res.Get("DIRECCION_ENTIDAD"),
                        res.Get("DIRECCION_COLONIA"),
                        res.Get("DIRECCION_CALLE"),
                        res.Get("DIRECCION_NUMERO"),
                        res.Get("DIRECCION_CP")
                    );
                /**
                 * Fin - Primera pestaña
                 * */

                /**
                 * Inicio - Segunda pestaña
                 * */
                System.Data.DataTable tblR = new System.Data.DataTable();
                tblR.Columns.Add("ID_PERSONA", typeof(string));
                tblR.Columns.Add("SEDE", typeof(string));
                tblR.Columns.Add("IDSIU", typeof(string));
                tblR.Columns.Add("NOMBRES", typeof(string));
                tblR.Columns.Add("APELLIDOS", typeof(string));
                tblR.Columns.Add("FECHANACIMIENTO", typeof(string));
                tblR.Columns.Add("NACIONALIDAD", typeof(string));
                tblR.Columns.Add("CORREO365", typeof(string));
                tblR.Columns.Add("TELEFONO", typeof(string));
                tblR.Columns.Add("TIPODEPAGO", typeof(string));
                tblR.Columns.Add("RFC", typeof(string));
                tblR.Columns.Add("CURP", typeof(string));
                tblR.Columns.Add("PAIS", typeof(string));
                tblR.Columns.Add("ESTADO", typeof(string));
                tblR.Columns.Add("CIUDAD", typeof(string));
                tblR.Columns.Add("ENTIDAD", typeof(string));
                tblR.Columns.Add("COLONIA", typeof(string));
                tblR.Columns.Add("CALLE", typeof(string));
                tblR.Columns.Add("NUMERO", typeof(string));
                tblR.Columns.Add("CP", typeof(string));
                tblR.Columns.Add("BANCO", typeof(string));
                tblR.Columns.Add("CUENTACLABE", typeof(string));
                tblR.Columns.Add("NOCUENTA", typeof(string));
                tblR.Columns.Add("VERIFICADO", typeof(string));//
                tblR.Columns.Add("TITULOPROFESIONAL", typeof(string));
                tblR.Columns.Add("PROFESION", typeof(string));
                tblR.Columns.Add("CEDULAPROFESIONAL", typeof(string));
                tblR.Columns.Add("FECHACEDULA", typeof(string));
                tblR.Columns.Add("SEGUROSOCIAL", typeof(string));

                sql = "SELECT * FROM QPersonasReporte WHERE SEDE = '" + sede + "'";

                ResultSet resR = db.getTable(sql);



                EstadodeCuentaWebModel model = new EstadodeCuentaWebModel();

                while (resR.Next()) { // Here we add five DataRows.

                    model.IDSIU = resR.Get("IDSIU");
                    model.ID_PERSONA = resR.Get("ID_PERSONA");
                    model.NoCuenta = resR.Get("NOCUENTA");

                    if (!string.IsNullOrWhiteSpace(model.NoCuenta))                    
                        model.VerificarCuenta();                   
                    else
                        model.validaCuenta_2(); // limpiar validacuenta** y poner en 0


                    string validado = "NO";
                    if (resR.GetBool("NOCUENTA_VALIDADO")) { validado = "SI"; }



                    tblR.Rows.Add(
                        resR.Get("ID_PERSONA"),
                        resR.Get("SEDE"),
                        resR.Get("IDSIU"),
                        resR.Get("NOMBRES"),
                        resR.Get("APELLIDOS"),
                        resR.Get("FECHANACIMIENTO"),
                        resR.Get("NACIONALIDAD"),
                        resR.Get("CORREO365"),
                        resR.Get("TELEFONO"),
                        resR.Get("TIPODEPAGO"),
                        resR.Get("RFC"),
                        resR.Get("CURP"),
                        resR.Get("PAIS"),
                        resR.Get("ESTADO"),
                        resR.Get("CIUDAD"),
                        resR.Get("ENTIDAD"),
                        resR.Get("COLONIA"),
                        resR.Get("CALLE"),
                        resR.Get("NUMERO"),
                        resR.Get("CP"),
                        resR.Get("BANCO"),
                        resR.Get("CUENTACLABE"),
                        resR.Get("NOCUENTA"),
                        validado,
                        resR.Get("TITULOPROFESIONAL"),
                        resR.Get("PROFESION"),
                        resR.Get("CEDULAPROFESIONAL"),
                        resR.Get("FECHACEDULA"),
                        resR.Get("SEGUROSOCIAL")
                        );


            }
                /**
                 * Fin - Segunda pestaña
                 * */

                using (ExcelPackage pck = new ExcelPackage())
				{
					//Create the worksheet
					ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Personas");
                    ExcelWorksheet wsR = pck.Workbook.Worksheets.Add("Reporte de Personas");

                    //Load the datatable into the sheet, starting from cell A1. Print the column names on row 1
                    ws.Cells["A1"].LoadFromDataTable(tbl, true);
					ws.Cells["A1:C1"].AutoFitColumns();

                    wsR.Cells["A1"].LoadFromDataTable(tblR, true);
                    wsR.Cells["A1:AB1"].AutoFitColumns();

                    //Format the header for column 1-3
                    using (ExcelRange rng = ws.Cells["A1:U1"])
					{
						rng.Style.Font.Bold = true;
						rng.Style.Fill.PatternType = ExcelFillStyle.Solid;                      //Set Pattern for the background to Solid
						rng.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(79, 129, 189));  //Set color to dark blue
						rng.Style.Font.Color.SetColor(Color.White);
                    }

                    using (ExcelRange rngR = wsR.Cells["A1:AB1"])
                    {
                        rngR.Style.Font.Bold = true;
                        rngR.Style.Fill.PatternType = ExcelFillStyle.Solid;                      //Set Pattern for the background to Solid
                        rngR.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(79, 129, 189));  //Set color to dark blue
                        rngR.Style.Font.Color.SetColor(Color.White);
                    }

                    int rowexcel = 2;
                    //FORMAT RFC EXCEL
                    res.ReStart();

                    while (res.Next())
                    {
                        if (!rfcValido(res.Get("RFC")))
                        {
                            ws.Cells["H" + rowexcel].Style.Font.Bold = true;
                            ws.Cells["H" + rowexcel].Style.Fill.PatternType = ExcelFillStyle.Solid;
                            ws.Cells["H" + rowexcel].Style.Fill.BackgroundColor.SetColor(Color.FromArgb(153, 0, 0));
                            ws.Cells["H" + rowexcel].Style.Font.Color.SetColor(Color.White);
                        }

                        rowexcel++;
                    }

                    int rowexcelR = 2;
                    //FORMAT RFC EXCEL
                    resR.ReStart();

                    while (resR.Next())
                    {
                        if (!rfcValido(resR.Get("RFC")))
                        {
                            wsR.Cells["K" + rowexcelR].Style.Font.Bold = true;
                            wsR.Cells["K" + rowexcelR].Style.Fill.PatternType = ExcelFillStyle.Solid;
                            wsR.Cells["K" + rowexcelR].Style.Fill.BackgroundColor.SetColor(Color.FromArgb(153, 0, 0));
                            wsR.Cells["K" + rowexcelR].Style.Font.Color.SetColor(Color.White);
                        }

                        rowexcelR++;
                    }

                    //Example how to Format Column 1 as numeric 
                    using (ExcelRange col = ws.Cells[2, 1, 2 + tbl.Rows.Count, 1])
					{
						col.Style.Numberformat.Format = "#,##0.00";
						col.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
					}

                    using (ExcelRange colR = wsR.Cells[2, 1, 2 + tblR.Rows.Count, 1])
                    {
                        colR.Style.Numberformat.Format = "#,##0.00";
                        colR.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
                    }
                    //Write it back to the client
                    Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
					Response.AddHeader("content-disposition", "attachment;  filename=Personas.xlsx");
					Response.BinaryWrite(pck.GetAsByteArray());
				}
				Log.write(this, "Start", LOG.CONSULTA, "Exporta Excel Catalogo DatosPersonas", sesion);
			}
			catch (Exception e)
			{
				ViewBag.Notification = Notification.Error(e.Message);
				Log.write(this, "Start", LOG.ERROR, "Exporta Excel  DatosPersonas" + e.Message, sesion);
			}
		}
        public ActionResult DetallePagoDepositado()
        {
            if ((sesion = SessionDB.start(Request, Response, false, db)) == null)
            {
                return(Content("-1"));
            }

            try
            {
                Main view = new Main();
                ViewBag.MainUser = this.CreateMenuInfoUser(sesion);

                Scripts.SCRIPTS = new string[]
                {
                    "plugins/Angular/jquery.ui.widget.js"
                    , "plugins/Angular/jquery.iframe-transport.js"
                    , "plugins/Angular/jquery.fileupload.js"
                    , "js/Pagos/EstadodeCuenta/EstadodeCuenta.js"
                    , "js/Pagos/EstadodeCuentaWeb/ECW_EstadoCuenta.js"
                    , "js/Pagos/EstadodeCuentaWeb/ECW_RetencionesMensuales.js"
                    , "js/Pagos/EstadodeCuentaWeb/ECW_RetencionesAnuales.js"
                    , "js/Pagos/EstadodeCuentaWeb/EstadodeCuentaWeb.js"
                };

                ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion);

                EstadodeCuentaWebModel model = new EstadodeCuentaWebModel();
                model.sesion = sesion;

                this.setDatosProfesor(sesion, model);

                ViewBag.Profesor    = model.Profesor;
                ViewBag.NoCuenta    = model.NoCuenta;
                ViewBag.CuentaClabe = model.CuentaClabe;
                ViewBag.Banco       = model.Banco;
                ViewBag.RFC         = model.RFC;
                ViewBag.Direccion   = model.Direccion;

                // Datos fiscales
                model.GetDatosFiscales();
                ViewBag.Fis_Sede      = model.Sede;
                ViewBag.Fis_RecibiDe  = model.Fis_Recibide;
                ViewBag.Fis_RFC       = model.Fis_RFC;
                ViewBag.Fis_Domicilio = model.Fis_Domicilio;
                ViewBag.Fis_Concepto  = model.Fis_Concepto;


                if (model.Email_Sociedad == "")
                {
                    ViewBag.Email_Sociedad = "*****@*****.**";
                }
                else
                {
                    ViewBag.Email_Sociedad = model.Email_Sociedad;
                }

                ViewBag.SEDES = view.createSelectSedesWeb("Sedes", sesion, model.ID_PERSONA, true);

                ViewBag.IDSIU = model.IDSIU;

                sesion.vdata["CVE_TIPOFACTURA"] = model.CveTipoFactura;
                sesion.saveSession();

                model.ID_ESTADODECUENTA = Convert.ToInt32(Request.QueryString["_idestadocuenta"]);

                ViewBag.ESTADODECUENTA = model.GetEstadodeCuentaDepositados();

                ViewBag.PENSIONES = model.GetPensiones();

                Log.write(this, "Start", LOG.CONSULTA, "Ingresa Pantalla Estado de cuenta Web", sesion);
            }
            catch (Exception e)
            {
                ViewBag.Notification = Notification.Error(e.Message);
                Log.write(this, "Start", LOG.ERROR, "Ingresa Pantalla Detalle Pago Deposito" + e.Message, sesion);  //MODIFICAR LA REFERENCIA DE LA PAGINA A INGRESAR
            }
            return(View(Factory.View.Access + "Pagos/EstadodeCuentaWeb/DetallePagoDeposito.cshtml"));
        }
        public ActionResult Home()
        {
            if ((sesion = SessionDB.start(Request, Response, false, db)) == null)
            {
                return(Content("-1"));
            }
            try
            {
                Main view = new Main();
                EstadodeCuentaWebModel model = new EstadodeCuentaWebModel();

                Scripts.SCRIPTS = new string[]
                {
                    "js/Pagos/EstadodeCuentaWeb/ECW_Contratos.js"
                };

                ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion);

                sesion.vdata["HmeAclzn"] = "No";
                this.setDatosProfesor(sesion, model);

                // Datos persona
                model.GetDatos();
                sesion.vdata["ID_PERSONA"] = model.ID_PERSONA;
                ViewBag.Profesor           = model.Profesor;
                ViewBag.IDSIU       = model.IDSIU;
                ViewBag.NoCuenta    = model.NoCuenta;
                ViewBag.CuentaClabe = model.CuentaClabe;
                ViewBag.Banco       = model.Banco;
                ViewBag.RFC         = model.RFC;

                // Datos fiscales
                model.GetDatosFiscales();
                ViewBag.Fis_Sede      = model.Sede;
                ViewBag.Fis_RecibiDe  = model.Fis_Recibide;
                ViewBag.Fis_RFC       = model.Fis_RFC;
                ViewBag.Fis_Domicilio = model.Fis_Domicilio;
                ViewBag.Fis_Concepto  = model.Fis_Concepto;

                ViewBag.Email_Sociedad = model.Email_Sociedad;

                ViewBag.SEDES = view.createSelectSedesWeb("Sedes", sesion, model.ID_PERSONA);

                sesion.vdata["CVE_TIPOFACTURA"] = model.CveTipoFactura;
                sesion.saveSession();

                //Intercom
                ViewBag.User     = sesion.nickName.ToString();
                ViewBag.Email    = sesion.nickName.ToString();
                ViewBag.FechaReg = DateTime.Today;

                //cuenta
                if (!string.IsNullOrWhiteSpace(model.NoCuenta))
                {
                    if (model.VerificarCuenta())
                    {
                        ViewBag.casilla_valida     = "<input type=\"checkbox\" id=\"valida_check\" checked disabled/>";
                        ViewBag.boton_validacuenta = "<button type = 'button' id = \"btn_valida\" class='btn btn-sm btn-success' onclick=\"validaCuenta();\" disabled>Verificado</button>";
                    }
                    else
                    {
                        ViewBag.casilla_valida     = "<input type=\"checkbox\" id=\"valida_check\"/>";
                        ViewBag.boton_validacuenta = "<button type = 'button' id = \"btn_valida\" class='btn btn-sm btn-success' onclick=\"validaCuenta();\">Verificar</button>";
                    }
                }
                else
                {
                    ViewBag.casilla_valida     = "<input type=\"checkbox\" id=\"valida_check\" disabled/>";
                    ViewBag.boton_validacuenta = "<button type = 'button' id = \"btn_valida\" class='btn btn-sm btn-success' onclick=\"validaCuenta();\" disabled>Verificar</button>";

                    // limpiar validacuenta** y poner en 0
                    model.validaCuenta_2();
                }

                this.getPagosDashboardPagos(model);

                Log.write(this, "Start", LOG.CONSULTA, "Ingresa Pantalla Estado de cuenta Web", sesion);
            }
            catch (Exception e)
            {
                ViewBag.Notification = Notification.Error(e.Message);
                Log.write(this, "Start", LOG.ERROR, "Ingresa Pantalla Estado de cuenta Web" + e.Message, sesion);  //MODIFICAR LA REFERENCIA DE LA PAGINA A INGRESAR
            }
            return(View(Factory.View.Access + "Pagos/EstadodeCuentaWeb/Home.cshtml"));
        }
 public void getPagosPendientes(EstadodeCuentaWebModel model)
 {
     ViewBag.Table_PagosPendientes = model.GetPagosPendientes();
 }
        public ActionResult PagosPendientes(EstadodeCuentaWebModel model)
        {
            if ((sesion = SessionDB.start(Request, Response, false, db)) == null)
            {
                return(Content("-1"));
            }

            try
            {
                Scripts.SCRIPTS = new string[]
                {
                    "js/Pagos/EstadodeCuentaWeb/PagosPendientes.js"
                };

                Main view = new Main();
                ViewBag.MainUser = this.CreateMenuInfoUser(sesion);
                ViewBag.Scripts  = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion);


                this.setDatosProfesor(sesion, model);

                string filter_Sede = Request.Params["filter_Sede"];
                if (filter_Sede != "" && filter_Sede != null)
                {
                    sesion.vdata["Sede"] = Request.Params["filter_Sede"];
                    model.Sede           = sesion.vdata["Sede"];
                }

                ViewBag.Profesor = model.Profesor;


                // Datos fiscales
                //   EstadodeCuentaWebModel model2 = new EstadodeCuentaWebModel();

                model.GetDatosFiscales();
                if (model.Email_Sociedad == "")
                {
                    ViewBag.Email_Sociedad = "*****@*****.**";
                }
                else
                {
                    ViewBag.Email_Sociedad = model.Email_Sociedad;
                }


                /* if (sesion.tipouser == 'U')
                 *  ViewBag.SEDES = view.createSelectSedes("Sedes", sesion);
                 * else  */
                ViewBag.SEDES = view.createSelectSedesWeb("Sedes", sesion, model.ID_PERSONA);
                ViewBag.IDSIU = model.IDSIU;

                sesion.vdata["CVE_TIPOFACTURA"] = model.CveTipoFactura;
                sesion.saveSession();



                //IMPRIME DATATABLE
                if (filter_Sede != "" && filter_Sede != null)
                {
                }
                else
                {
                    this.getPagosPendientes(model);
                }
            }
            catch (Exception e)
            {
                ViewBag.Notification = Notification.Error(e.Message);
                Log.write(this, "Start", LOG.ERROR, "Ingresa Pantalla Estado de cuenta Web" + e.Message, sesion);  //MODIFICAR LA REFERENCIA DE LA PAGINA A INGRESAR
            }
            return(View(Factory.View.Access + "Pagos/EstadodeCuentaWeb/PagosPendientes.cshtml"));
        }
        public ActionResult Home_Actualitation(EstadodeCuentaWebModel model)
        {
            if ((sesion = SessionDB.start(Request, Response, false, db, SESSION_BEHAVIOR.AJAX)) == null)
            {
                return(Content("-1"));
            }

            sesion.vdata["Sede"]     = Request.Params["filter_Sede"];
            sesion.vdata["HmeAclzn"] = "Sí";
            updateSede = true;
            updateSede = true;
            this.setDatosProfesor(sesion, model);
            //model.Sede = sesion.vdata["Sede"];
            //model.ID_PERSONA = sesion.vdata["ID_PERSONA"];

            sesion.vdata["Sede"]       = model.Sede;
            sesion.vdata["ID_PERSONA"] = model.ID_PERSONA;
            ViewBag.IDSIU = model.IDSIU;

            sesion.vdata["ID_PERSONA"] = model.ID_PERSONA;
            ViewBag.Profesor           = model.Profesor;
            ViewBag.IDSIU       = model.IDSIU;
            ViewBag.NoCuenta    = model.NoCuenta;
            ViewBag.CuentaClabe = model.CuentaClabe;
            ViewBag.Banco       = model.Banco;
            ViewBag.RFC         = model.RFC;
            sesion.saveSession();

            //cuenta
            string casilla_valida     = "";
            string boton_validacuenta = "";

            if (!string.IsNullOrWhiteSpace(model.NoCuenta))
            {
                if (model.VerificarCuenta())
                {
                    casilla_valida     = "<input type=\"checkbox\" id=\"valida_check\" checked disabled/>";
                    boton_validacuenta = "<button type = 'button' id = \"btn_valida\" class='btn btn-sm btn-success' onclick=\"validaCuenta();\" disabled>Verificado</button>";
                }
                else
                {
                    casilla_valida     = "<input type=\"checkbox\" id=\"valida_check\"/>";
                    boton_validacuenta = "<button type = 'button' id = \"btn_valida\" class='btn btn-sm btn-success' onclick=\"validaCuenta();\">Verificar</button>";
                }
            }
            else
            {
                casilla_valida     = "<input type=\"checkbox\" id=\"valida_check\" disabled/>";
                boton_validacuenta = "<button type = 'button' id = \"btn_valida\" class='btn btn-sm btn-success' onclick=\"validaCuenta();\" disabled>Verificar</button>";
                // limpiar validacuenta** y poner en 0
                model.validaCuenta_2();
            }

            return(Json(new
            {
                PagosPendientes = model.GetPagosDashboardPendientes(),
                PagosDepositados = model.GetPagosDashboardDepositados(),
                Contratos = model.GetDashboardContratos(),
                PagosxDepositar = model.GetPagosxDepositar(),
                Bloqueos = model.GetBloqueosDashboard(),
                Comunicados = model.GetComunicados(),
                jcasilla_valida = casilla_valida,
                jboton_validacuenta = boton_validacuenta,
                NoCuenta = model.NoCuenta,
                CuentaClabe = model.CuentaClabe,
                Banco = model.Banco,
            }));
        }