Ejemplo n.º 1
0
        public User FindId(int id)
        {
            var user = _UserApp.FindId(id);

            user.PasswordCompare = user.Password;
            return(user);
        }
Ejemplo n.º 2
0
        public object QueryNotaDebito(Expression <Func <DebitNote, bool> > obj)
        {
            var userApp = new UserApp(_connection);

            var lista = new List <object>();

            var notaDebito = _DebitNotesApp.Search(obj)
                             .Include(c => c.Contractor.State)
                             .Include(c => c.Contractor.City).ToList();

            if (notaDebito == null)
            {
                return(lista);
            }

            var newList = notaDebito.OrderBy(c => c.Date);

            foreach (var item in newList)
            {
                var nd = item;

                lista.Add(new DebitNoteView
                {
                    DeadName         = nd.DeadName,
                    Date             = nd.Date.ToShortDateString(),
                    Value            = nd.Value.ToString("C"),
                    NumberDebitNote  = nd.NumberDebitNote,
                    ProcessNumber    = nd.ProcessNumber,
                    PersonName       = nd.Contractor.PersonName,
                    City             = nd.Contractor.City?.CityName,
                    CorporateName    = nd.Contractor.CorporateName,
                    Cnpj             = nd.Contractor.Cnpj.Replace(',', '.'),
                    ComercialPhone   = nd.Contractor.CommercialPhone,
                    CellPhone        = nd.Contractor.CellPhone,
                    LandLine         = nd.Contractor.LandLine,
                    DateRegistration = nd.DateRegistration,
                    UserName         = userApp.FindId(nd.UserControlId.Value).UserName,
                    ZipCode          = nd.Contractor.ZipCode,
                    Street           = nd.Contractor.Street,
                    Neighborhhod     = nd.Contractor.Neighborhood,
                    NumberStreet     = nd.Contractor.NumberStreet.ToString().Replace(",00", "").PadLeft(4, '0'),
                    InitialsState    = nd.Contractor.State?.Initials,
                    Complement       = nd.Contractor.Complement
                });
            }
            return(lista);
        }