Esempio n. 1
0
 public DataSet TraerListaPorTipoBD(string TipoOperacion, int MaxRegistros)
 {
     try
     {
         Dat_PC_Servicios acceso = new Dat_PC_Servicios();
         DataSet datos = acceso.TraerListaPorTipoBD(TipoOperacion, 0, System.Web.HttpContext.Current.User.Identity.Name, System.Web.HttpContext.Current.Request.UserHostAddress);
         return datos;
     }
     catch (Exception e)
     {
         string ee = e.Message;
         throw;
     }
 }
Esempio n. 2
0
 public List<ServiciosCentros> ListarCentrosCostoPorCentro(string TipoOperacion, string sortExpression)
 {
     try
     {
         Dat_PC_Servicios acceso = new Dat_PC_Servicios();
         DataSet datos = acceso.TraerListaPorTipoBD(TipoOperacion, 0, System.Web.HttpContext.Current.User.Identity.Name, System.Web.HttpContext.Current.Request.UserHostAddress);
         List<ServiciosCentros> servicios = null;
         if (datos != null && datos.Tables.Count > 0 && datos.Tables[0].Rows.Count > 0)
         {
             servicios = new List<ServiciosCentros>();
             foreach (DataRow row in datos.Tables[0].Rows)
             {
                 ServiciosCentros serv = new ServiciosCentros();
                 serv.CodigoCentro = int.Parse(row["PC_CentrosCosto_CodigoCentro"].ToString());
                 serv.NombreCentro = row["PC_CentrosCosto_NombreCentro"].ToString();
                 serv.Estado = row["PC_CentrosCosto_Estado"].ToString();
                 servicios.Add(serv);
             }
         }
         return servicios;
     }
     catch (Exception e)
     {
         string ee = e.Message;
         throw;
     }
 }