예제 #1
0
 public static Database_Controller GetSelf()
 {
     if (self == null)
     {
         self = new Database_Controller();
     }
     return(self);
 }
예제 #2
0
        // Variables

        public static Account_Type GetAccountTypeById(int id)
        {
            // Parameters
            List <MySqlParameter> parameters = new List <MySqlParameter>();

            parameters.Add(new MySqlParameter("idAccount_Type", id));

            List <Account_Type> result = Database_Controller.GetSelf().ExecuteReader_Account_Type(SELECT_ACCOUNT_TYPE_BY_ID, parameters);

            if (result.Count() == 1)
            {
                return(result[0]);
            }
            return(null);
        }
예제 #3
0
        public static Account GetAccountById(int id)
        {
            // Parameters
            List <MySqlParameter> parameters = new List <MySqlParameter>();

            parameters.Add(new MySqlParameter("idAccount", id));

            List <Account> accounts = Database_Controller.GetSelf().ExecuteReader_Account(SELECT_ACCOUNT_BY_ID, parameters);

            if (accounts.Count() == 1)
            {
                return(accounts[0]);
            }
            return(null);
        }