public int AddConfigLineInformation(ConfigLineInformation Record)
 {
     connect();
     string sql = String.Format("INSERT INTO `config_line_information` (`LineName`,`StationID_Start`,`StationID_End`,`VoltageLevel`,`RatedCurrent`) VALUE ('{0}','{1}','{2}','{3}','{4}');",
         Record.LineName, Record.StationID_Start, Record.StationID_End, Record.VoltageLevel, Record.RatedCurrent);
     MySqlCommand cmd = new MySqlCommand(sql, conn);
     int result = cmd.ExecuteNonQuery();
     return result;
 }
        public int AddConfigLineInformation(ConfigLineInformation Record)
        {
            connect();
            string sql = String.Format("INSERT INTO `config_line_information` (`LineName`,`StationID_Start`,`StationID_End`,`VoltageLevel`,`RatedCurrent`) VALUE ('{0}','{1}','{2}','{3}','{4}');",
                                       Record.LineName, Record.StationID_Start, Record.StationID_End, Record.VoltageLevel, Record.RatedCurrent);
            MySqlCommand cmd    = new MySqlCommand(sql, conn);
            int          result = cmd.ExecuteNonQuery();

            return(result);
        }
        public ConfigLineInformation FindConfigLineInformation(int ID)
        {
            connect();
            string sql = String.Format("SELECT * FROM `config_line_information` WHERE `ID`={0};",
                                       ID);
            MySqlCommand    cmd = new MySqlCommand(sql, conn);
            MySqlDataReader rdr = cmd.ExecuteReader();

            rdr.Read();
            ConfigLineInformation Record = new ConfigLineInformation()
            {
                ID              = (int)rdr["ID"],
                LineName        = (string)rdr["LineName"],
                StationID_Start = (int)rdr["StationID_Start"],
                StationID_End   = (int)rdr["StationID_End"],
                VoltageLevel    = double.Parse((string)rdr["VoltageLevel"]),
                RatedCurrent    = double.Parse((string)rdr["RatedCurrent"])
            };

            rdr.Close();
            return(Record);
        }
        public int AddConfigLineInformation(ConfigLineInformation Record)
        {
            DatabaseConnector dc = new DatabaseConnector();

            return(dc.AddConfigLineInformation(Record));
        }
 public ConfigLineInformation FindConfigLineInformation(int ID)
 {
     connect();
     string sql = String.Format("SELECT * FROM `config_line_information` WHERE `ID`={0};",
         ID);
     MySqlCommand cmd = new MySqlCommand(sql, conn);
     MySqlDataReader rdr = cmd.ExecuteReader();
     rdr.Read();
     ConfigLineInformation Record = new ConfigLineInformation() {
         ID = (int)rdr["ID"],
         LineName=(string)rdr["LineName"],
         StationID_Start = (int)rdr["StationID_Start"],
         StationID_End = (int)rdr["StationID_End"],
         VoltageLevel = double.Parse((string)rdr["VoltageLevel"]),
         RatedCurrent = double.Parse((string)rdr["RatedCurrent"])
     };
     rdr.Close();
     return Record;
 }
 public int AddConfigLineInformation(ConfigLineInformation Record)
 {
     DatabaseConnector dc = new DatabaseConnector();
     return dc.AddConfigLineInformation(Record);
 }