예제 #1
0
 //添加用户
 private void barBtnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     using (UserInfoForm uf = new UserInfoForm()
     {
         StartPosition = FormStartPosition.CenterScreen, Text = "新增用户信息"
     })
     {
         uf.ShowDialog();
     }
     SearchLocal(1);
     //记录操作日志
     LogUtils.ReviewLogManager.ReviewLog(Properties.Settings.Default.LocalUserName, String.Format("{0}-{1}", this.Text, this.barBtnAdd.Caption));
 }
예제 #2
0
        //修改用户
        private void btnUpdateUser_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.gvUser.PostEditor();

            DataView dv = (DataView)this.gvUser.DataSource;
            string   selectedParamEntityIds = "";
            int      iCheckNum = 0;

            if (dv != null)
            {
                for (int i = 0; i < dv.Count; i++)
                {
                    if ((bool)dv.Table.Rows[i]["check"])
                    {
                        selectedParamEntityIds = dv.Table.Rows[i]["ID"].ToString();
                        iCheckNum++;
                        if (iCheckNum > 1)
                        {
                            XtraMessageBox.Show("请选择一条用户信息!", "提示");
                            return;
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(selectedParamEntityIds))
            {
                using (UserInfoForm uif = new UserInfoForm(selectedParamEntityIds)
                {
                    StartPosition = FormStartPosition.CenterScreen, Text = "修改用户信息"
                })
                {
                    uif.ShowDialog();
                }
                //记录操作日志
                LogUtils.ReviewLogManager.ReviewLog(Properties.Settings.Default.LocalUserName, String.Format("{0}-{1}", this.Text, this.btnUpdate.Caption));
            }
            else
            {
                XtraMessageBox.Show("请选择一条用户信息!", "提示");
            }
        }