Ejemplo n.º 1
0
 public Models.TOTransaction <List <TOInfReser> > GetInfoReserva(int soc_cont, int sbe_cont, short emp_codi)
 {
     try
     {
         DAOGnTerce        daoTerce = new  DAOGnTerce();
         DateTime          ahora    = DateTime.Now;
         List <TOInfReser> reservas = new List <TOInfReser>(daoReserva.GetInfoReservas(emp_codi, soc_cont, sbe_cont));
         foreach (var item in reservas)
         {
             if (item.FechaInicio < ahora)
             {
                 item.Res_vige = "N";
             }
             else
             {
                 item.Res_vige = "S";
             }
             var tercero = daoTerce.GetGnTerce(emp_codi, item.Ter_codi);
             item.Ter_foto = string.IsNullOrEmpty(tercero.Ter_foto.ToString()) ? null : tercero.Ter_foto;
             item.Ter_noco = tercero.Ter_noco;
         }
         return(new Models.TOTransaction <List <TOInfReser> >()
         {
             ObjTransaction = reservas, Retorno = 0, TxtError = ""
         });
     }
     catch (Exception ex)
     {
         return(new Models.TOTransaction <List <TOInfReser> >()
         {
             ObjTransaction = null, Retorno = 1, TxtError = ex.Message
         });
     }
 }