mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-17 03:44:53 +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)
|
if (statusIds == null)
|
||||||
statusIds = new Stack ();
|
statusIds = new Stack ();
|
||||||
|
if (status != null)
|
||||||
statusIds.Push (status.Push (context_id++, message));
|
statusIds.Push (status.Push (context_id++, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +103,8 @@ class Client {
|
|||||||
if (tableau != null)
|
if (tableau != null)
|
||||||
tableau.Destroy ();
|
tableau.Destroy ();
|
||||||
|
|
||||||
|
PopMessage ();
|
||||||
|
PushMessage ("");
|
||||||
ArrayList dataList = Conn.SelectAll ();
|
ArrayList dataList = Conn.SelectAll ();
|
||||||
|
|
||||||
tableau = new Gtk.Table ((uint) dataList.Count + 1, 3, false);
|
tableau = new Gtk.Table ((uint) dataList.Count + 1, 3, false);
|
||||||
@ -271,23 +274,38 @@ class Client {
|
|||||||
|
|
||||||
static void Insert_Action (object o, EventArgs args)
|
static void Insert_Action (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
Conn.Insert (UInt32.Parse (id_entry.Text), name_entry.Text, address_entry.Text);
|
Conn.Insert (UInt32.Parse (id_entry.Text), name_entry.Text, address_entry.Text);
|
||||||
UpdateView ();
|
UpdateView ();
|
||||||
|
} catch (Exception e) {
|
||||||
|
PushMessage (e.Message);
|
||||||
|
}
|
||||||
dialog.Destroy ();
|
dialog.Destroy ();
|
||||||
|
dialog = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Remove_Action (object o, EventArgs args)
|
static void Remove_Action (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
Conn.Delete (UInt32.Parse (id_entry.Text));
|
Conn.Delete (UInt32.Parse (id_entry.Text));
|
||||||
UpdateView ();
|
UpdateView ();
|
||||||
|
} catch (Exception e) {
|
||||||
|
PushMessage (e.Message);
|
||||||
|
}
|
||||||
dialog.Destroy ();
|
dialog.Destroy ();
|
||||||
|
dialog = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Update_Action (object o, EventArgs args)
|
static void Update_Action (object o, EventArgs args)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
Conn.Update (UInt32.Parse (id_entry.Text), name_entry.Text, address_entry.Text);
|
Conn.Update (UInt32.Parse (id_entry.Text), name_entry.Text, address_entry.Text);
|
||||||
UpdateView ();
|
UpdateView ();
|
||||||
|
} catch (Exception e) {
|
||||||
|
PushMessage (e.Message);
|
||||||
|
}
|
||||||
dialog.Destroy ();
|
dialog.Destroy ();
|
||||||
|
dialog = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Dialog_Cancel (object o, EventArgs args)
|
static void Dialog_Cancel (object o, EventArgs args)
|
||||||
|
Loading…
Reference in New Issue
Block a user