public List <LoginFeatureModel> GetFeature()
        {
            var    url    = "api/LoginFeature";
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <LoginFeatureModel> Features = JsonConvert.DeserializeObject <List <LoginFeatureModel> >(result);
                return(Features);
            }
            {
                return(null);
            }
        }
Esempio n. 2
0
        public List <LoginModel> GetLogin()
        {
            var    url    = "api/login";
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <LoginModel> lg = JsonConvert.DeserializeObject <List <LoginModel> >(result);
                return(lg);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
        public List <HolidaySchedulingModel> GetHolidayScheduling()
        {
            var    url    = "api/HolidayScheduling";
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <HolidaySchedulingModel> HolidayScheduling = JsonConvert.DeserializeObject <List <HolidaySchedulingModel> >(result);
                return(HolidayScheduling);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 4
0
        public List <GroupModel> GetGroup()
        {
            var    url    = "api/Group";
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <GroupModel> _groups = JsonConvert.DeserializeObject <List <GroupModel> >(result);
                return(_groups);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 5
0
        public List <SensorCommandModel> GetSensorCommand(int SensorId)
        {
            var    url    = "api/SensorCommand?SensorId=" + SensorId;
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <SensorCommandModel> Features = JsonConvert.DeserializeObject <List <SensorCommandModel> >(result);
                return(Features);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 6
0
        public List <SensorModel> GetSensors()
        {
            var    url    = "api/Sensor";
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <SensorModel> _sensors = JsonConvert.DeserializeObject <List <SensorModel> >(result);
                return(_sensors);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 7
0
        public List <ReportModel> GetConsumptionReport(int objectId, string sensor)
        {
            var    url    = "api/SwitchesReport?ObjectID=" + objectId + "&sensor=" + sensor;
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <ReportModel> rep = JsonConvert.DeserializeObject <List <ReportModel> >(result);
                return(rep);
            }
            else
            {
                return(null);
            }
        }
        public List <RelayNotificationModel> GetByClientId(int ClientId, DateTime LastTime)
        {
            var    url    = "api/RelayNotification?ClientID=" + ClientId + "&lastTime=" + LastTime;
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <RelayNotificationModel> NotificationModel = JsonConvert.DeserializeObject <List <RelayNotificationModel> >(result);
                return(NotificationModel);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 9
0
        public List <ClientModel> GetClient()
        {
            var    url    = "api/Client";
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <ClientModel> clients = JsonConvert.DeserializeObject <List <ClientModel> >(result);
                return(clients);
            }
            else
            {
                return(null);
            }
        }
        public List <EventConfigurationModel> GetEventConfiguration()
        {
            var    url    = "api/EventConfiguration";
            string result = SC.Getcaller(url);

            if (result.Contains("[]"))
            {
                return(null);
            }
            else
            {
                List <EventConfigurationModel> _EventConfigurationModel = JsonConvert.DeserializeObject <List <EventConfigurationModel> >(result);
                return(_EventConfigurationModel);
            }
        }
        public List <StoreProcedureModel> GetStoreProcedure(int ObjectID, int CurrentID, int VoltageID)
        {
            var    url    = "api/StoreProcedure?ObjectID=" + ObjectID + "&CurrentID=" + CurrentID + "&VoltageID=" + VoltageID;
            string result = SC.Getcaller(url);

            if (result.Contains("[]"))
            {
                return(null);
            }
            else
            {
                List <StoreProcedureModel> _StoreProcedure = JsonConvert.DeserializeObject <List <StoreProcedureModel> >(result);
                return(_StoreProcedure);
            }
        }
Esempio n. 12
0
        public EventLogModel GetFeulByObject(int ObjectId)
        {
            var    url    = "api/EventLog?ObjectId=" + ObjectId;
            string result = SC.Getcaller(url);

            if (result != null)
            {
                EventLogModel _event = JsonConvert.DeserializeObject <EventLogModel>(result);
                return(_event);
            }
            else
            {
                return(null);
            }
        }
        //public List<SwitchesReportModel> GetSwitchesReportObject(int ObjectId, DateTime StartDateTime, DateTime EndDateTime)
        //{
        //    var url = "api/SwitchesReport?ObjectId="+ObjectId+"&StartDateTime="+StartDateTime+"&EndDateTime="+EndDateTime;
        //    string result = SC.Getcaller(url);
        //    if (result != null)
        //    {

        //        List<SwitchesReportModel> _sensor = JsonConvert.DeserializeObject<List<SwitchesReportModel>>(result);
        //        List<SwitchesReportModel> _sensor2 = _sensor.OrderBy(x => x.LocationID).ToList();

        //        return _sensor2;
        //    }
        //    else
        //    {
        //        return null;
        //    }

        //}
        public List <SwitchesReportControllingModel> GetCurrentdateSwitchesReportControling(int ObjectId)
        {
            var    url    = "api/SwitchesReport?ObjectID=" + ObjectId;
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <SwitchesReportControllingModel> _sensor = JsonConvert.DeserializeObject <List <SwitchesReportControllingModel> >(result);
                return(_sensor);
            }
            else
            {
                return(null);
            }
        }
        public List <CommandHistoryModel> GetNonAlerts()
        {
            var    url    = "api/CommandHistory";
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <CommandHistoryModel> CHM = JsonConvert.DeserializeObject <List <CommandHistoryModel> >(result);
                return(CHM);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 15
0
        public List <TAVLModel> GetTAVLObjectList(int ClientId, int GroupId, string IP)
        {
            var    url    = "api/TavlService?ClientId=" + ClientId + "&GroupId=" + GroupId + "&IPAddress=" + IP + "&isReverseGeocoding=DISABLE";
            string result = SC.Getcaller(url);

            if (result.Contains("[]"))
            {
                return(null);
            }
            else
            {
                List <TAVLModel> Response = JsonConvert.DeserializeObject <List <TAVLModel> >(result);
                for (int i = 0; i < Response.Count; i++)
                {
                    DateTime strTime = Convert.ToDateTime(Response[i].gpsTime);
                    string   st      = strTime.ToString();
                    string[] arr     = st.Split(' ');
                    Response[i].date = arr[0];
                    Response[i].time = arr[1] + arr[2];
                    if (Convert.ToInt32(Response[i].speed) > 3)
                    {
                        Response[i]._speed = "4";
                    }
                    else if (Convert.ToInt32(Response[i].speed) > 256)
                    {
                        Response[i]._speed = "0";
                    }
                    else
                    {
                        Response[i]._speed = "0";
                    }
                    if (strTime > DateTime.Now.AddHours(-24))
                    {
                        Response[i]._speed = "5";
                    }
                }
                return(Response);
            }
        }
Esempio n. 16
0
        public List <ObjectModel> GetObjects()
        {
            var    url    = "api/Object";
            string result = SC.Getcaller(url);

            if (result != null)
            {
                List <ObjectModel> _objects = JsonConvert.DeserializeObject <List <ObjectModel> >(result);
                return(_objects);
            }
            else
            {
                return(null);
            }
        }