Exemplo n.º 1
0
        private void sbtnAddUser_Click(object sender, EventArgs e)
        {
            frmUsersEdit frm = new frmUsersEdit();

            frm.Tag = TagType.添加.ToString();
            frm.ShowDialog(this);
            frm.Dispose();
            string strSql = "select ID,UsersName,UsersPassWord,UsersPower,UsersRemark from tb_SystemUser ";

            gridControl1.DataSource = datalogic.GetDataTable(strSql);
        }
Exemplo n.º 2
0
 private void sbtnAlter_Click(object sender, EventArgs e)
 {
     int[] rows = gridView1.GetSelectedRows(); //选中多行
     if (rows.Length > 0)
     {
         frmUsersEdit frm = new frmUsersEdit();
         frm.Tag       = TagType.修改.ToString();
         frm.strID     = gridView1.GetRowCellDisplayText(rows[0], "ID").ToString();
         frm.strName   = gridView1.GetRowCellDisplayText(rows[0], "UsersName").ToString();
         frm.strPsd    = gridView1.GetRowCellDisplayText(rows[0], "UsersPassWord").ToString();
         frm.strPower  = gridView1.GetRowCellDisplayText(rows[0], "UsersPower").ToString();
         frm.strRemark = gridView1.GetRowCellDisplayText(rows[0], "UsersRemark").ToString();
         frm.ShowDialog(this);
         frm.Dispose();
         string strSql = "select ID,UsersName,UsersPassWord,UsersPower,UsersRemark from tb_SystemUser ";
         gridControl1.DataSource = datalogic.GetDataTable(strSql);
     }
     else
     {
         MessageUtil.ShowTips("无选中的用户");
     }
 }