mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
Handle DB exceptions
svn path=/trunk/gtk-sharp/; revision=6151
This commit is contained in:
parent
5937983a62
commit
e032408c50
@ -55,6 +55,7 @@ class Client {
|
||||
{
|
||||
if (statusIds == null)
|
||||
statusIds = new Stack ();
|
||||
if (status != null)
|
||||
statusIds.Push (status.Push (context_id++, message));
|
||||
}
|
||||
|
||||
@ -102,6 +103,8 @@ class Client {
|
||||
if (tableau != null)
|
||||
tableau.Destroy ();
|
||||
|
||||
PopMessage ();
|
||||
PushMessage ("");
|
||||
ArrayList dataList = Conn.SelectAll ();
|
||||
|
||||
tableau = new Gtk.Table ((uint) dataList.Count + 1, 3, false);
|
||||
@ -271,23 +274,38 @@ class Client {
|
||||
|
||||
static void Insert_Action (object o, EventArgs args)
|
||||
{
|
||||
try {
|
||||
Conn.Insert (UInt32.Parse (id_entry.Text), name_entry.Text, address_entry.Text);
|
||||
UpdateView ();
|
||||
} catch (Exception e) {
|
||||
PushMessage (e.Message);
|
||||
}
|
||||
dialog.Destroy ();
|
||||
dialog = null;
|
||||
}
|
||||
|
||||
static void Remove_Action (object o, EventArgs args)
|
||||
{
|
||||
try {
|
||||
Conn.Delete (UInt32.Parse (id_entry.Text));
|
||||
UpdateView ();
|
||||
} catch (Exception e) {
|
||||
PushMessage (e.Message);
|
||||
}
|
||||
dialog.Destroy ();
|
||||
dialog = null;
|
||||
}
|
||||
|
||||
static void Update_Action (object o, EventArgs args)
|
||||
{
|
||||
try {
|
||||
Conn.Update (UInt32.Parse (id_entry.Text), name_entry.Text, address_entry.Text);
|
||||
UpdateView ();
|
||||
} catch (Exception e) {
|
||||
PushMessage (e.Message);
|
||||
}
|
||||
dialog.Destroy ();
|
||||
dialog = null;
|
||||
}
|
||||
|
||||
static void Dialog_Cancel (object o, EventArgs args)
|
||||
|
Loading…
Reference in New Issue
Block a user