Esempio n. 1
0
        public List<Parameter> GetParametersForStoredProcedure(string storedProcedureName)
        {
            List<Parameter> parameters = null;
            using (IDBManager dbManager = new DBManager(DataProvider.SqlServer))
            {
                try
                {
                    dbManager.Open();
                    dbManager.CreateParameters(1);
                    dbManager.AddParameters(0, "@SPName", storedProcedureName);
                    IDataReader reader = dbManager.ExecuteReader(System.Data.CommandType.StoredProcedure, "storeProcedure_getParameters");

                    while (reader.Read())
                    {
                        if (parameters == null)
                            parameters = new List<Parameter>();
                        parameters.Add(new Parameter(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), !Convert.IsDBNull(reader[3]) ? reader.GetInt32(3) : -1));
                    }
                    //dbManager.Close();
                }
                catch (System.Data.SqlClient.SqlException ex)
                {
                    throw new DLException("Could not load parameters for stored procedure: " + storedProcedureName, ex);
                }
            }
            return parameters;
        }
Esempio n. 2
0
 public ProtocolModel GetProtocol()
 {
     IDBManager manager = new DBManager();
     return manager.GetProtocol();
 }
Esempio n. 3
0
 public MyDataAccess(string ConnName)
 {
     dbManager = new DBManager(ConnName);
 }
Esempio n. 4
0
 public IEnumerable<EstateModel> GetEstates()
 {
     IDBManager manager = new DBManager();
     return manager.GetEstates();
 }
Esempio n. 5
0
 internal IEnumerable<TreeInventoryModel> GetTreeInventoryByEstateName(int name)
 {
     IDBManager manager = new DBManager();
     return manager.GetTreeInventoryByEstateName(name);
 }
Esempio n. 6
0
 public HttpStatusCode SaveInventory(TreeInventoryModel inventory)
 {
     IDBManager manager = new DBManager();
     return manager.SaveInventory(inventory);
 }