コード例 #1
0
        private void OnSubordinatesClicked(object sender, EventArgs e)
        {
            UserServices  us = ServicesProvider.GetInstance().GetUserServices();
            BranchService bs = ServicesProvider.GetInstance().GetBranchService();

            User boss = _user;

            Debug.Assert(boss != null, "User is null");
            EditUserForm frm = new EditUserForm
            {
                Boss          = boss
                , AllUsers    = us.FindAllExcept(boss, false)
                , AllBranches = bs.FindAllNonDeleted()
            };

            if (DialogResult.OK != frm.ShowDialog())
            {
                return;
            }

            boss.ClearSubordinates();
            boss.AddSubordinates(frm.NewSubordinates());
            boss.ClearBranches();
            boss.AddBranches(frm.NewBranches());
            us.Save(boss);
            RefreshUser(boss);

            if (boss.Id != User.CurrentUser.Id)
            {
                return;
            }

//            ((MainView)MdiParent).ReloadAlerts();
        }
コード例 #2
0
ファイル: UserForm.cs プロジェクト: TalasZh/opencbs
        private void OnSubordinatesClicked(object sender, EventArgs e)
        {
            UserServices us = ServicesProvider.GetInstance().GetUserServices();
            BranchService bs = ServicesProvider.GetInstance().GetBranchService();

            User boss = _user;
            Debug.Assert(boss != null, "User is null");
            EditUserForm frm = new EditUserForm
            {
                Boss = boss
                , AllUsers = us.FindAllExcept(boss, true)
                , AllBranches = bs.FindAllNonDeleted()
            };

            if (DialogResult.OK != frm.ShowDialog()) return;

            boss.ClearSubordinates();
            boss.AddSubordinates(frm.NewSubordinates());
            boss.ClearBranches();
            boss.AddBranches(frm.NewBranches());
            us.Save(boss);
            RefreshUser(boss);

            if (boss.Id != User.CurrentUser.Id) return;

            ((LotrasmicMainWindowForm)MdiParent).ReloadAlerts();
        }