public bool IsEmailExisted(string email) { ILoginRepository loginRepository = CSRepositoryFactory.GetLoginRepository(); CLoginDataDto loginDto = loginRepository.FindLoginDataByEmail(email); return(loginDto != null); }
public bool IsUsernameExisted(string username) { ILoginRepository loginRepository = CSRepositoryFactory.GetLoginRepository(); CLoginDataDto loginDto = loginRepository.FindLoginDataByUsername(username); return(loginDto != null); }
public CPerson GetPersonById(int personId) { IPersonRepository personRepository = CSRepositoryFactory.GetPersonRepository(); CPersonDto personDal = personRepository.FindItemByKeyFullLoad(personId); CDalToBllConverter converter = new CDalToBllConverter(); return(converter.ConvertPerson(personDal)); }
public CFamily GetFamilyByPersonId(int personId) { IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository(); CFamilyDto familyDto = familyRep.FindByPersonIdFullLoad(personId); CDalToBllConverter converter = new CDalToBllConverter(); return(converter.ConvertFamily(familyDto)); }
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); }
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); }
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)); }
public Boolean LeaveFamily(Int32 personId) { IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository(); return(familyRep.LeaveFamily(personId)); }
public Boolean JoinFamily(Int32 personId, Int32 familyId) { IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository(); return(familyRep.JoinFamily(personId, familyId)); }
public Boolean CreateFamily(Int32 personId, String familyName, Int32 budget) { IFamilyRepository familyRep = CSRepositoryFactory.GetFamilyRepository(); return(familyRep.CreateFamily(personId, familyName, budget)); }
public Boolean DeleteSubCategory(Int32 personId, Int32 subCategoryId) { ISubCategoryRepository subCatRep = CSRepositoryFactory.getSubCategoryRepository(); return(subCatRep.TryDeleteSubCategory(personId, subCategoryId)); }
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)); }
public Int32 AddSubCategory(Int32 personId, String categoryTitle, String subCategoryTitle, String subCategoryDescription) { ISubCategoryRepository subCatRep = CSRepositoryFactory.getSubCategoryRepository(); return(subCatRep.TryAddSubCategory(personId, categoryTitle, subCategoryTitle, subCategoryDescription)); }
public Boolean DeletePayment(Int32 personId, Int32 paymentId) { IPaymentRepository paymentRep = CSRepositoryFactory.GetPaymentRepository(); return(paymentRep.DeletePayment(personId, paymentId)); }
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)); }
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)); }