Beispiel #1
0
        public AwardLogic()
        {
            string mode;

            try
            {
                mode = ConfigurationManager.AppSettings["DataMode"];
            }

            catch (Exception e)
            {
                Logger.Logger.WriteLog(e);
                throw new Exception("Some problem with configuration file", e);
            }

            try
            {
                switch (mode)
                {
                case "Files":
                {
                    string way = Environment.CurrentDirectory + @"\LogAward.txt";
                    dal = new _EPAM_DALFile.DALFileAward();
                }

                break;

                case "Collection":
                {
                    dal = new _EPAM_DALCollection.DALAward();
                }

                break;

                case "DATABASE":
                {
                    dal       = new _EPAM_DALDATABASE.Award();
                    dal_image = new _EPAM_DALDATABASE.Image();
                }

                break;
                }
            }

            catch (Exception e)
            {
                Logger.Logger.WriteLog(e);
                throw e;
            }
        }
        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;
            }
        }
Beispiel #3
0
 public AwardsBLL()
 {
     _awardDAL = DependenciesDAL.AwardDAL;
 }
Beispiel #4
0
 public AwardLogic(IAwardDAL awardDAL)
 {
     this.awardDAL = awardDAL;
 }
Beispiel #5
0
 public UserManager()
 {
     _userDAL  = UserDALDependencies.UserDAL;
     _awardDAL = UserDALDependencies.AwardDAL;
 }
 public AwardLogic(IAwardDAL awardDAL)
 {
     _awardDAL = awardDAL;
 }
Beispiel #7
0
 public AwardLogic(IAwardDAL awardDao)
 {
     _awardDao = awardDao;
 }