コード例 #1
0
        public static SqlDataReader ReaderSelect(DPassWorkLogData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select * from DPassWorkLog ");
            return(WFNetLib.ADO.SQLServerOP.ReaderExecuteSQL(sql.ToString()));
        }
コード例 #2
0
        public static DPassWorkLogData Construct(IDataReader reader)
        {
            DPassWorkLogData data = new DPassWorkLogData();

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

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

            try { data.Pass = Convert.ToString(reader["Pass"]); }
            catch { }

            try { data.Ret = Convert.ToString(reader["Ret"]); }
            catch { }

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

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

            try { data.eTime = Convert.ToDateTime(reader["eTime"]); }
            catch { }

            return(data);
        }
コード例 #3
0
        public static int Insert(DPassWorkLogData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("insert into DPassWorkLog (");
            sql.Append("DeviceID, ");
            sql.Append("IP, ");
            sql.Append("Pass, ");
            sql.Append("Ret, ");
            sql.Append("SSID, ");
            sql.Append("sTime, ");
            sql.Append("eTime");
            sql.Append(") values (");
            sql.Append("'");
            sql.Append(d.DeviceID.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.IP.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.Pass.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.Ret.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.SSID.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.eTime.ToString("yyyy-MM-dd HH:mm:ss"));
            sql.Append("'");
            sql.Append(")");
            return(WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString()));
        }
コード例 #4
0
        public static DPassWorkLogData Construct(DataTable dt, int rowIndex)
        {
            DPassWorkLogData data = new DPassWorkLogData();

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

            DataRow dr = dt.Rows[rowIndex];

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

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

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

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

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

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

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

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

            return(data);
        }