Exemple #1
0
        private void btn_newUser_Click(object sender, EventArgs e)
        {
            FrmUserNew frmUserNew = new FrmUserNew();

            frmUserNew.StartPosition = FormStartPosition.CenterScreen;
            frmUserNew.ShowDialog();
            LoadUserInfo();
        }
Exemple #2
0
        private void btn_modifyUser_Click(object sender, EventArgs e)
        {
            FrmUserNew      frmUserNew = new FrmUserNew();
            DataGridViewRow item       = dataGridView.CurrentRow;

            if (item == null)
            {
                return;
            }
            frmUserNew.User.UserName    = item.Cells[0].Value.ToString();
            frmUserNew.User.PassWord    = item.Cells[1].Value.ToString();
            frmUserNew.User.Authority   = (EnumUserAutho)(Enum.Parse(typeof(EnumUserAutho), item.Cells[2].Value.ToString()));
            frmUserNew.User.Description = item.Cells[5].Value.ToString();
            frmUserNew.User.Contact     = item.Cells[4].Value.ToString();
            frmUserNew.User.TrueName    = item.Cells[3].Value.ToString();
            frmUserNew.User.UserID      = (int)item.Tag;
            frmUserNew.StartPosition    = FormStartPosition.CenterScreen;
            frmUserNew.ShowDialog();
            LoadUserInfo();
        }