public static void DelItemExt(MyTable table) { string tsql = @"UPDATE [Customers] SET num_ext='0' WHERE Id='" + table.Id + "'"; try { DBCon con = new DBCon(); con.AddExt(tsql); MessageBox.Show("update"); } catch (SqlException ex) { MessageBox.Show(ex.ToString()); } }
public static void AddItemExt(MyTable table) { int i = table.Num + 1; if (table.Num < 5) { string tsql = @"UPDATE [Customers] SET num_ext='" + i + "' WHERE Id='" + table.Id + "'"; try { DBCon con = new DBCon(); con.AddExt(tsql); MessageBox.Show("update"); } catch (SqlException ex) { MessageBox.Show(ex.ToString()); } } else { MessageBox.Show("Already use all ext"); } }