Ejemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     frmGroupItem f = new frmGroupItem();
     DialogResult dr = f.ShowDialog();
     if (dr == DialogResult.OK)
     {
         string n = f.GroupName;
         YeHeCommuniServerApp.Default.CSDBI.AddGroup(n);
         BindGroup();
     }
 }
Ejemplo n.º 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex >= 0)
            {
                int id = (int)this.listBox1.SelectedValue;
                string oldname = this.listBox1.Text;

                frmGroupItem f = new frmGroupItem();
                f.GroupName = oldname;
                DialogResult dr = f.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    string n = f.GroupName;
                    YeHeCommuniServerApp.Default.CSDBI.UpdateGroup(id, n);

                    BindGroup();
                }
            }
        }