Example #1
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context        = context;
     Notifications   = new NotificationRepository(_context);
     Income          = new IncomeRepository(_context);
     IncomeCategory  = new IncomeCategoryRepository(_context);
     ExpenseCategory = new ExpenseCategoryRepository(_context);
     Documents       = new DocumentRepository(_context);
     Projects        = new ProjectRepository(_context);
     Products        = new ProductRepository(_context);
     Clients         = new ClientRepository(_context);
     ProjectStatus   = new ProjectStatusRepository(_context);
     ProjectSource   = new ProjectSourceRepository(_context);
 }
Example #2
0
        public UnitOfWork(PlutoContext context)
        {
            _ILog = Log.GetInstance;

            _context                  = context;
            AppUsers                  = new UserRepository(context);
            Students                  = new StudentRepository(context);
            PaymentHistories          = new PaymentHistoryRepository(context);
            Payments                  = new PaymentRepository(context);
            studentclasses            = new StudentClassRepository(context);
            departments               = new DepartmentRepository(context);
            regions                   = new RegionRepository(context);
            studentstatuses           = new StudentStatusRepository(context);
            employees                 = new EmployeeRepository(context);
            employeedocuments         = new EmployeeDocumentRepository(context);
            payrollamounts            = new PayrollAmountRepository(context);
            employeecategories        = new EmployeeCategoryRepository(context);
            employeelevelsofeducation = new EmployeeLevelOfEducationRepository(context);
            payrollrates              = new PayrollRateRepository(context);
            taxrates                  = new TaxRateRepository(context);
            ssnitrates                = new SSNITRateRepository(context);
            studentsubjects           = new StudentSubjectRepository(context);
            payrollallowances         = new PayrollAllowancesRepository(context);
            employeetypes             = new EmployeeTypeRepository(context);
            employeeloanhistories     = new EmployeeLoanHistoryRepository(context);
            employeeloans             = new EmployeeLoanRepository(context);
            exams          = new ExamRepository(context);
            marks          = new MarkRepository(context);
            externalhelper = new ExternalHelperRepository(context);

            hostels           = new HostelRepository(context);
            libraries         = new LibraryRepository(context);
            transports        = new TransportRepository(context);
            expenses          = new ExpenseRepository(context);
            expensecategories = new ExpenseCategoryRepository(context);
            incomes           = new IncomeRepository(context);
            incomecategories  = new IncomeCategoryRepository(context);
            books             = new BookRepository(context);
            booktypes         = new BookTypeRepository(context);
            rooms             = new RoomRepository(context);
            payrolldates      = new PayrollDateRepository(context);
            allowances        = new AllowanceRepository(context);
        }
Example #3
0
 public IncomeCategoryService(IncomeCategoryRepository repository)
 {
     _repository = repository;
 }
Example #4
0
        public static Income ParseIncomeMessage(string str, Telegram.Bot.Types.User user, IncomeCategoryRepository incCat)
        {
            var inputWithoutSpaces = Regex.Replace(str, @"^\+\s+", "");

            inputWithoutSpaces = inputWithoutSpaces.Replace(".", ",");

            var digitInputValue = Regex.Match(inputWithoutSpaces, @"[0-9]+(\,[0-9]+)?").Value;

            inputWithoutSpaces = inputWithoutSpaces.Replace(digitInputValue, "");
            inputWithoutSpaces = inputWithoutSpaces.Replace(@"+", "");


            var category = Regex.Match(inputWithoutSpaces, @"\D+").Value;
            var money    = (float)Convert.ToDouble(digitInputValue, CultureInfo.CurrentCulture);

            var foundedCategory = incCat.GetByString(category);

            return(new Income()
            {
                Amount = money,
                CreatedTime = DateTime.Now,
                CategoryId = 0, //TODO: fix category id
                Id = Guid.NewGuid().GetHashCode(),
                UserId = user.Id,
                Definition = category,
                ExpiresAt = new DateTime(2025, 7, 20)
            });
        }