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

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

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

            CDalToBllConverter converter = new CDalToBllConverter();

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

            CDalToBllConverter converter = new CDalToBllConverter();

            return(converter.ConvertFamily(familyDto));
        }
示例#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);
        }
示例#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);
        }
示例#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));
        }
示例#8
0
        public Boolean LeaveFamily(Int32 personId)
        {
            IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository();

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

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

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

            return(subCatRep.TryDeleteSubCategory(personId, subCategoryId));
        }
示例#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));
        }
示例#13
0
        public Int32 AddSubCategory(Int32 personId, String categoryTitle, String subCategoryTitle, String subCategoryDescription)
        {
            ISubCategoryRepository subCatRep = CSRepositoryFactory.getSubCategoryRepository();

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

            return(paymentRep.DeletePayment(personId, paymentId));
        }
示例#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));
        }
示例#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));
        }