コード例 #1
0
ファイル: KadrPostFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void AddPostBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<Post> dlg =
            new Kadr.UI.Common.PropertyGridDialogAdding<Post>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.Posts;
                dlg.BindingSource = postBindingSource;
                dlg.InitializeNewObject = (x) =>
                {
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        Post prev = dlg.SelectedObjects[0] as Post;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Post, PKCategory>(x, "PKCategory", prev.PKCategory, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Post, GlobalPrikaz>(x, "GlobalPrikaz", prev.GlobalPrikaz, null), this);

                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Post, PKCategory>(x, "PKCategory", NullPKCategory.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Post, GlobalPrikaz>(x, "GlobalPrikaz", NullGlobalPrikaz.Instance, null), this);

                    }
                };

                dlg.ShowDialog();
                //RefreshFrame();
            }
        }
コード例 #2
0
        protected override void AddHistoryExecute(object sender)
        {
            Dep currentDepartment = (NodeObject as RootNodeObject).Department;
            using (Kadr.UI.Common.PropertyGridDialogAdding<DepartmentHistory> dlg =
                 new Kadr.UI.Common.PropertyGridDialogAdding<DepartmentHistory>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.DepartmentHistories;
                //dlg.BindingSource = planStaffBindingSource;
                dlg.PrikazButtonVisible = true;
                dlg.oneObjectCreated = true;
                dlg.InitializeNewObject = (x) =>
                {
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, string>(x, "DepartmentName", currentDepartment.DepartmentName, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, string>(x, "DepartmentSmallName", currentDepartment.DepartmentSmallName, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Prikaz>(x, "Prikaz", NullPrikaz.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Dep>(x, "Dep", currentDepartment, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentHistory, Dep>(x, "Dep1", currentDepartment.ManagerDepartment, null), this);

                };

                dlg.UpdateObjectList = () =>
                {
                    dlg.ObjectList = KadrController.Instance.Model.DepartmentHistories;
                };

                dlg.ShowDialog();
                NodeObject.Refresh();
            }
        }
コード例 #3
0
ファイル: KadrPostFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void AddPKCatBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<PKCategory> dlg =
            new Kadr.UI.Common.PropertyGridDialogAdding<PKCategory>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.PKCategories;
                dlg.BindingSource = pKCategoryBindingSource;
                dlg.InitializeNewObject = (x) =>
                {
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        PKCategory prev = dlg.SelectedObjects[0] as PKCategory;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PKCategory, PKGroup>(x, "PKGroup", prev.PKGroup, null), this);

                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PKCategory, PKGroup>(x, "PKGroup", NullPKGroup.Instance, null), this);

                    }
                };

                dlg.ShowDialog();
                KadrController.Instance.DeleteModel();
                //RefreshFrame();
            }
        }
コード例 #4
0
        private void tsbAddDepFund_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<DepartmentFund> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<DepartmentFund>())
            {
                dlg.ObjectList = KadrController.Instance.Model.DepartmentFunds;
                //dlg.BindingSource = departmentFundBindingSource;
                dlg.UseInternalCommandManager = true;
                dlg.PrikazButtonVisible = false;
                dlg.InitializeNewObject = (x) =>
                {
                    if (Department.LastFund != null)
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "PlanFundSum", Department.LastFund.PlanFundSum, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "FactFundSum", Department.LastFund.FactFundSum, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "ExtraordSum", Department.LastFund.ExtraordSum, null), this);
                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "PlanFundSum", 0, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "FactFundSum", 0, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "ExtraordSum", 0, null), this);
                    }
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, DateTime>(x, "DateBegin", DateTime.Today, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, Dep>(x, "Dep", Department, null), this);
                };

                dlg.ShowDialog();
                LoadData();
            }
        }
コード例 #5
0
ファイル: KadrPostFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void AddEmployeeBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<Employee> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<Employee>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.Employees;
                dlg.BindingSource = employeeBindingSource;
                dlg.InitializeNewObject = (x) =>
                {
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Employee, Guid>(x, "GUID", Guid.NewGuid(), null), this);
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        Employee prev = dlg.SelectedObjects[0] as Employee;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Employee, SemPol>(x, "SemPol", prev.SemPol, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Employee, Grazd>(x, "Grazd", prev.Grazd, null), this);

                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Employee, SemPol>(x, "SemPol", NullSemPol.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Employee, Grazd>(x, "Grazd", NullGrazd.Instance, null), this);

                    }
                };

                dlg.ShowDialog();
                //RefreshFrame();
            }
        }
コード例 #6
0
        private void AddPrikazBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<Prikaz> dlg =
                        new Kadr.UI.Common.PropertyGridDialogAdding<Prikaz>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.Prikazs;
                dlg.BindingSource = prikazDecoratorBindingSource;
                dlg.InitializeNewObject = (x) =>
                {
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Prikaz, string>(x, "PrikazName", "Новый приказ", null), this);
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        Prikaz prev = dlg.SelectedObjects[0] as Prikaz;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Prikaz, PrikazType>(x, "PrikazType", prev.PrikazType, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Prikaz, DateTime?>(x, "DateBegin", prev.DateBegin, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Prikaz, DateTime?>(x, "DatePrikaz", prev.DatePrikaz, null), this);
                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Prikaz, PrikazType>(x, "PrikazType", NullPrikazType.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Prikaz, DateTime?>(x, "DateBegin", DateTime.Today, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Prikaz, DateTime?>(x, "DatePrikaz", DateTime.Today, null), this);
                    }
                };

                dlg.ShowDialog();
            }
        }
コード例 #7
0
        private void AddBonusBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<Bonus> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<Bonus>())
            {
                dlg.ObjectList = KadrController.Instance.Model.Bonus;
                dlg.BindingSource = bonusBindingSource;
                dlg.UseInternalCommandManager = true;
                dlg.PrikazButtonVisible = true;
                dlg.InitializeNewObject = (x) =>
                {
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Bonus, FactStaff>(x, "FactStaff", FactStaff, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Bonus, BonusType>(x, "BonusType", NullBonusType.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Bonus, System.Nullable<System.DateTime>>(x, "DateBegin", DateTime.Today, null), this);
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        Bonus prev = dlg.SelectedObjects[0] as Bonus;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Bonus, Prikaz>(x, "Prikaz", prev.Prikaz, null), this);

                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Bonus, Prikaz>(x, "Prikaz", NullPrikaz.Instance, null), this);
                    }
                };

                dlg.UpdateObjectList = () =>
                {
                    dlg.ObjectList = KadrController.Instance.Model.Bonus;
                };

                dlg.ShowDialog();
            }
        }
コード例 #8
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();
            }
        }
コード例 #9
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void AddFactStaffBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<FactStaff> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<FactStaff>())
               {
               dlg.ObjectList = KadrController.Instance.Model.FactStaffs;
               dlg.BindingSource = factStaffBindingSource;
               dlg.UseInternalCommandManager = true;
               dlg.PrikazButtonVisible = true;
               dlg.InitializeNewObject = (x) =>
               {
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, PlanStaff>(x, "PlanStaff", planStaffBindingSource.Current as PlanStaff, null), this);
                   if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                   {
                       FactStaff prev = dlg.SelectedObjects[0] as FactStaff;
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, DateTime?>(x, "DateBegin", prev.DateBegin, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Prikaz>(x, "Prikaz", prev.Prikaz, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Prikaz>(x, "Prikaz1", prev.Prikaz1, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, WorkType>(x, "WorkType", prev.WorkType, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, decimal>(x, "StaffCount", prev.StaffCount, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Employee>(x, "Employee", NullEmployee.Instance, null), this);

                   }
                   else
                   {
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Prikaz>(x, "Prikaz", NullPrikaz.Instance, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, WorkType>(x, "WorkType", NullWorkType.Instance, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Employee>(x, "Employee", NullEmployee.Instance, null), this);
                   }
               };

               dlg.UpdateObjectList = () =>
               {
                   dlg.ObjectList = KadrController.Instance.Model.FactStaffs;
               };

               dlg.ShowDialog();
               LoadFactStaff();
               }
        }
コード例 #10
0
        private void AddSalaryBtn_Click(object sender, EventArgs e)
        {
            if (SalaryObject is PlanStaff)
            {
                using (Kadr.UI.Common.PropertyGridDialogAdding<PlanStaffSalary> dlg =
                                new Kadr.UI.Common.PropertyGridDialogAdding<PlanStaffSalary>())
                {
                    dlg.UseInternalCommandManager = true;
                    dlg.ObjectList = KadrController.Instance.Model.PlanStaffSalaries;
                    dlg.BindingSource = planStaffSalaryBindingSource;
                    dlg.ApplyButtonVisible = false;
                    dlg.InitializeNewObject = (x) =>
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffSalary, PlanStaff>(x, "PlanStaff", salaryObject as PlanStaff, null), this);
                    };
                    dlg.oneObjectCreated = true;

                    dlg.ShowDialog();
                }
            }
            if (SalaryObject is PKCategory)
            {
                using (Kadr.UI.Common.PropertyGridDialogAdding<PKCategorySalary> dlg =
                                new Kadr.UI.Common.PropertyGridDialogAdding<PKCategorySalary>())
                {
                    dlg.UseInternalCommandManager = true;
                    dlg.ObjectList = KadrController.Instance.Model.PKCategorySalaries;
                    dlg.BindingSource = planStaffSalaryBindingSource;
                    dlg.ApplyButtonVisible = false;
                    dlg.InitializeNewObject = (x) =>
                    {

                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PKCategorySalary, PKCategory>(x, "PKCategory", salaryObject as PKCategory, null), this);
                    };
                    dlg.oneObjectCreated = true;

                    dlg.ShowDialog();
                }
            }
        }
コード例 #11
0
        private void AddTimeSheetBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<TimeSheet> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<TimeSheet>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.TimeSheets;
                dlg.BindingSource = timeSheetBindingSource;
                //dlg.PrikazButtonVisible = false;
                dlg.InitializeNewObject = (x) =>
                {
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        TimeSheet prev = dlg.SelectedObjects[0] as TimeSheet;
                        int NextMonthsYear = MonthController.Instance.GetNextMonthsYear(prev.TimeSheetMonth, prev.TimeSheetYear);
                        int NextMonth = MonthController.Instance.GetNextMonth(prev.TimeSheetMonth);

                       // dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<TimeSheet, int>(x, "TimeSheetAllDayCount", DateTime.DaysInMonth(NextMonthsYear, NextMonth), null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<TimeSheet, int>(x, "TimeSheetWorkingDayCount", DateTime.DaysInMonth(NextMonthsYear, NextMonth), null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<TimeSheet, int>(x, "TimeSheetYear", NextMonthsYear, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<TimeSheet, int>(x, "TimeSheetMonth", NextMonth, null), this);
                    }
                    else
                    {
                    //    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<TimeSheet, int>(x, "TimeSheetAllDayCount", DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month), null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<TimeSheet, int>(x, "TimeSheetWorkingDayCount", DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month), null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<TimeSheet, int>(x, "TimeSheetYear", DateTime.Today.Year, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<TimeSheet, int>(x, "TimeSheetMonth", DateTime.Today.Month, null), this);
                    }
                };

                dlg.UpdateObjectList = () =>
                {
                    dlg.ObjectList = KadrController.Instance.Model.TimeSheets;
                };

                dlg.ShowDialog();
            }
        }
コード例 #12
0
        protected override void AddExecute(object sender)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<Department> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<Department>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.Departments;
                dlg.BindingSource = null; ;
                dlg.InitializeNewObject = (x) =>
                {
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Department, Department>(x, "Department1", (NodeObject as RootNodeObject).Department, null), this);
                };

                dlg.ShowDialog();
                (NodeObject as RootNodeObject).Refresh();
            }

            /*using (Kadr.UI.Common.PropertyGridDialog dlg = new Kadr.UI.Common.PropertyGridDialog())
            {
                dlg.UseInternalCommandManager = true;
                Department NewDepartment = Kadr.Controllers.KadrController.Instance.Model.CreateNewDepartment((NodeObject as RootNodeObject).Department, null);
                dlg.SelectedObjects = new object[] { NewDepartment };
                dlg.Text = "Добавление нового отдела";
                dlg.ShowDialog();

                //обновляем дерево, если да
                if (dlg.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    NodeObject.Refresh();
                }
                //удаляем отдел, если отмена
                else
                {
                    (NodeObject as RootNodeObject).Department.Departments.Remove(NewDepartment);
                    KadrController.Instance.Model.Departments.DeleteOnSubmit(NewDepartment);
                }
            }*/
        }
コード例 #13
0
ファイル: KadrPostFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void btnAddBonusType_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<BonusType> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<BonusType>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.BonusTypes;
                dlg.BindingSource = bonusTypeBindingSource;
                dlg.InitializeNewObject = (x) =>
                {
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        BonusType prev = dlg.SelectedObjects[0] as BonusType;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, FinancingSource>(x, "FinancingSource", prev.FinancingSource, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, BonusSuperType>(x, "BonusSuperType", prev.BonusSuperType, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, BonusMeasure>(x, "BonusMeasure", prev.BonusMeasure, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, Boolean>(x, "IsStaffRateable", prev.IsStaffRateable, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, Boolean>(x, "HasEnvironmentBonus", prev.HasEnvironmentBonus, null), this);
                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, FinancingSource>(x, "FinancingSource", NullFinancingSource.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, BonusSuperType>(x, "BonusSuperType", NullBonusSuperType.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, BonusMeasure>(x, "BonusMeasure", NullBonusMeasure.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, Boolean>(x, "IsStaffRateable", true, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusType, Boolean>(x, "HasEnvironmentBonus", true, null), this);

                    }
                };

                dlg.ShowDialog();
                //RefreshFrame();
            }
        }
コード例 #14
0
ファイル: KadrPostFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void AddSalaryBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<PKCategorySalary> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<PKCategorySalary>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.PKCategorySalaries;
                dlg.oneObjectCreated = true;

                //dlg.BindingSource = postDecoratorBindingSource;
                dlg.InitializeNewObject = (x) =>
                {
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PKCategorySalary, PKCategory>(x, "PKCategory", CurrentCategory, null), this);
                };

                dlg.ShowDialog();
                RefreshFrame();
            }
        }
コード例 #15
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void btnSalaryAdd_Click(object sender, EventArgs e)
        {
            PlanStaff CurrentPlanStaff = planStaffBindingSource.Current as Kadr.Data.PlanStaff;
               if (CurrentPlanStaff.IsNull())
               {
               MessageBox.Show("Не выбрана запись штатного расписания!", "АИС \"Штатное расписание\"");
               return;
               }

               using (Kadr.UI.Common.PropertyGridDialogAdding<PlanStaffSalary> dlg =
               new Kadr.UI.Common.PropertyGridDialogAdding<PlanStaffSalary>())
               {
               dlg.UseInternalCommandManager = true;
               dlg.ObjectList = KadrController.Instance.Model.PlanStaffSalaries;
               dlg.ApplyButtonVisible = false;
               dlg.InitializeNewObject = (x) =>
               {
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffSalary, PlanStaff>(x, "PlanStaff", CurrentPlanStaff, null), this);
               };
               dlg.oneObjectCreated = true;

               dlg.ShowDialog();
               RefreshFrame();
               }
        }
コード例 #16
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void btnAddPlanStaff_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<PlanStaff>dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<PlanStaff>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.PlanStaffs;
                dlg.BindingSource = planStaffBindingSource;
                dlg.PrikazButtonVisible = true;
                dlg.InitializeNewObject = (x) =>
                {
                    PlanStaffHistory plStHistory = new PlanStaffHistory();
                    //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Prikaz>(x, "Prikaz", NullPrikaz.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Dep>(x, "Dep", Department, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Post>(x, "Post", NullPost.Instance, null), this);
                    //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, WorkShedule>(x, "WorkShedule", KadrController.Instance.Model.WorkShedules.Where(wShed => wShed.id == 1).FirstOrDefault(), null), this);
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        PlanStaff prev = dlg.SelectedObjects[0] as PlanStaff;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, Prikaz>(plStHistory, "Prikaz", prev.PrikazBegin, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, decimal>(plStHistory, "StaffCount", prev.StaffCount, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, FinancingSource>(plStHistory, "FinancingSource", prev.FinancingSource, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, DateTime>(plStHistory, "DateBegin", prev.DateBegin, null), this);
                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, Prikaz>(plStHistory, "Prikaz", NullPrikaz.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, FinancingSource>(plStHistory, "FinancingSource", NullFinancingSource.Instance, null), this);
                    }
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, PlanStaff>(plStHistory, "PlanStaff", x, null), this);
                };

                dlg.UpdateObjectList = () =>
                {
                    dlg.ObjectList = KadrController.Instance.Model.PlanStaffs;
                };

                dlg.ShowDialog();
                LoadPlanStaff();
            }
        }
コード例 #17
0
        /// <summary>
        /// Добавление надбавки
        /// </summary>
        /// <param name="bonusObject">объект, которому добавляем</param>
        /// <param name="bonusBindingSource">BindingSource</param>
        public void AddBonus(object bonusObject, BindingSource bonusBindingSource)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<Bonus> dlg =
               new Kadr.UI.Common.PropertyGridDialogAdding<Bonus>())
            {
                dlg.ObjectList = KadrController.Instance.Model.Bonus;
                dlg.BindingSource = bonusBindingSource;
                dlg.UseInternalCommandManager = true;
                dlg.PrikazButtonVisible = true;
                dlg.InitializeNewObject = (x) =>
                {
                    //создаем историю надбавки
                    BonusHistory bonusHistory = new BonusHistory();
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, Bonus>(bonusHistory, "Bonus", x, null), this);

                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        Bonus prev = dlg.SelectedObjects[0] as Bonus;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, Prikaz>(bonusHistory, "Prikaz", prev.PrikazBegin, null), this);
                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, Prikaz>(bonusHistory, "Prikaz", NullPrikaz.Instance, null), this);
                    }
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<Bonus, BonusType>(x, "BonusType", NullBonusType.Instance, null), this);

                    if (bonusObject is FactStaff)
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, System.DateTime>(bonusHistory, "DateBegin", DateTime.Today.AddDays(1 - DateTime.Today.Day), null), this);
                    else
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, System.DateTime>(bonusHistory, "DateBegin", DateTime.Today, null), this);

                    //заполнение источника финансирования
                    if (bonusObject is FactStaff)
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, FinancingSource>(bonusHistory, "FinancingSource", (bonusObject as FactStaff).PlanStaff.FinancingSource, null), this);
                    }

                    if (bonusObject is PlanStaff)
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, FinancingSource>(bonusHistory, "FinancingSource", (bonusObject as PlanStaff).FinancingSource, null), this);
                    }

                    if ((bonusObject is Post) || (bonusObject is Employee))
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, FinancingSource>(bonusHistory, "FinancingSource", FinancingSource.DefaultFinancingSource, null), this);
                    }
                    /*if (bonusObject is Post)
                    {
                        BonusPost bonusPost = new BonusPost();
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusPost, Bonus>(bonusPost, "Bonus", prev, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusPost, Post>(bonusPost, "Post", bonusObject as Post, null), this);
                    }

                    if (bonusObject is Employee)
                    {
                        BonusEmployee bonusEmployee = new BonusEmployee();
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusEmployee, Bonus>(bonusEmployee, "Bonus", prev, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusEmployee, Employee>(bonusEmployee, "Employee", bonusObject as Employee, null), this);
                    }*/

                };

                dlg.CreateRelatedObject = (x) =>
                {
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        Bonus prev = dlg.SelectedObjects[0] as Bonus;
                        if (bonusObject is FactStaff)
                        {
                            BonusFactStaff bonusFactStaff = new BonusFactStaff();
                            dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusFactStaff, Bonus>(bonusFactStaff, "Bonus", prev, null), this);
                            dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusFactStaff, FactStaff>(bonusFactStaff, "FactStaff", bonusObject as FactStaff, null), this);
                        }

                        if (bonusObject is PlanStaff)
                        {
                            BonusPlanStaff bonusPlanStaff = new BonusPlanStaff();
                            dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusPlanStaff, Bonus>(bonusPlanStaff, "Bonus", prev, null), this);
                            dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusPlanStaff, PlanStaff>(bonusPlanStaff, "PlanStaff", bonusObject as PlanStaff, null), this);
                            dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusPlanStaff, bool>(bonusPlanStaff, "ForVacancy", true, null), this);
                            dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusPlanStaff, bool>(bonusPlanStaff, "ForEmployee", false, null), this);
                        }

                        if (bonusObject is Post)
                        {
                            BonusPost bonusPost = new BonusPost();
                            dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusPost, Bonus>(bonusPost, "Bonus", prev, null), this);
                            dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusPost, Post>(bonusPost, "Post", bonusObject as Post, null), this);
                        }

                    }

                };

                dlg.UpdateObjectList = () =>
                {
                    dlg.ObjectList = KadrController.Instance.Model.Bonus;
                };

                dlg.ShowDialog();
            }
        }
コード例 #18
0
        private void AddRankBtn_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<EmployeeRank> dlg =
               new Kadr.UI.Common.PropertyGridDialogAdding<EmployeeRank>())
            {
                dlg.ObjectList = KadrController.Instance.Model.EmployeeRanks;
                dlg.BindingSource = employeeRankBindingSource;
                dlg.UseInternalCommandManager = true;
                dlg.InitializeNewObject = (x) =>
                {
                    EducDocument educDocument = new EducDocument();
                    EducDocumentType docType = Kadr.Controllers.KadrController.Instance.Model.EducDocumentTypes.Where(educDocType
                        => educDocType.id == 2).First();
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<EducDocument, EducDocumentType>(educDocument, "EducDocumentType", docType, null), this);

                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<EmployeeRank, Rank>(x, "Rank", NullRank.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<EmployeeRank, Employee>(x, "Employee", Employee, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<EmployeeRank, EducDocument>(x, "EducDocument", educDocument, null), this);

                };

                dlg.UpdateObjectList = () =>
                {
                    dlg.ObjectList = KadrController.Instance.Model.EmployeeRanks;
                };

                dlg.ShowDialog();
            }
        }
コード例 #19
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void btnChangePlanStaff_Click(object sender, EventArgs e)
        {
            PlanStaff currentPlanStaff = planStaffBindingSource.Current as Kadr.Data.PlanStaff;
               if (currentPlanStaff == null)
               {
               MessageBox.Show("Не выбран редактируемый объект.", "АИС \"Штатное расписание\"");
               return;
               }

               using (Kadr.UI.Common.PropertyGridDialogAdding<PlanStaffHistory> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<PlanStaffHistory>())
               {
               dlg.UseInternalCommandManager = true;
               dlg.ObjectList = KadrController.Instance.Model.PlanStaffHistories;
               //dlg.BindingSource = planStaffBindingSource;
               dlg.PrikazButtonVisible = true;
               dlg.oneObjectCreated = true;
               dlg.InitializeNewObject = (x) =>
               {
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, FinancingSource>(x, "FinancingSource", currentPlanStaff.FinancingSource, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, decimal>(x, "StaffCount", currentPlanStaff.StaffCount, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, Prikaz>(x, "Prikaz", NullPrikaz.Instance, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaffHistory, PlanStaff>(x, "PlanStaff", currentPlanStaff, null), this);
               };

               dlg.UpdateObjectList = () =>
               {
                   dlg.ObjectList = KadrController.Instance.Model.PlanStaffHistories;
               };

               dlg.ShowDialog();
               LoadPlanStaff();
               }
        }
コード例 #20
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void AddReplacementBtn_Click(object sender, EventArgs e)
        {
            if (factStaffBindingSource.Current == null)
               {
               MessageBox.Show("Выберите сотрудника, которого нужно заместить.", "АИС Штатное расписание", MessageBoxButtons.OK);
               return;
               }

               if ((factStaffBindingSource.Current as FactStaff).Prikaz!=null)
               {
               MessageBox.Show("Совмещаемый сотрудник уже уволен!", "АИС Штатное расписание", MessageBoxButtons.OK);
               return;
               }

               FactStaff currentFactStaff = factStaffBindingSource.Current as FactStaff;

            using (Kadr.UI.Common.PropertyGridDialogAdding<FactStaffReplacement> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<FactStaffReplacement>())
            {
                dlg.ObjectList = KadrController.Instance.Model.FactStaffReplacements;
                dlg.BindingSource = null;
                dlg.UseInternalCommandManager = true;
                dlg.InitializeNewObject = (x) =>
                {
                    FactStaff factStaff = new FactStaff();
                    FactStaffHistory fcStHistory = new FactStaffHistory();
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, PlanStaff>(factStaff, "PlanStaff", currentFactStaff.PlanStaff, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, WorkType>(fcStHistory, "WorkType", KadrController.Instance.Model.WorkTypes.Where(wtp => wtp.IsReplacement).FirstOrDefault(), null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Employee>(factStaff, "Employee", NullEmployee.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, Prikaz>(fcStHistory, "Prikaz", NullPrikaz.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, bool>(factStaff, "IsReplacement", true, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, FactStaff>(fcStHistory, "FactStaff", factStaff, null), this);

                    //вычисляем то кол-во ставок, которое еще не замещено
                    decimal ReplStaffCount = currentFactStaff.StaffCount;
                    foreach (FactStaffReplacement repl in currentFactStaff.FactStaffReplacements)
                    {
                        if (repl.FactStaff1.Prikaz == null)
                            ReplStaffCount -= repl.FactStaff1.StaffCount;
                    }
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, decimal>(fcStHistory, "StaffCount", ReplStaffCount, null), this);

                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffReplacement, FactStaff>(x, "FactStaff1", factStaff, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffReplacement, FactStaff>(x, "FactStaff", currentFactStaff, null), this);
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        FactStaffReplacement prev = dlg.SelectedObjects[0] as FactStaffReplacement;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffReplacement, FactStaffReplacementReason>(x, "FactStaffReplacementReason", prev.FactStaffReplacementReason, null), this);
                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffReplacement, FactStaffReplacementReason>(x, "FactStaffReplacementReason", NullFactStaffReplacementReason.Instance, null), this);
                    }

                };

                dlg.ShowDialog();
            }
            LoadFactStaff();
        }
コード例 #21
0
        /// <summary>
        /// Создает новое изменение для надбавки
        /// </summary>
        /// <param name="currentBonus">Надбавка</param>
        public void CreateBonusChange(Bonus currentBonus)
        {
            if (currentBonus == null)
            {
                MessageBox.Show("Не выбран редактируемый объект.", "АИС \"Штатное расписание\"");
                return;
            }

            using (Kadr.UI.Common.PropertyGridDialogAdding<BonusHistory> dlg =
                 new Kadr.UI.Common.PropertyGridDialogAdding<BonusHistory>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.BonusHistories;
                //dlg.BindingSource = planStaffBindingSource;
                dlg.PrikazButtonVisible = true;
                dlg.oneObjectCreated = true;
                dlg.InitializeNewObject = (x) =>
                {
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, decimal>(x, "BonusCount", currentBonus.LastBonusCount, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, Prikaz>(x, "Prikaz", NullPrikaz.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, FinancingSource>(x, "FinancingSource", currentBonus.LastFinancingSource, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<BonusHistory, Bonus>(x, "Bonus", currentBonus, null), this);
                };

                dlg.UpdateObjectList = () =>
                {
                    dlg.ObjectList = KadrController.Instance.Model.BonusHistories;
                };

                dlg.ShowDialog();
            }
        }
コード例 #22
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
 private void btnAddTimeNorm_Click(object sender, EventArgs e)
 {
     using (Kadr.UI.Common.PropertyGridDialogAdding<DepartmentTimeNorm> dlg =
         new Kadr.UI.Common.PropertyGridDialogAdding<DepartmentTimeNorm>())
        {
        dlg.UseInternalCommandManager = true;
        dlg.ObjectList = KadrController.Instance.Model.DepartmentTimeNorms;
        dlg.BindingSource = departmentTimeNormBindingSource;
        dlg.PrikazButtonVisible = false;
        dlg.InitializeNewObject = (x) =>
                                      {
                                          dlg.CommandManager.Execute(
                                              new UIX.Commands.GenericPropertyCommand<DepartmentTimeNorm, Dep>(
                                                  x, "Dep", Department, null), this);
                                          dlg.CommandManager.Execute(
                                              new UIX.Commands.GenericPropertyCommand
                                                  <DepartmentTimeNorm, FinancingSource>(x, "FinancingSource", KadrController.Instance.Model.FinancingSources.Where(fs => fs.id == 1).FirstOrDefault()
                                                                                        , null), this);
                                      };
        dlg.UpdateObjectList = () =>
        {
            dlg.ObjectList = KadrController.Instance.Model.DepartmentTimeNorms;
        };
        dlg.ShowDialog();
        LoadTimeNorm();
        }
 }
コード例 #23
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void AddHourFactStaffBtn_Click(object sender, EventArgs e)
        {
            /*KadrController.Instance.AddFactStaff(hourFactStaffBindingSource, null, Department,
                           Kadr.Data.WorkType.hourWorkType);*/

               using (Kadr.UI.Common.PropertyGridDialogAdding<FactStaffHour> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<FactStaffHour>())
               {
               dlg.ObjectList = null;
               dlg.BindingSource = hourFactStaffBindingSource;
               dlg.UseInternalCommandManager = true;
               dlg.PrikazButtonVisible = true;
               dlg.InitializeNewObject = (x) =>
               {

                   FactStaffHistory fcStHistory = new FactStaffHistory();
                    //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Dep>(x, "Dep", (planStaffBindingSource.Current as PlanStaff).Dep, null), this);
                   if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                   {
                       FactStaff prev = (dlg.SelectedObjects[0] as FactStaffHour).FactStaff;
                       //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, DateTime?>(fcStHistory, "DateBegin", prev.LastChange.DateBegin, null), this);
                       //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, Prikaz>(fcStHistory, "Prikaz", prev.PrikazBegin, null), this);
                       //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, WorkType>(fcStHistory, "WorkType", prev.WorkType, null), this);
                       //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, decimal>(fcStHistory, "StaffCount", prev.StaffCount, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, DateTime?>(x.FactStaff, "DateBegin", prev.DateBegin, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Prikaz>(x.FactStaff, "PrikazBegin", prev.PrikazBegin, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, decimal>(x.FactStaff, "StaffCount", prev.StaffCount, null), this);

                   }
                   else
                   {
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, Prikaz>(fcStHistory, "Prikaz", NullPrikaz.Instance, null), this);
                       //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Prikaz>(x, "PrikazBegin", NullPrikaz.Instance, null), this);
                       //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, WorkType>(x, "WorkType", NullWorkType.Instance, null), this);
                    }
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, bool>(x.FactStaff, "IsReplacement", false, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Employee>(x.FactStaff, "Employee", NullEmployee.Instance, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, WorkType>(fcStHistory, "WorkType", Kadr.Data.WorkType.hourWorkType, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Dep>(x.FactStaff, "Dep", Department, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, FundingCenter>(x.FactStaff, "FundingCenter", NullFundingCenter.Instance, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, FinancingSource>(x.FactStaff, "FinancingSource", Kadr.Data.FinancingSource.budgetFinancingSource, null), this);
                   //dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, decimal>(fcStHistory, "SalaryKoeff", 1, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, FactStaff>(fcStHistory, "FactStaff", x.FactStaff, null), this);

               };

               /*dlg.UpdateObjectList = () =>
               {
                   dlg.ObjectList = KadrController.Instance.Model.FactStaffs;
               };*/
               dlg.ShowDialog();
               }
            LoadHourFactStaff();
            //tcDepartment_SelectedIndexChanged(null, null);
        }
コード例 #24
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void btnAddPlanStaff_Click(object sender, EventArgs e)
        {
            using (Kadr.UI.Common.PropertyGridDialogAdding<PlanStaff>dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<PlanStaff>())
            {
                dlg.UseInternalCommandManager = true;
                dlg.ObjectList = KadrController.Instance.Model.PlanStaffs;
                dlg.BindingSource = planStaffBindingSource;
                dlg.PrikazButtonVisible = true;
                dlg.InitializeNewObject = (x) =>
                {
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Department>(x, "Department", Department, null), this);
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        PlanStaff prev = dlg.SelectedObjects[0] as PlanStaff;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Prikaz>(x, "Prikaz", prev.Prikaz, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Prikaz>(x, "Prikaz1", prev.Prikaz1, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Category>(x, "Category", prev.Category, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, decimal>(x, "StaffCount", prev.StaffCount, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, FinancingSource>(x, "FinancingSource", prev.FinancingSource, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Post>(x, "Post", NullPost.Instance, null), this);
                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Prikaz>(x, "Prikaz", NullPrikaz.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Post>(x, "Post", NullPost.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, Category>(x, "Category", NullCategory.Instance, null), this);
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<PlanStaff, FinancingSource>(x, "FinancingSource", NullFinancingSource.Instance, null), this);
                    }
                };

                dlg.UpdateObjectList = () =>
                {
                    dlg.ObjectList = KadrController.Instance.Model.PlanStaffs;
                };

                dlg.ShowDialog();
                LoadPlanStaff();
            }
        }
コード例 #25
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        private void tsbAddDepFund_Click(object sender, EventArgs e)
        {
            if ((departmentBindingSource.Current as Dep) == null)
               {
               MessageBox.Show("Не выбран отдел, для которого запрашивается история бюджета.", "АИС \"Штатное расписание\"");
               return;
               }
               Dep CurrentDep = (departmentBindingSource.Current as Dep);
               using (Kadr.UI.Common.PropertyGridDialogAdding<DepartmentFund> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<DepartmentFund>())
               {
               dlg.ObjectList = KadrController.Instance.Model.DepartmentFunds;
               //dlg.BindingSource = departmentFundBindingSource;
               dlg.UseInternalCommandManager = true;
               dlg.PrikazButtonVisible = false;
               dlg.InitializeNewObject = (x) =>
               {
                   if (CurrentDep.LastFund != null)
                   {
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "PlanFundSum", CurrentDep.LastFund.PlanFundSum, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "FactFundSum", CurrentDep.LastFund.FactFundSum, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "ExtraordSum", CurrentDep.LastFund.ExtraordSum, null), this);
                   }
                   else
                   {
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "PlanFundSum", 0, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "FactFundSum", 0, null), this);
                       dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, decimal>(x, "ExtraordSum", 0, null), this);
                   }
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, DateTime>(x, "DateBegin", DateTime.Today, null), this);
                   dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<DepartmentFund, Dep>(x, "Dep", CurrentDep, null), this);
               };

               dlg.ShowDialog();
               LoadSprav(ObjectStateController.Instance.GetObjectStatesForFilter(tsbDepFilter, null));
               }
        }
コード例 #26
0
ファイル: KadrRootFrame.cs プロジェクト: UGTU/UGTUKadrProject
        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));
               }
        }