Example #1
0
        // GET: Sp/Clients
        public ActionResult Index(DateTime?birthDay, string cpf = "")
        {
            var clients = Mapper.Map <IEnumerable <Client>, IEnumerable <ClientViewModel> >(_clientAppService.GetAll());

            clients = clients
                      .Where(c =>
                             (birthDay != null ? c.BirthDay == birthDay : true) &&
                             (!string.IsNullOrEmpty(cpf) ? c.Cpf.Contains(cpf) : true)
                             );
            ObjIndex obj = new ObjIndex();

            obj.Cpf      = cpf;
            obj.BirthDay = birthDay;
            obj.Clients  = clients;
            return(View(obj));
        }
Example #2
0
 private static ObjIndex[] ConvertArrayToIndex(string[] arr, uint idx)
 {
     ObjIndex[] dt = new ObjIndex[arr.Length - idx];
     int[]      v  = new int[3];
     for (uint i = 0; i < 3; i++)
     {
         v[i] = 0;
     }
     for (uint i = idx; i < arr.Length; i++)
     {
         string[] sv = arr[i].Split('/');
         int      t  = 0;
         for (uint j = 0; j < sv.Length && j < 3; j++)
         {
             v[j] = (int.TryParse(sv[j], out t)) ? t : 0;
         }
         dt[i - idx] = new ObjIndex(v[0], v[1], v[2]);
     }
     return(dt);
 }