first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

C# Code: Windows Forms Data Services; Songhay.WinForms.Web.DataServices; Internal Row Procedures; C-sharp

#region Internal Row Procedures

internal static void RowCancel(DataView TargetDataView,ClientMessage Message) { Message.MainForm.BindingContext[TargetDataView].CancelCurrentEdit(); }

internal static void RowDelete(DataView TargetDataView,ClientMessage Message) { if(Message.MainForm.BindingContext[TargetDataView].Count > 0) { try { Message.MainForm.BindingContext[TargetDataView].RemoveAt( Message.MainForm.BindingContext[TargetDataView].Position); Message.ReadyToEdit(); Message.MainStatusPanel.Text = "Record deleted."; } catch(Exception Ex) { Message.ClientErr(); Message.MainStatusPanel.Text = Ex.Message; MessageBox.Show(Ex.Message); } } }

internal static void RowEndEdit(DataView TargetDataView,ClientMessage Message) { Message.MainForm.BindingContext[TargetDataView].EndCurrentEdit(); }

internal static void RowNew(DataView TargetDataView,ClientMessage Message) { try { Message.MainForm.BindingContext[TargetDataView].EndCurrentEdit(); Message.MainForm.BindingContext[TargetDataView].AddNew(); Message.ReadyToEdit(); Message.MainStatusPanel.Text = "New record added."; } catch(NoNullAllowedException Ex) { /* Ignore this exception. It will thrown again when the Position property is changed. */ Ex.GetType(); } catch(Exception Ex) { Message.ClientErr(); Message.MainStatusPanel.Text = Ex.Message; MessageBox.Show(Ex.Message); } }

#endregion

mod date: 2004-06-30T04:01:47.000Z