/// <summary> /// Obtiene las agendas de un cliente en específico /// </summary> /// <param name="clienteID">Identificador del cliente</param> /// <returns>Lista de agendas que le pertenecen al cliente</returns> public static List<Agenda> AgendasCliente(string clienteID) { try { List<Agenda> lista = new List<Agenda>(); Agenda[] agendas = new CMovilReportesAutomaticosWS.CMovilReportesAutomaticosWS().AgendasCliente(clienteID); if (agendas == null || agendas.Length == 0) return lista; foreach (Agenda agenda in agendas) { agenda.Hora = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(agenda.Hora, TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time").Id, TimeZoneInfo.Local.Id); lista.Add(agenda); } return lista; } catch { throw; } }
public string GetLimiteAgendas() { HttpCookie Cookie = HttpContext.Current.Request.Cookies.Get("Usuario"); if (Cookie != null && AutentificacionBD.VerificarToken(Cookie.Values.Get("Token"))) { string cliente = new Codificador().Desencriptar(Cookie.Values.Get("Cliente")); cliente = cliente.Replace("\0", string.Empty); long token = long.Parse(new Codificador().Desencriptar(Cookie.Values.Get("Token"))); int agendas = new CMovilReportesAutomaticosWS.CMovilReportesAutomaticosWS().LimiteAgendas(cliente); if (agendas == null) return "error404"; string json = JsonConvert.SerializeObject(agendas, Formatting.None); return json; } else return "error404"; }