Example #1
0
        public static void YZKPushToken_Add(YZKPushToken pushtoken)
        {
            /*
             *
             * alter proc YZKPushToken_Add
             * @devicetoken varchar(50),
             * @devicetype int,
             * @uid varchar(50)
             * as
             * if not exists(select * from YZKPushToken where uid=@uid)
             * begin
             * insert into YZKPushToken(uid,devicetoken,devicetype)
             * values(@uid,@devicetoken,@devicetype)
             * end
             * else
             * begin
             * update YZKPushToken set devicetype=@devicetype,
             * devicetoken=@devicetoken
             * where uid=@uid
             * end
             *
             */
            var paras = "device_mac,devicetoken,devicetype,uid".Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            var com   = new CommonAction <YZKPushToken>("YZKPushToken_Add", Connection.YZK);

            com.Action(pushtoken, paras);
        }
Example #2
0
        public static void MacIPInfo_Add(MacIPInfo macinfo)
        {
            /*
             * use YZK
             * go
             * alter proc  MacIPInfo_Add_heartbeat
             * @mac varchar(50),
             * @IP varchar(50),
             * @localip varchar(50),
             * @ssid varchar(50)
             * as
             * if not exists(select * from  MacIPInfo where mac=@mac)
             * begin
             * insert into  MacIPInfo(mac,IP)
             * values(@mac,@IP)
             * end
             * else
             * begin
             * update MacIPInfo set IP=@IP,record_time=GETDATE() where mac=@mac
             * end
             *
             */
            var com  = new CommonAction <MacIPInfo>("MacIPInfo_Add_heartbeat", Connection.YZK);
            var para = "OrgText,mac,IP,localip,ssid".Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

            com.Action(macinfo, para);
        }
Example #3
0
        /// <summary>
        /// 添加异常通知
        /// </summary>
        /// <param name="notify"></param>
        public static void NotifyExceptionAdd(NotifyException notify)
        {
            /*
             * alter proc NotifyExceptionAdd
             * @uid varchar(50),
             * @bxkLabel varchar(50),
             * @deviceSetName varchar(50),
             * @deviceId varchar(50)
             * as
             * insert into  NotifyException(uid,bxkLabel,deviceSetName,deviceId)
             * values(@uid,@bxkLabel,@deviceSetName,@deviceId)
             *
             */
            var c = new CommonAction <NotifyException>("NotifyExceptionAdd", Connection.YZK);

            c.Action(notify, "uid", "bxkLabel", "deviceSetName", "deviceId");
        }
Example #4
0
        public static void NotifyExceptionAddX(NotifyException notify)
        {
            /*
             * ALTER proc [dbo].[NotifyExceptionAdd]
             * @uid varchar(50),
             * @bxkLabel varchar(50),
             * @deviceSetName varchar(50),
             * @deviceId varchar(50),
             * @alarm_type int=0
             * as
             * insert into  NotifyException(uid,bxkLabel,deviceSetName,deviceId,alarm_type)
             * values(@uid,@bxkLabel,@deviceSetName,@deviceId,@alarm_type)
             *
             */
            var paras = "uid,bxkLabel,deviceSetName,deviceId,alarm_type".Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            var c     = new CommonAction <NotifyException>("NotifyExceptionAdd", Connection.YZK);

            c.Action(notify, paras);
        }
Example #5
0
        /// <summary>
        /// 添加或更新空调命令
        /// 这里存放通过天猫精灵发出的命令
        /// </summary>
        /// <param name="cmd"></param>
        public static void addOrUpdateCmd(AirCondtionCmd cmd)
        {
            /*
             * create proc  AirCondtionCmdAddOrUpdate
             * @deviceId varchar(50),
             * @cmd varchar(200)
             * as
             * if not exists(select  * from AirCondtionCmd with(index=IX_AirCondtionCmd_deviceId) where deviceId=@deviceId)
             * begin
             * insert into  AirCondtionCmd(deviceId,cmd)
             * values(@deviceId,@cmd)
             * end
             * else
             * begin
             * update AirCondtionCmd set cmd=@cmd where deviceId=@deviceId
             * end
             *
             */
            var com = new CommonAction <AirCondtionCmd>("AirCondtionCmdAddOrUpdate", Connection.YZK);

            com.Action(cmd, "deviceId", "cmd");
        }
Example #6
0
        /// <summary>
        /// 安防状态
        /// </summary>
        /// <param name="dss"></param>
        public static void DefenseStatus_Add(DefenseStatus dss)
        {
            /*
             * create proc DefenseStatus_Add
             * @status int,
             * @homeId varchar(50)
             * as
             * if not exists(select * from  DefenseStatus where  homeId=@homeId)
             * begin
             * insert into  DefenseStatus([status],homeId)
             * values(@status,@homeId)
             * end
             * else
             * begin
             * update DefenseStatus set [status]=@status where homeId=@homeId
             * end
             *
             *
             */
            var com = new CommonAction <DefenseStatus>("DefenseStatus_Add", Connection.YZK);

            com.Action(dss, "status", "homeId");
        }