Esempio n. 1
0
        private void btnModUser_Click(object sender, EventArgs e)
        {
            if ((dbGridView.Rows.Count == 0) || (dbGridView.SelectedRows.Count == 0))
            {
                return;
            }
            string   sUserCode = this.dbGridView.CurrentRow.Cells["UserCode"].Value.ToString().Trim();
            DataView dv        = new DataView(this.dbGridView.DataSource as DataTable);

            dv.RowFilter = string.Format("UserCode='{0}'", sUserCode);
            if (dv.Count != 1)
            {
                return;
            }

            using (var form = new Man_UserMngr_Editor())
            {
                form.Visible = false;
                form.Editor_Mod(sUserCode, dv);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    this.DataBinding_dbGridView(this.dbGridView.CurrentRow.Index);
                }
            }
        }
Esempio n. 2
0
 private void btnAddUser_Click(object sender, EventArgs e)
 {
     using (var form = new Man_UserMngr_Editor())
     {
         form.Visible = false;
         form.Editor_Add();
         if (form.ShowDialog() == DialogResult.OK)
         {
             this.DataBinding_dbGridView(-1);
         }
     }
 }