Inheritance: INull, UIX.Views.IDecorable, UIX.Views.IValidatable
Exemplo n.º 1
0
        protected override void AddExecute(object sender)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<Dep> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<Dep>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.Deps;
                dlg.BindingSource = null; ;
                dlg.InitializeNewObject = (x) =>
                {
                    /*dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Dep, Dep>(x, "Department1", (NodeObject as RootNodeObject).Department, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Department, int>(x, "SeverKoeff", (int)((NodeObject as RootNodeObject).Department.SeverKoeff), null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Department, Int32>(x, "RayonKoeff", (int)((NodeObject as RootNodeObject).Department.RayonKoeff), null), this);
                    */
                    DepartmentHistory depHistory = new DepartmentHistory();
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Prikaz>(depHistory, "Prikaz", NullPrikaz.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Dep>(depHistory, "Dep", x, null), this);

                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Dep>(depHistory, "Dep1", (NodeObject as RootNodeObject).Department, null), this);
                };

                dlg.ShowDialog();
                (NodeObject as RootNodeObject).Refresh();
            }
        }
Exemplo n.º 2
0
 public DepartmentHistoryDecorator(DepartmentHistory departmentHistory)
 {
     this.departmentHistory = departmentHistory;
 }
Exemplo n.º 3
0
        private void btnAddDep_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<Dep> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<Dep>())
               {
               dlg.UseInternalCommandManager = true;
               dlg.ObjectList = KadrController.Instance.Model.Deps;
               dlg.BindingSource = null; ;
               dlg.InitializeNewObject = (x) =>
               {
                   /*dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Dep, Dep>(x, "Department1", (NodeObject as RootNodeObject).Department, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Department, int>(x, "SeverKoeff", (int)((NodeObject as RootNodeObject).Department.SeverKoeff), null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Department, Int32>(x, "RayonKoeff", (int)((NodeObject as RootNodeObject).Department.RayonKoeff), null), this);
                   */
                   DepartmentHistory depHistory = new DepartmentHistory();
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Prikaz>(depHistory, "Prikaz", NullPrikaz.Instance, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Dep>(depHistory, "Dep", x, null), this);

                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Dep>(depHistory, "Dep1", Department, null), this);

                   FundingCenter center = Department.FundingCenter;
                   if (center == null)
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Dep, FundingCenter>(x, "FundingCenter", NullFundingCenter.Instance, null), this);
                   else
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Dep, FundingCenter>(x, "FundingCenter", center, null), this);
               };

               dlg.ShowDialog();
               (this.FrameNodeObject as RootNodeObject).Refresh();
               LoadSprav(ObjectStateController.Instance.GetObjectStatesForFilter(tsbDepFilter, null));
               }
        }