예제 #1
0
 private async void btnListPending_Click(object sender, EventArgs e)
 {
     var api = new WebApi.Client.RuleMotorClient(_host);
     //await api.ListPendingNotificationsWithState(5, 0, new List<int> { 1, 2, 3 }, 50);
     await api.ListPendingNotificationsWithState(0, 5, new List <int> {
         1
     }, 50);
 }
예제 #2
0
        private async void btnListar_Click(object sender, EventArgs e)
        {
            string strUser = txtListarUser.Text.Trim();

            int[] users = null;

            if (!string.IsNullOrEmpty(strUser))
            {
                int user = 0;
                if (int.TryParse(strUser, out user))
                {
                    users = new int[] { user }
                }
                ;
            }

            string strDevice = txtListarDevice.Text.Trim();

            int[] devices = null;

            if (!string.IsNullOrEmpty(strDevice))
            {
                int device = 0;
                if (int.TryParse(strDevice, out device))
                {
                    devices = new int[] { device }
                }
                ;
            }

            WebApi.Client.RuleMotorClient ruleMotor = new WebApi.Client.RuleMotorClient(_host);
            var pending = await ruleMotor.ListPendingNotificationsWithState(0, 5, new List <int> {
                4
            }, 50);

            var api = new WebApi.Client.HistoricClient(_host);

            //var historics = await api.Listar(null, null, users, devices, null, 0, 50);
            //var historics = await api.Listar(null, null, null, new int[] { 2 }, new int[] { 1, 2, 3}, null, 0, 200);
            var historics = await api.Listar(null, null, new int[] { 0 }, new int[] { 5 }, new int[] { 4 }, null, null, 0, 50, false);

            string msg = string.Format("Listar() Número de elementos obtenidos: {0}", historics != null ? historics.Count.ToString() : "null");

            AddTrace(msg);
        }