示例#1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (View.PersonManageForms.RightfulPersonAddEdit f = new View.PersonManageForms.RightfulPersonAddEdit())
     {
         if (f.ShowDialog() == DialogResult.OK)
         {
             RefreshData();
             var query = radGridView.Rows.Where(t => t.Cells["ID"] == f.Tag);
             if (query.Count() == 1)
             {
                 query.Single().IsCurrent = true;
             }
         }
     }
 }
示例#2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (radGridView.SelectedRows.Count != 1)
            {
                return;
            }
            int originalID = int.Parse(radGridView.SelectedRows[0].Cells["ID"].Value.ToString());

            using (View.PersonManageForms.RightfulPersonAddEdit f = new View.PersonManageForms.RightfulPersonAddEdit(originalID))
            {
                f.ShowDialog();
                RefreshData();
                var query = radGridView.Rows.Where(t => t.Cells["ID"] == f.Tag);
                if (query.Count() == 1)
                {
                    query.Single().IsCurrent = true;
                }
            }
        }