public BudgetManager(EFCDbContext context, UserManager <ApplicationUser> userManager, IDateHelper dateHelper, IDocumentNumberingManager documentNumberingManager) { Context = context; DocumentNumberingManager = documentNumberingManager; UserManager = userManager; DateHelper = dateHelper; }
public InvoiceManager(EFCDbContext context, UserManager <ApplicationUser> userManager, IDateHelper dateHelper, ICustomerManager customerManager, IBudgetManager budgetManager, IDocumentNumberingManager documentNumberingManager) { Context = context; UserManager = userManager; DateHelper = dateHelper; DocumentNumberingManager = documentNumberingManager; CustomerManager = customerManager; BudgetManager = budgetManager; }
public AttachmentManager(EFCDbContext context, IHostingEnvironment environment, UserManager <ApplicationUser> userManager, IInvoiceManager invoiceManager, IBudgetManager budgetManager, IDateHelper dateHelper, IFileHelper fileHelper) { Context = context; HostingEnvironment = environment; UserManager = userManager; InvoiceManager = invoiceManager; BudgetManager = budgetManager; DateHelper = dateHelper; FileHelper = fileHelper; }
/// <summary> /// Get DocumentNumber model for given document type and date /// </summary> /// <param name="context"></param> /// <param name="dateHelper"></param> /// <param name="type">type of document</param> /// <param name="forDate">date for which document number should be taken</param> /// <param name="modifiedBy">ApplicationUser that is getting document number</param> /// <returns>DocumentNumber model for given document type and date</returns> public DocumentNumber GetDocumentNumberModel(EFCDbContext context, IDateHelper dateHelper, DocumentType type, DateTime forDate, ApplicationUser modifiedBy) { if (context == null || dateHelper == null || modifiedBy == null) { throw new ArgumentNullException(nameof(modifiedBy), "Nieprawidłowe parametry"); } lock (_lock) { var documentNumberingRecord = context.DocumentNumbers .Include(x => x.DocumentSequence) .SingleOrDefault(x => x.DocumentType == type && x.DocumentSequence.EffectiveFrom <= forDate && x.DocumentSequence.EffectiveTo > forDate); if (documentNumberingRecord == null) { throw new ArgumentException($"Brak numeratora dla {type.ToString()} dla daty {forDate.ToShortDateString()}", nameof(documentNumberingRecord)); } var nextSequence = documentNumberingRecord.DocumentSequence.NextNumber; if (nextSequence > documentNumberingRecord.DocumentSequence.MaxNumber) { throw new ArgumentException($"Osiągnięto maksymalną wartość dla numeratora dla {type.ToString()}", nameof(documentNumberingRecord)); } var now = dateHelper.GetCurrentDatetime(); documentNumberingRecord.DocumentSequence.NextNumber++; documentNumberingRecord.DocumentSequence.LastModifiedById = modifiedBy.Id; documentNumberingRecord.DocumentSequence.LastModifiedDate = now; context.DocumentSequences.Update(documentNumberingRecord.DocumentSequence); context.SaveChanges(); context.Entry(documentNumberingRecord).State = EntityState.Detached; documentNumberingRecord.DocumentSequence.NextNumber = nextSequence; return(documentNumberingRecord); } }
public CustomerManager(EFCDbContext context, UserManager <ApplicationUser> userManager, IDateHelper dateHelper) { Context = context; UserManager = userManager; DateHelper = dateHelper; }
public ItemController(EFCDbContext context) { _context = context; }
public PostManager(EFCDbContext context) { _context = context; }
public NewsController(EFCDbContext context) { _context = context; }
public ConsultationController(EFCDbContext context) { this.Context = context; }
public CustomerController(EFCDbContext context) { _context = context; }
public ProductModelsController(EFCDbContext context) { _context = context; }
public DocumentNumberingManager(EFCDbContext context, IDateHelper dateHelper, IDocumentNumberModelManager documentNumberModelManager) { Context = context; DateHelper = dateHelper; DocumentNumberModelManager = documentNumberModelManager; }
public RentController(EFCDbContext context) { _context = context; }
public CategoryController(EFCDbContext context) { _context = context; }
public MenuController(EFCDbContext context) { _context = context; }