Ejemplo n.º 1
0
        public ListLogic()
        {
            string temp = ConfigurationManager.AppSettings["TypeDal"];

            switch (temp)
            {
            case "Files":
            {
                DAL = new _LittlePony_ListOfUsers.DAL.Collection.DAL();
            }
            break;
            }
        }
Ejemplo n.º 2
0
        public RelationsBLL()
        {
            string temp;

            try
            {
                temp = ConfigurationManager.AppSettings["TypeDal"];
            }
            catch (FileNotFoundException ex)
            {
                throw new ConfigurationFileException("Some problem whith file", ex);
            }
            switch (temp)
            {
            case "Files":
            {
                try
                {
                    DALAward = new _LittlePony_DAL.AwardDAL();
                    DALUsers = new _LittlePony_DAL.UserDAL();
                    DAL      = new _LittlePony_DAL.RelationsDAL();
                }
                catch (DirectoryNotFoundException e)
                {
                    throw new ConfigurationFileException("Problem whith the file path ", e);
                }
            }
            break;

            case "DB":
            {
                try
                {
                    DALAward = new _LittlePony_DAL.DB.AwardDAL();
                    DALUsers = new _LittlePony_DAL.DB.UsersDAL();
                    DAL      = new _LittlePony_DAL.DB.RelationsDAL();
                }
                catch (DirectoryNotFoundException e)
                {
                    throw new ConfigurationFileException("Problem whith the data base ", e);
                }
            }
            break;
            }
        }