예제 #1
0
        public static SqlDataReader ReaderSelect(KeyDataQueueData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select * from KeyDataQueue ");
            return(WFNetLib.ADO.SQLServerOP.ReaderExecuteSQL(sql.ToString()));
        }
예제 #2
0
        public static void delete(KeyDataQueueData kd)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("delete from KeyDataQueue where ID=" + kd.ID + "");
            WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString());
        }
예제 #3
0
        public static KeyDataQueueData Construct(DataRow dr)
        {
            KeyDataQueueData data = new KeyDataQueueData();

            try { data.ID = Convert.ToInt32(dr["ID"]); }
            catch { }

            try { data.IP = Convert.ToString(dr["IP"]); }
            catch { }

            try { data.BIN = Convert.ToString(dr["BIN"]); }
            catch { }

            try { data.sTime = Convert.ToDateTime(dr["sTime"]); }
            catch { }

            try { data.DeviceID = Convert.ToString(dr["DeviceID"]); }
            catch { }

            try { data.SSID = Convert.ToString(dr["SSID"]); }
            catch { }

            try { data.KG = Convert.ToInt32(dr["KG"]); }
            catch { }

            try { data.KeyOption = Convert.ToInt32(dr["KeyOption"]); }
            catch { }

            try { data.format = Convert.ToInt32(dr["format"]); }
            catch { }

            return(data);
        }
예제 #4
0
        public static void delete(KeyDataQueueData kd)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("delete from KeyDataQueue where SSID='" + kd.SSID + "' and IP='" + kd.IP + "' and DeviceID='" + kd.DeviceID + "' and sTime='" + kd.sTime + "'");
            WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString());
        }
예제 #5
0
        public static DataTable DataTableSelect(KeyDataQueueData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select * from KeyDataQueue where ID=");
            sql.Append("");
            sql.Append(d.ID.ToString());
            sql.Append("");
            return(WFNetLib.ADO.SQLServerOP.DataTableSQL(sql.ToString()));
        }
예제 #6
0
        public static int Delete(KeyDataQueueData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("delete from KeyDataQueue ");
            sql.Append(" where ID=");
            sql.Append("");
            sql.Append(d.ID.ToString());
            sql.Append("");
            return(WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString()));
        }
예제 #7
0
        public static int Insert(KeyDataQueueData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("insert into KeyDataQueue (");
            sql.Append("IP, ");
            sql.Append("BIN, ");
            sql.Append("sTime, ");
            sql.Append("DeviceID, ");
            sql.Append("SSID, ");
            sql.Append("KG, ");
            sql.Append("KeyOption, ");
            sql.Append("format");
            sql.Append(") values (");
            sql.Append("'");
            sql.Append(d.IP.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.BIN.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.sTime.ToString("yyyy-MM-dd HH:mm:ss"));
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.DeviceID.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.SSID.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("");
            sql.Append(d.KG.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("");
            sql.Append(d.KeyOption.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("");
            sql.Append(d.format.ToString());
            sql.Append("");
            sql.Append(")");
            sql.Append(" select @@identity");
            object o = WFNetLib.ADO.SQLServerOP.ScalarSQL(sql.ToString());

            return(Convert.ToInt32(o));
        }
예제 #8
0
        public static int Update(KeyDataQueueData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("update KeyDataQueue set ");
            sql.Append("IP=");
            sql.Append("'");
            sql.Append(d.IP.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("BIN=");
            sql.Append("'");
            sql.Append(d.BIN.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("sTime=");
            sql.Append("'");
            sql.Append(d.sTime.ToString("yyyy-MM-dd HH:mm:ss"));
            sql.Append("'");
            sql.Append(", ");
            sql.Append("DeviceID=");
            sql.Append("'");
            sql.Append(d.DeviceID.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("SSID=");
            sql.Append("'");
            sql.Append(d.SSID.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("KG=");
            sql.Append("");
            sql.Append(d.KG.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("KeyOption=");
            sql.Append("");
            sql.Append(d.KeyOption.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("format=");
            sql.Append("");
            sql.Append(d.format.ToString());
            sql.Append("");
            sql.Append(" where ID=");
            sql.Append("");
            sql.Append(d.ID.ToString()); sql.Append("");

            return(WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString()));
        }
예제 #9
0
        public static KeyDataQueueData Construct(DataTable dt, int rowIndex)
        {
            KeyDataQueueData data = new KeyDataQueueData();

            if (dt.Rows.Count < rowIndex + 1)
            {
                return(null);
            }

            DataRow dr = dt.Rows[rowIndex];

            if (dr == null)
            {
                return(null);
            }

            try { data.ID = Convert.ToInt32(dr["ID"]); }
            catch { }

            try { data.IP = Convert.ToString(dr["IP"]); }
            catch { }

            try { data.BIN = Convert.ToString(dr["BIN"]); }
            catch { }

            try { data.sTime = Convert.ToDateTime(dr["sTime"]); }
            catch { }

            try { data.DeviceID = Convert.ToString(dr["DeviceID"]); }
            catch { }

            try { data.SSID = Convert.ToString(dr["SSID"]); }
            catch { }

            try { data.KG = Convert.ToInt32(dr["KG"]); }
            catch { }

            try { data.KeyOption = Convert.ToInt32(dr["KeyOption"]); }
            catch { }

            try { data.format = Convert.ToInt32(dr["format"]); }
            catch { }

            return(data);
        }