Esempio n. 1
0
        public int PostScheduling(int ObjectId, string ScheduleTime, int CommandID, bool status, int DayID)
        {
            var _object = new
            {
                ObjectID        = ObjectId,
                ScheduleTime    = ScheduleTime,
                CommandID       = CommandID,
                EnableOrDisable = status,
                Days            = DayID
            };
            var    url          = "api/Scheduling";
            string result       = SC.PostCaller(url, _object);
            int    SchedulingID = Convert.ToInt32(result);

            return(SchedulingID);
        }
Esempio n. 2
0
        public int PostObjectGroup(string ObjectId, string groupId)
        {
            var _object = new
            {
                ObjectId = ObjectId,
                GroupId  = groupId
            };
            var    url      = "api/ObjectGroup";
            string result   = SC.PostCaller(url, _object);
            int    clientId = Convert.ToInt32(result);

            return(clientId);
        }
Esempio n. 3
0
        public int PostCommand(int ObjectId, int CommandId)
        {
            var _object = new
            {
                CommandId = Convert.ToInt32(CommandId),
                ObjectId  = Convert.ToInt32(ObjectId),
            };
            var    url     = "api/CommandQueue";
            string result  = SC.PostCaller(url, _object);
            int    GroupId = Convert.ToInt32(result);

            return(GroupId);
        }
Esempio n. 4
0
        public int PostLoginGroup(string groupId, string LoginId)
        {
            var _object = new
            {
                GroupId = groupId,
                LoginId = LoginId
            };
            var    url      = "api/LoginGroup";
            string result   = SC.PostCaller(url, _object);
            int    clientId = Convert.ToInt32(result);

            return(clientId);
        }
Esempio n. 5
0
        public int PostFeature(string Name, string Description)
        {
            var _object = new
            {
                Name        = Name,
                Description = Description
            };
            var    url       = "api/Feature";
            string result    = SC.PostCaller(url, _object);
            int    FeatureID = Convert.ToInt32(result);

            return(FeatureID);
        }
Esempio n. 6
0
        public int PostGroup(string clientId, string name, string comment)
        {
            var _object = new
            {
                ClientID = Convert.ToInt32(clientId),
                Name     = name,
                Comment  = comment
            };
            var    url     = "api/Group";
            string result  = SC.PostCaller(url, _object);
            int    GroupId = Convert.ToInt32(result);

            return(GroupId);
        }
        public int PostLoginFeture(int LoginID, int FeatureID, bool Enable)
        {
            var _object = new
            {
                LoginID   = LoginID,
                FeatureID = FeatureID,
                Enable    = Enable
            };
            var    url        = "api/LoginFeature";
            string result     = SC.PostCaller(url, _object);
            int    _FeatureID = Convert.ToInt32(result);

            return(_FeatureID);
        }
Esempio n. 8
0
        public int PostHolidayScheduling(string Holidays, string FullDate, bool Enabled, int GroupID)
        {
            var _object = new
            {
                Holidays = Holidays,
                FullDate = FullDate,
                Enabled  = Enabled,
                GroupID  = GroupID
            };
            var    url       = "api/HolidayScheduling";
            string result    = SC.PostCaller(url, _object);
            int    HolidayID = Convert.ToInt32(result);

            return(HolidayID);
        }
Esempio n. 9
0
        //public List<ObjectSensorModel> GetObjectSensorsByObjId(int ObjectId)
        //{
        //    var url = "api/ObjectSensors?ObjectId=" + ObjectId;
        //    string result = SC.Getcaller(url);
        //    List<ObjectSensorModel> _objectsensors = JsonConvert.DeserializeObject<List<ObjectSensorModel>>(result);
        //    return _objectsensors;
        //}

        public int PostSensor(string SourceID, string SourceName, string Unit, bool EnableOrDisable)
        {
            var _object = new
            {
                SourceID        = SourceID,
                SourceName      = SourceName,
                Unit            = Unit,
                EnableOrDisable = EnableOrDisable
            };
            var    url      = "api/Sensor";
            string result   = SC.PostCaller(url, _object);
            int    SensorId = Convert.ToInt32(result);

            return(SensorId);
        }
Esempio n. 10
0
        public int PostLogin(string clientId, string roleId, string username, string comments, string password)
        {
            var _object = new
            {
                ClientID = Convert.ToInt32(clientId),
                RoleID   = Convert.ToInt32(roleId),
                User     = username,
                Comment  = comments,
                Password = password
            };
            var    url    = "api/Login";
            string result = SC.PostCaller(url, _object);
            int    PostId = Convert.ToInt32(result);

            return(PostId);
        }
Esempio n. 11
0
        public int PostObjectSensor(string sensorsId, string objectId, string name, bool enabled, bool smsalert, bool emailalert, string max, string min, string categoryID)
        {
            var _object = new
            {
                SensorID   = Convert.ToInt32(sensorsId),
                ObjectID   = Convert.ToInt32(objectId),
                Name       = name,
                Enabled    = Convert.ToBoolean(enabled),
                SMSAlert   = Convert.ToBoolean(smsalert),
                EmailAlert = Convert.ToBoolean(emailalert),
                MAX        = Convert.ToInt32(max),
                MIN        = Convert.ToInt32(min),
                CategoryID = Convert.ToInt32(categoryID)
            };
            var    url            = "api/ObjectSensors";
            string result         = SC.PostCaller(url, _object);
            int    ObjectSensorId = Convert.ToInt32(result);

            return(ObjectSensorId);
        }
Esempio n. 12
0
        public int PostClient(string name, string address, int operatorId, string contact, string code, bool enabled, string email, string expireDate, bool deleted)
        {
            var _object = new
            {
                Name       = name,
                Address    = address,
                OperatorID = operatorId,
                Contact    = contact,
                Code       = code,
                Enabled    = enabled,
                Email      = email,
                ExpireDate = expireDate,
                Deleted    = deleted
            };
            var    url      = "api/Client";
            string result   = SC.PostCaller(url, _object);
            int    clientId = Convert.ToInt32(result);

            return(clientId);
        }
        public int PostEventConfiguration(int ObjectSensorID, int ObjectID, double Min, double Max, int Condition, string Source, string Source2, string Source3, bool EnableOrDisable)
        {
            var _object = new
            {
                ObjectSensorID  = ObjectSensorID,
                ObjectID        = ObjectID,
                Min             = Min,
                MAX             = Max,
                Condition       = Condition,
                Source          = Source,
                Source2         = Source2,
                Source3         = Source3,
                EnableOrDisable = EnableOrDisable
            };
            var    url    = "api/EventConfiguration";
            string result = SC.PostCaller(url, _object);
            int    ECId   = Convert.ToInt32(result);

            return(ECId);
        }
Esempio n. 14
0
        public int PostObject(string name, string address, string lat, string lon, string imei, string simnumber, string firmwareversion, string hardwareversion, bool enabdisab, string clientid, string contact1, bool chkRelaySt)
        {
            var _object = new
            {
                Name            = name,
                Address         = address,
                LAT             = Convert.ToDecimal(lat),
                LONG            = Convert.ToDecimal(lon),
                IMEI            = Convert.ToInt64(imei),
                SimNumber       = Convert.ToInt64(simnumber),
                FirmWareVersion = firmwareversion,
                HardwareVersion = hardwareversion,
                EnableOrDisable = enabdisab,
                ClientID        = Convert.ToInt32(clientid),

                RelayStatus = chkRelaySt,
            };
            var    url      = "api/Object";
            string result   = SC.PostCaller(url, _object);
            int    objectID = Convert.ToInt32(result);

            return(objectID);
        }