コード例 #1
0
        /// <summary>
        /// Obtener Lista de cuentas asociadas a un usuario.
        /// </summary>
        /// <param name="Id"></param>
        /// <returns>Lista de cuentas</returns>
        public List <clsEntityAccount> dgvEmpresasUsuario(string Id)
        {
            List <clsEntityAccount> tabla_contenidos;

            try
            {
                tabla_contenidos = new List <clsEntityAccount>();
                SQLiteDataReader datos = null;
                string           sql   = "SELECT * FROM cs_Account WHERE cp3 ='" + Id.ToString().Trim() + "';";
                SQLiteConnection cs_pxConexion_basedatos = new SQLiteConnection(clsBaseConexionSistema.conexionstring);
                cs_pxConexion_basedatos.Open();
                datos = new SQLiteCommand(sql, cs_pxConexion_basedatos).ExecuteReader();
                clsEntityAccount fila;
                while (datos.Read())
                {
                    fila = new clsEntityAccount();
                    fila.Cs_pr_Account_Id   = datos[0].ToString();
                    fila.Cs_pr_Declarant_Id = datos[1].ToString();
                    fila.Cs_pr_Users_Id     = datos[2].ToString();
                    tabla_contenidos.Add(fila);
                }
                cs_pxConexion_basedatos.Close();
                return(tabla_contenidos);
            }
            catch (Exception ex)
            {
                clsBaseMensaje.cs_pxMsgEr("ERR6", ex.ToString());
                clsBaseLog.cs_pxRegistarAdd("clsEntityAccount dgvEmpresasUsuario " + ex.ToString());
                return(null);
            }
        }
コード例 #2
0
        public void cs_pxInsertarACuenta(bool obtener_mensaje_respuesta)
        {
            cs_pxActualizarEntidad();
            new clsBaseConexionSistema().cs_pxInsertar(cs_cmTabla, cs_cmCampos, cs_cmValores, obtener_mensaje_respuesta);

            clsEntityAccount account = new clsEntityAccount
            {
                Cs_pr_Account_Id   = Guid.NewGuid().ToString(),
                Cs_pr_Declarant_Id = Cs_pr_Declarant_Id,
                Cs_pr_Users_Id     = "01"
            };

            account.cs_pxInsertar(false);

            clsEntityDatabaseLocal bdlocal = new clsEntityDatabaseLocal
            {
                Cs_pr_DatabaseLocal_Id = Guid.NewGuid().ToString(),
                Cs_pr_DBMS             = "Microsoft SQL Server",
                Cs_pr_DBMSDriver       = "SQL Server",
                Cs_pr_DBMSServername   = "SERVERNAME_REGISTERS",
                Cs_pr_DBMSServerport   = "1433",
                Cs_pr_DBName           = "cs_bdfei",
                Cs_pr_DBPassword       = "******",
                Cs_pr_DBUse            = "T",
                Cs_pr_DBUser           = "******",
                Cs_pr_Declarant_Id     = Cs_pr_Declarant_Id
            };

            bdlocal.cs_pxInsertar(false);

            clsEntityDatabaseWeb bdweb = new clsEntityDatabaseWeb
            {
                Cs_pr_DatabaseWeb_Id = Guid.NewGuid().ToString(),
                Cs_pr_DBMS           = "Microsoft SQL Server",
                Cs_pr_DBMSDriver     = "SQL Server",
                Cs_pr_DBMSServername = "SERVERNAME_WEBPUBLICATION",
                Cs_pr_DBMSServerport = "1433",
                Cs_pr_DBName         = "cs_bdfei_web",
                Cs_pr_DBPassword     = "******",
                Cs_pr_DBUse          = "T",
                Cs_pr_DBUser         = "******",
                Cs_pr_Declarant_Id   = Cs_pr_Declarant_Id
            };

            bdweb.cs_pxInsertar(false);

            clsEntityAlarms alarms = new clsEntityAlarms
            {
                Cs_pr_Alarms_Id                             = Guid.NewGuid().ToString(),
                Cs_pr_Declarant_Id                          = Cs_pr_Declarant_Id,
                Cs_pr_Envioautomatico                       = "T",
                Cs_pr_Envioautomatico_hora                  = "T",
                Cs_pr_Envioautomatico_horavalor             = DateTime.Now.ToString(),
                Cs_pr_Envioautomatico_minutos               = "F",
                Cs_pr_Envioautomatico_minutosvalor          = "6",
                Cs_pr_Enviomanual                           = "F",
                Cs_pr_Enviomanual_mostrarglobo              = "F",
                Cs_pr_Enviomanual_mostrarglobo_minutosvalor = "10",
                Cs_pr_Enviomanual_nomostrarglobo            = "T",
                Cs_pr_Iniciarconwindows                     = "F"
            };

            alarms.cs_pxInsertar(false);
        }