コード例 #1
0
 public void EditButtonClick(object sender, EventArgs e)
 {
     AddEditSotrudnikForm aesf = new AddEditSotrudnikForm();
     aesf.SetFormState(anvlib.Enums.AddEditFormState.Edit);
     var ui = (listControl as ListBox).SelectedValue as UserInfo;
     aesf.EditableItem = ui;
     aesf.DisplayEditableItem(ui);
     var dr = aesf.ShowDialog();
     if (dr == DialogResult.OK)
     {
         sqlmgr.Reconnect();
         sqlmgr.UpdateUser(ui.Id, /*ui.IsAdmin,*/ aesf.GetSelectedRoleId());
         sqlmgr.Disconnect();
         FillList();
     }
 }
コード例 #2
0
 public void AddButtonClick(object sender, EventArgs e)
 {
     AddEditSotrudnikForm aesf = new AddEditSotrudnikForm();
     aesf.SetFormState(anvlib.Enums.AddEditFormState.Add);
     UserInfo ui = new UserInfo();
     aesf.EditableItem = ui;
     var dr = aesf.ShowDialog();
     if (dr == DialogResult.OK)
     {
         sqlmgr.Reconnect();
         ui.Role = (RoleType)aesf.GetSelectedRoleId();
         sqlmgr.CreateUser(ui);
         sqlmgr.Disconnect();
         FillList();
     }
 }