Ejemplo n.º 1
0
        /// <summary>
        /// 傳入一個DTO,存檔,一次存檔一筆
        /// </summary>
        public void InsertData(MEM04_0000 MEM04_0000)
        {
            Comm   comm = new Comm();
            string sSql = " INSERT INTO " +
                          " MEM04_0000 (  mac_code,  station_code,  station_ip,  station_mac ) " +

                          "     VALUES ( @mac_code, @station_code, @station_ip, @station_mac ) ";

            using (SqlConnection con_db = comm.Set_DBConnection())
            {
                con_db.Execute(sSql, MEM04_0000);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 傳入一個DTO,修改,一次修改一筆
        /// </summary>
        public void UpdateData(MEM04_0000 MEM04_0000)
        {
            Comm   comm = new Comm();
            string sSql = " UPDATE MEM04_0000" +
                          "    SET mac_code     = @mac_code,     " +
                          "        station_code = @station_code, " +
                          "        station_ip   = @station_ip,   " +
                          "        station_mac  = @station_mac   " +
                          "  WHERE mem04_0000   = @mem04_0000    ";

            using (SqlConnection con_db = comm.Set_DBConnection())
            {
                con_db.Execute(sSql, MEM04_0000);
            }
        }