public int AddRuntimeLineData(RuntimeLineData Record) { connect(); string sql = String.Format("INSERT INTO `runtime_line_data` (`LineID`,`LoadQuantity`,`Time`) VALUE ('{0}','{1}','{2}');", Record.LineID, Record.LoadQuantity, Record.Time.ToString("yyyy-MM-dd HH:mm:ss")); MySqlCommand cmd = new MySqlCommand(sql, conn); int result = cmd.ExecuteNonQuery(); return result; }
public int AddRuntimeLineData(RuntimeLineData Record) { connect(); string sql = String.Format("INSERT INTO `runtime_line_data` (`LineID`,`LoadQuantity`,`Time`) VALUE ('{0}','{1}','{2}');", Record.LineID, Record.LoadQuantity, Record.Time.ToString("yyyy-MM-dd HH:mm:ss")); MySqlCommand cmd = new MySqlCommand(sql, conn); int result = cmd.ExecuteNonQuery(); return(result); }
public RuntimeLineData FindRuntimeLineData(int ID) { connect(); string sql = String.Format("SELECT * FROM `runtime_line_data` WHERE `ID`={0};", ID); MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader rdr = cmd.ExecuteReader(); rdr.Read(); RuntimeLineData Record = new RuntimeLineData() { ID = (int)rdr["ID"], LineID = (int)rdr["LineID"], LoadQuantity = double.Parse((string)rdr["LoadQuantity"]), Time = (DateTime)rdr["Time"] }; rdr.Close(); return(Record); }
public int AddRuntimeLineData(RuntimeLineData Record) { DatabaseConnector dc = new DatabaseConnector(); return(dc.AddRuntimeLineData(Record)); }
public RuntimeLineData FindRuntimeLineData(int ID) { connect(); string sql = String.Format("SELECT * FROM `runtime_line_data` WHERE `ID`={0};", ID); MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader rdr = cmd.ExecuteReader(); rdr.Read(); RuntimeLineData Record = new RuntimeLineData() { ID = (int)rdr["ID"], LineID = (int)rdr["LineID"], LoadQuantity = double.Parse((string)rdr["LoadQuantity"]), Time = (DateTime)rdr["Time"] }; rdr.Close(); return Record; }
public int AddRuntimeLineData(RuntimeLineData Record) { DatabaseConnector dc = new DatabaseConnector(); return dc.AddRuntimeLineData(Record); }