Exemplo n.º 1
0
        public bool Counter_GetDocumentDecisionCounter(DocumentDecision model)
        {
            try
            {
                var counterId = repo.AllReadonly <Counter>()
                                .Where(x => x.CourtId == model.CourtId && x.CounterTypeId == NomenclatureConstants.CounterTypes.DocumentDecision)
                                .Select(x => x.Id)
                                .FirstOrDefault();
                if (counterId > 0)
                {
                    var courtCode = repo.AllReadonly <Court>().FirstOrDefault(x => x.Id == model.CourtId)?.Code;

                    model.RegNumber = $"{DateTime.Now.Year}{courtCode}{Counter_GetValue(counterId)}";
                    model.RegDate   = DateTime.Now;
                    return(true);
                }
                else
                {
                    throw new Exception($"Няма настроен брояч за решения по доументи. Court={model.CourtId}");
                }
            }
            catch (Exception ex)
            {
                logger.LogError(ex, $"Грешка при запис на брояч за решения по доументи. Court={model.CourtId}");
            }
            return(false);
        }
Exemplo n.º 2
0
 public bool Counter_GetDocumentDecisionCounter(DocumentDecision model)
 {
     throw new NotImplementedException();
 }