| | |
| | | using DevExpress.Utils.DragDrop; |
| | | using DevExpress.XtraEditors; |
| | | using System.Windows.Controls; |
| | | using Yw; |
| | | using Yw.DAL.Basic; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI; |
| | | |
| | |
| | | { |
| | | InitializeComponent(); |
| | | this.gridView1.SetNormalView(30); |
| | | // this.gridView2.SetNormalView(30); |
| | | this.gridView3.SetNormalView(30); |
| | | this.PageTitle.Caption = "用户管理"; |
| | | this.PageTitle.SvgImageSize = new Size(24, 24); |
| | |
| | | { |
| | | var overlay = this.ShowOverlay(); |
| | | |
| | | var allBindingList = await BLLFactory<Yw.BLL.User>.Instance.GetByCorpID(0); |
| | | var allBindingList = await BLLFactory<Yw.BLL.User>.Instance.GetByCorpID(GlobalParas._GlobalParas.CorpID); |
| | | _allBindingList = new List<UserViewModel>(); |
| | | if (allBindingList != null && allBindingList.Count > 0) |
| | | { |
| | |
| | | //查看 |
| | | private void View() |
| | | { |
| | | /* var vm = GetCurrentViewModel(); |
| | | if (vm == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new ViewAssetsUserDlg(); |
| | | dlg.SetBindingData(vm.Vmo); |
| | | dlg.ShowDialog();*/ |
| | | var vm = GetCurrentViewModel(); |
| | | if (vm == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new ViewUserDlg(); |
| | | dlg.SetBindingData(vm); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //上移 |
| | |
| | | /// </summary> |
| | | private async void gridView3_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) |
| | | { |
| | | var vm = GetCurrentViewModel(); |
| | | var vm = this.gridView3.GetCurrentViewModel(_userLoginAccountViewModelList); |
| | | if (vm == null) |
| | | { |
| | | return; |
| | |
| | | { |
| | | if (XtraMessageBox.Show($"确认重置密码吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) != DialogResult.OK) |
| | | return; |
| | | var loginAccount = await BLLFactory<Yw.BLL.UserLoginAccount>.Instance.GetByUserID(vm.ID); |
| | | var userVm = GetCurrentViewModel(); |
| | | var loginAccount = await BLLFactory<Yw.BLL.UserLoginAccount>.Instance.GetByUserID(userVm.ID); |
| | | if (loginAccount == null || loginAccount.Count == 0) |
| | | return; |
| | | var bll = new Yw.BLL.UserLoginAccount(); |
| | | if (!await bll.ResetSystemLoginPwd(loginAccount.First().ID)) |
| | | if (!await bll.ResetSystemLoginPwd(vm.ID)) |
| | | { |
| | | XtraMessageBox.Show("重置失败!"); |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | private void gridView3_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) |
| | | //使用状态 |
| | | private void BtnEditStatus_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var vm = GetCurrentViewModel(); |
| | | if (vm == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetUseStatusDlg(); |
| | | dlg.SetBindingData((Yw.Model.eUseStatus)vm.UseStatus); |
| | | dlg.ReloadDataEvent += async (status) => |
| | | { |
| | | var bol = await BLLFactory<Yw.BLL.User>.Instance.UpdateUseStatus(vm.ID, (int)status); |
| | | if (bol) |
| | | { |
| | | vm.UseStatus = (eUseStatus)status; |
| | | this.gridView1.RefreshRow(this.gridView1.FocusedRowHandle); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | } |