Beispiel #1
0
        public bool IsEmailExisted(string email)
        {
            ILoginRepository loginRepository = CSRepositoryFactory.GetLoginRepository();
            CLoginDataDto    loginDto        = loginRepository.FindLoginDataByEmail(email);

            return(loginDto != null);
        }
Beispiel #2
0
        public bool IsUsernameExisted(string username)
        {
            ILoginRepository loginRepository = CSRepositoryFactory.GetLoginRepository();
            CLoginDataDto    loginDto        = loginRepository.FindLoginDataByUsername(username);

            return(loginDto != null);
        }
Beispiel #3
0
        public CPerson GetPersonById(int personId)
        {
            IPersonRepository personRepository = CSRepositoryFactory.GetPersonRepository();
            CPersonDto        personDal        = personRepository.FindItemByKeyFullLoad(personId);

            CDalToBllConverter converter = new CDalToBllConverter();

            return(converter.ConvertPerson(personDal));
        }
Beispiel #4
0
        public CFamily GetFamilyByPersonId(int personId)
        {
            IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository();
            CFamilyDto        familyDto = familyRep.FindByPersonIdFullLoad(personId);

            CDalToBllConverter converter = new CDalToBllConverter();

            return(converter.ConvertFamily(familyDto));
        }
Beispiel #5
0
        public List <CCategoryType> GetCategoryTypes()
        {
            ICategoryRepository        categoryRepository = CSRepositoryFactory.GetCategoryRepository();
            ICollection <CCategoryDto> categories         = categoryRepository.GetAllItems();

            List <CCategoryType> Types = new List <CCategoryType>();

            foreach (CCategoryDto cat in categories)
            {
                Types.Add(new CCategoryType(cat.CategoryID, cat.Title, cat.Description));
            }

            return(Types);
        }
Beispiel #6
0
        public void RegisterPerson(String name, String username, String email, String salt, String passwordHash)
        {
            IPersonRepository personRepository = CSRepositoryFactory.GetPersonRepository();

            CLoginDataDto loginDto = new CLoginDataDto();

            loginDto.Username     = username;
            loginDto.email        = email;
            loginDto.Salt         = salt;
            loginDto.PasswordHash = passwordHash;

            CPersonDto personDto = new CPersonDto();

            personDto.Name      = name;
            personDto.LoginData = loginDto;

            personRepository.AddItem(personDto);
        }
Beispiel #7
0
        public CLoginData FindLoginByUsernameOrEmail(String username)
        {
            ILoginRepository loginRepository = CSRepositoryFactory.GetLoginRepository();

            CLoginDataDto loginDto = loginRepository.FindLoginDataByUsername(username);

            if (loginDto == null)
            {
                loginDto = loginRepository.FindLoginDataByEmail(username);
            }

            if (loginDto == null)
            {
                return(null);
            }

            CDalToBllConverter converter = new CDalToBllConverter();

            return(converter.ConvertLogin(loginDto));
        }
Beispiel #8
0
        public Boolean LeaveFamily(Int32 personId)
        {
            IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository();

            return(familyRep.LeaveFamily(personId));
        }
Beispiel #9
0
        public Boolean JoinFamily(Int32 personId, Int32 familyId)
        {
            IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository();

            return(familyRep.JoinFamily(personId, familyId));
        }
Beispiel #10
0
        public Boolean CreateFamily(Int32 personId, String familyName, Int32 budget)
        {
            IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository();

            return(familyRep.CreateFamily(personId, familyName, budget));
        }
Beispiel #11
0
        public Boolean DeleteSubCategory(Int32 personId, Int32 subCategoryId)
        {
            ISubCategoryRepository subCatRep = CSRepositoryFactory.getSubCategoryRepository();

            return(subCatRep.TryDeleteSubCategory(personId, subCategoryId));
        }
Beispiel #12
0
        public Boolean EditSubCategory(Int32 personId, Int32 subCategoryId, String newCategoryTitle, String newSubCategoryTitle, String newSubCategoryDescription)
        {
            ISubCategoryRepository subCatRep = CSRepositoryFactory.getSubCategoryRepository();

            return(subCatRep.TyrEditSubCategory(personId, subCategoryId, newCategoryTitle, newSubCategoryTitle, newSubCategoryDescription));
        }
Beispiel #13
0
        public Int32 AddSubCategory(Int32 personId, String categoryTitle, String subCategoryTitle, String subCategoryDescription)
        {
            ISubCategoryRepository subCatRep = CSRepositoryFactory.getSubCategoryRepository();

            return(subCatRep.TryAddSubCategory(personId, categoryTitle, subCategoryTitle, subCategoryDescription));
        }
Beispiel #14
0
        public Boolean DeletePayment(Int32 personId, Int32 paymentId)
        {
            IPaymentRepository paymentRep = CSRepositoryFactory.GetPaymentRepository();

            return(paymentRep.DeletePayment(personId, paymentId));
        }
Beispiel #15
0
        public Boolean EditPayment(Int32 personId, Int32 paymentId, DateTime newDate, String newCategoryTitle, String newSubCategoryTitle, Decimal newSum)
        {
            IPaymentRepository paymentRep = CSRepositoryFactory.GetPaymentRepository();

            return(paymentRep.EditPayment(personId, paymentId, newDate, newCategoryTitle, newSubCategoryTitle, newSum));
        }
Beispiel #16
0
        public Int32 AddPayment(Int32 personId, DateTime date, String category, String subCategory, Decimal spended)
        {
            IPaymentRepository paymentRep = CSRepositoryFactory.GetPaymentRepository();

            return(paymentRep.AddPayment(personId, date, category, subCategory, spended));
        }