public static HPassWorkLogData Construct(IDataReader reader) { HPassWorkLogData data = new HPassWorkLogData(); 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 { } try { data.FileName = Convert.ToString(reader["FileName"]); } catch { } return(data); }
public static SqlDataReader ReaderSelect(HPassWorkLogData d) { StringBuilder sql = new StringBuilder(); sql.Append("select * from HPassWorkLog "); return(WFNetLib.ADO.SQLServerOP.ReaderExecuteSQL(sql.ToString())); }
public static int Insert(HPassWorkLogData d) { StringBuilder sql = new StringBuilder(); sql.Append("insert into HPassWorkLog ("); sql.Append("DeviceID, "); sql.Append("IP, "); sql.Append("Pass, "); sql.Append("Ret, "); sql.Append("SSID, "); sql.Append("sTime, "); sql.Append("eTime, "); sql.Append("FileName"); 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(", "); sql.Append("'"); sql.Append(d.FileName.ToString()); sql.Append("'"); sql.Append(")"); return(WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString())); }
public static int Update(HPassWorkLogData d) { StringBuilder sql = new StringBuilder(); sql.Append("update HPassWorkLog set "); sql.Append("eTime="); sql.Append("'"); sql.Append(d.eTime.ToString("yyyy-MM-dd HH:mm:ss")); sql.Append("'"); sql.Append(", "); sql.Append("Ret="); sql.Append("'"); sql.Append(d.Ret); sql.Append("'"); sql.Append(" where FileName="); sql.Append("'"); sql.Append(d.FileName.ToString()); sql.Append("'"); return(WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString())); }
public static HPassWorkLogData Construct(DataTable dt, int rowIndex) { HPassWorkLogData data = new HPassWorkLogData(); 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 { } try { data.FileName = Convert.ToString(dr["FileName"]); } catch { } return(data); }