示例#1
0
        private void btnNext_Click(object sender, System.EventArgs e)
        {
            if(FrmParent != null)
                FrmParent.PostActivity();

            ListViewItem LVI = lvUsers.SelectedItems[0];
            OysterClassLibrary.User  UU = (OysterClassLibrary.User)LVI.Tag;

            if(IsEditing == false)
            {
                OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                F.CreateSection(tbDescription.Text,UU.ID,PreviousSection.ID);
                F.Dispose();
                Trace.WriteLine("Created Section: " + tbDescription.Text +
                    " and connected it to Section:" + PreviousSection.Description + "(" + PreviousSection.ID + ")",System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name);

                this.DialogResult = DialogResult.OK;
                return;
            }
            else
            {
                CurrentSection.Update(tbDescription.Text,UU.ID,PreviousSection.ID);
                Trace.WriteLine("Edited Section: " + CurrentSection.Description +"(" + CurrentSection.ID.ToString() + ")",System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name);

                this.DialogResult = DialogResult.OK;
                return;
            }
        }