示例#1
0
        public static SqlDataReader ReaderSelect(ESLWorkLogData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select * from ESLWorkLog ");
            return(WFNetLib.ADO.SQLServerOP.ReaderExecuteSQL(sql.ToString()));
        }
示例#2
0
        public static int Insert(ESLWorkLogData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("insert into ESLWorkLog (");
            sql.Append("DeviceID, ");
            sql.Append("IP, ");
            sql.Append("Pass, ");
            sql.Append("Ret, ");
            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.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()));
        }
示例#3
0
        public static ESLWorkLogData Construct(IDataReader reader)
        {
            ESLWorkLogData data = new ESLWorkLogData();

            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.sTime = Convert.ToDateTime(reader["sTime"]); }
            catch { }

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

            return(data);
        }
示例#4
0
        public static ESLWorkLogData Construct(DataTable dt, int rowIndex)
        {
            ESLWorkLogData data = new ESLWorkLogData();

            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.sTime = Convert.ToDateTime(dr["sTime"]); }
            catch { }

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

            return(data);
        }