コード例 #1
0
        public NewOfficeModal()
        {
            InitializeComponent();

            DataContext = new OfficeViewControl();

            officeControl = new OfficeControl();
        }
コード例 #2
0
        private int PopulateOfficeTree(IList <DataRow> table)
        {
            var relatedJurisdictions =
                OfficeControl.CreateRelatedJurisdictionsNodes("/admin/updateElections.aspx",
                                                              "addcandidates", StateCode, CountyCode, LocalKey);

            return(OfficeControl.PopulateOfficeTree(table, OfficeControl.OfficeTree, StateCode,
                                                    false, false, true, AdminPageLevel == AdminPageLevel.State, relatedJurisdictions));
        }
コード例 #3
0
        public OfficeRegisterView()
        {
            InitializeComponent();

            officeControl     = new OfficeControl();
            officeViewControl = new OfficeViewControl();

            DataContext = officeViewControl;
        }
コード例 #4
0
 //将移动或雇佣的员工放入特定办公室 + 确定部门领导者 + CEO技能发动
 public void SelectDep(OfficeControl office)
 {
     if (office.CurrentManager != null && SelectMode < 3)
     {
         office.CurrentManager.InfoDetail.TempDestroyStrategy();
         office.CurrentManager.CurrentOffice = null;
         office.CurrentManager.InfoDetail.Entity.FindWorkPos();
     }
     if (SelectMode == 1)
     {
         //还需要重新计算工资
         Salary += CurrentEmpInfo.CalcSalary();
         office.CurrentManager            = CurrentEmpInfo.emp;
         CurrentEmpInfo.emp.CurrentOffice = office;
         SetInfoPanel();
         CurrentEmpInfo.emp.InfoA.transform.parent = StandbyContent;
         office.SetOfficeStatus();
     }
     else if (SelectMode == 2)
     {
         if (CurrentEmpInfo == CurrentEmpInfo.emp.InfoB)
         {
             CurrentEmpInfo = CurrentEmpInfo.emp.InfoA;
         }
         CurrentEmpInfo.transform.parent = StandbyContent;
         ResetOldAssignment();
         CurrentEmpInfo.emp.CurrentOffice = office;
         office.CurrentManager            = CurrentEmpInfo.emp;
         office.SetOfficeStatus();
         CurrentEmpInfo.DetailInfo.Entity.FindWorkPos();
     }
     //确定部门领导者
     else if (SelectMode == 3)
     {
         if (CurrentDep.CommandingOffice != null)
         {
             CurrentDep.CommandingOffice.ControledDeps.Remove(CurrentDep);
             CurrentDep.CommandingOffice.CheckManage();
         }
         CurrentDep.CommandingOffice = office;
         CurrentDep.Text_Office.text = "由 " + office.Text_OfficeName.text + " 管理";
         office.ControledDeps.Add(CurrentDep);
         office.CheckManage();
     }
     //CEO技能
     else if (SelectMode == 6)
     {
         if (CEOSkillNum == 3)
         {
             office.Progress = 100;
             office.ActiveButton.interactable = true;
             office.Text_Progress.text        = "激活进度:" + office.Progress + "%";
         }
         CEOSkillConfirm();
     }
     DepSelectPanel.SetActive(false);
 }
コード例 #5
0
        private void LoadOfficeControl(string officeKey = null)
        {
            var table = Elections.GetJurisdictionOfficeData(StateCode, CountyCode, LocalCode);

            OfficeControl.PopulateOfficeTree(table, OfficeControl.OfficeTree,
                                             StateCode, false, AdminPageLevel == AdminPageLevel.State,
                                             AdminPageLevel != AdminPageLevel.State,
                                             AdminPageLevel == AdminPageLevel.State);
            if (!string.IsNullOrWhiteSpace(officeKey))
            {
                OfficeControl.OfficeKey = officeKey;
            }
            OfficeControl.Update();
        }
コード例 #6
0
        public EmployeeReportView()
        {
            InitializeComponent();

            employeeControl   = new EmployeeControl();
            companyControl    = new CompanyControl();
            departmentControl = new DepartmentControl();
            officeControl     = new OfficeControl();

            fillGriddEmployee();
            fillCBCompany();
            fillCBDepartment();
            fillCBOffice();
        }
コード例 #7
0
    public OfficeControl CreateOffice(Building b)
    {
        OfficeControl newOffice = Instantiate(OfficePrefab, this.transform);

        newOffice.transform.parent = DepContent;
        newOffice.building         = b;
        newOffice.GC = this;
        newOffice.SetName();
        CurrentOffices.Add(newOffice);

        //创建对应按钮
        newOffice.DS = Instantiate(OfficeSelectButtonPrefab, DepSelectContent);
        newOffice.DS.Text_DepName.text = newOffice.Text_OfficeName.text;
        newOffice.DS.OC = newOffice;
        newOffice.DS.GC = this;

        return(newOffice);
    }
コード例 #8
0
        public DailyPointView()
        {
            InitializeComponent();

            DPDate.SelectedDate = DateTime.Now.Date;

            markingControl        = new MarkingControl();
            companyControl        = new CompanyControl();
            departmentControl     = new DepartmentControl();
            officeControl         = new OfficeControl();
            dailyPointViewControl = new DailyPointViewControl();

            fillGriddDailyMarking();
            fillCBCompany();
            fillCBDepartment();
            fillCBOffice();

            DataContext = dailyPointViewControl;
        }
コード例 #9
0
        public EmployeeRegisterView()
        {
            InitializeComponent();

            employeeControl          = new EmployeeControl();
            companyControl           = new CompanyControl();
            scheduleControl          = new ScheduleControl();
            departmentControl        = new DepartmentControl();
            officeControl            = new OfficeControl();
            resignationReasonControl = new ResignationReasonControl();
            employeeViewControl      = new EmployeeViewControl();

            DataContext = employeeViewControl;

            fillCBCompany();
            fillCBSchedule();
            fillCBDepartment();
            fillCBOffice();
            fillCBRReasons();
            fillImageControl();
        }
コード例 #10
0
        public MarkingCardView()
        {
            InitializeComponent();

            DateTime firstDayOfMonth = new DateTime(DateTime.Now.Date.Year, DateTime.Now.Date.Month, 1);
            DateTime lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1);

            DPStartDate.SelectedDate = firstDayOfMonth;
            DPEndDate.SelectedDate = lastDayOfMonth;

            markingControl = new MarkingControl();
            companyControl = new CompanyControl();
            departmentControl = new DepartmentControl();
            officeControl = new OfficeControl();
            employeeControl = new EmployeeControl();
            markingCardViewControl = new MarkingCardViewControl();

            fillCBCompany();
            fillCBDepartment();
            fillCBOffice();

            DataContext = markingCardViewControl;
        }
コード例 #11
0
            public override void LoadControl()
            {
                OfficeCount = 0;
                Elections.ActualizeElection(Page.GetElectionKey());
                var table = Elections.GetAvailableElectionOfficeData(Page.GetElectionKey(),
                                                                     Page.StateCode, Page.CountyCode, Page.LocalKey);

                if (table.Count == 0)
                {
                    Page.AddOfficesMessage.RemoveCssClass("hidden");
                    Page.AddOfficesControl.AddCssClasses("hidden");
                }
                else
                {
                    Page.AddOfficesMessage.AddCssClasses("hidden");
                    Page.AddOfficesControl.RemoveCssClass("hidden");
                    var relatedJurisdictions =
                        OfficeControl.CreateRelatedJurisdictionsNodes("/admin/updateElections.aspx",
                                                                      "addoffices", Page.StateCode, Page.CountyCode, Page.LocalKey);
                    OfficeCount = OfficeControl.PopulateOfficeTree(table,
                                                                   Page.PlaceHolderAddOfficesTree, Page.StateCode, true, false, true,
                                                                   Page.AdminPageLevel == AdminPageLevel.State, relatedJurisdictions);
                }
            }
コード例 #12
0
        protected void ButtonAddCandidates_OnClick(object sender, EventArgs e)
        {
            switch (AddCandidatesReloading.Value)
            {
            case "reloading":
            {
                // This option just loads the office tree
                AddCandidatesReloading.Value = Empty;
                OfficeControl.OfficeKey      = Empty; // experimental 16/02/16
                SetElectionHeading(HeadingAddCandidates);
                HeadingAddCandidatesOffice.InnerHtml = "No office selected";

                var table =
                    Elections.GetAvailableElectionOfficeData(GetElectionKey(), StateCode,
                                                             CountyCode, LocalKey); //.Rows.Cast<DataRow>().ToList();
                var officeCount = 0;
                if (table.Count == 0)
                {
                    _ManagePoliticiansPanel.Message.RemoveCssClass("hidden");
                    _ManagePoliticiansPanel.Message.InnerText =
                        "No offices were found for this election";
                }
                else
                {
                    _ManagePoliticiansPanel.Message.AddCssClasses("hidden");
                    officeCount = PopulateOfficeTree(table);
                    OfficeControl.ShowSelectOfficePanel = true;
                    OfficeControl.ExpandedNode          = Empty;
                    OfficeControl.Update();
                }
                FeedbackAddCandidates.AddInfo($"{officeCount} offices loaded.");
            }
            break;

            case "loadoffice":
            {
                AddCandidatesReloading.Value        = Empty;
                OfficeControl.ShowSelectOfficePanel = false;
                _ManagePoliticiansPanel.LoadControls();
                SetElectionHeading(HeadingAddCandidates);
                HeadingAddCandidatesOffice.InnerText =
                    Offices.FormatOfficeName(OfficeControl.OfficeKey);
                _ManagePoliticiansPanel.ClearAddNewCandidate(true);
            }
            break;

            case "":
            {
                // normal update
                // We may need to actualize the election,  the electionOffice, and the office
                Elections.ActualizeElection(GetElectionKey());
                OfficeControl.OfficeKey =
                    Offices.ActualizeOffice(OfficeControl.OfficeKey, CountyCode, LocalKey);
                ActualizeElectionOffice(GetElectionKey(), OfficeControl.OfficeKey);

                _ManagePoliticiansPanel.Update();
                _ManagePoliticiansPanel.ClearAddNewCandidate();
                // to update candidate counts...
                var table =
                    Elections.GetAvailableElectionOfficeData(GetElectionKey(), StateCode,
                                                             CountyCode, LocalKey); //.Rows.Cast<DataRow>().ToList();
                // In case counts changed
                PopulateOfficeTree(table);
                OfficeControl.ShowSelectOfficePanel = false;
                OfficeControl.Update();
            }
            break;

            default:
                throw new VoteException(
                          $"Unknown reloading option: '{AddCandidatesReloading.Value}'");
            }
        }
コード例 #13
0
 // Use this for initialization
 void Start()
 {
     Current       = this;
     gameState     = 0;
     pointlessWait = 0;
 }