예제 #1
0
        private void btnProjectLeader2_Click(object sender, EventArgs e)
        {
            string assemblyName = Path.Combine(Application.StartupPath, "Worker.dll");
            IEntry instance     = ApplicationDispatcher.GetInstance(assemblyName, new String[] { "" });
            Form   objForm      = instance.GetSearchDialog(null);

            if (objForm.ShowDialog() == DialogResult.OK)
            {
                var objForm1 = objForm as frmBase;
                if (objForm1 != null)
                {
                    foreach (DataGridViewRow item in objForm1.SelectedRows())
                    {
                        WorkerEntity entity = new WorkerEntity();
                        entity.WorkerCode = ConvertUtil.ToString(item.Cells["workerCodeColumn"].Value);
                        entity.WorkerName = ConvertUtil.ToString(item.Cells["workerNameColumn"].Value);

                        if (!string.IsNullOrEmpty(entity.WorkerCode))
                        {
                            this.txtProjectLeader2.Text = entity.WorkerName;
                            this.txtProjectLeader2.Tag  = entity.WorkerCode;
                            break;
                        }
                    }
                }
            }
        }
예제 #2
0
        private void toolStripMenuItemAddStage_Click(object sender, EventArgs e)
        {
            string assemblyName = Path.Combine(Application.StartupPath, "Stage.dll");
            IEntry instance     = ApplicationDispatcher.GetInstance(assemblyName, new String[] { "" });
            Form   objForm      = instance.GetSearchDialog(null);

            if (objForm.ShowDialog() == DialogResult.OK)
            {
                var objForm1 = objForm as frmBase;
                if (objForm1 != null)
                {
                    foreach (DataGridViewRow item in objForm1.SelectedRows())
                    {
                        StageAllocationCalcEntity entity = new StageAllocationCalcEntity();
                        entity.StageCode = ConvertUtil.ToString(item.Cells["stageCodeColumn"].Value);
                        entity.StageName = ConvertUtil.ToString(item.Cells["stageNameColumn"].Value);
                        entity.Percent   = ConvertUtil.ToDouble(item.Cells["percentColumn"].Value);
                        entity.Worth     = stageCalcTabControl1.Worth * entity.Percent / 100;

                        if (!string.IsNullOrEmpty(entity.StageCode))
                        {
                            this.stageCalcTabControl1.AddCalcControl(entity);
                            break;
                        }
                    }
                }
            }
        }
예제 #3
0
        private void MenuItemChanged()
        {
            UserMenuItem menuItem = Core.CoreData[CoreDataType.MenuItemSelected] as UserMenuItem;

            if (!string.IsNullOrEmpty(menuItem.Shell))
            {
                List <DockContent> contents = null;
                if (!_openedContents.ContainsKey(menuItem.Shell))
                {
                    //if not exists
                    string assemblyName = Path.Combine(Application.StartupPath, menuItem.Shell);
                    IEntry instance     = ApplicationDispatcher.GetInstance(assemblyName, new String[] { "" });
                    contents = instance.GetContents(null);
                    _openedContents.Add(menuItem.Shell, contents);
                }

                if (_openedContents.ContainsKey(menuItem.Shell))
                {
                    //if exists
                    contents = _openedContents[menuItem.Shell];
                }

                if (contents != null)
                {
                    foreach (var item in contents)
                    {
                        item.Show(this.dockPanel);
                    }
                }
            }
        }
예제 #4
0
        private void btnProject_Click(object sender, EventArgs e)
        {
            string assemblyName = Path.Combine(Application.StartupPath, "Project.dll");
            IEntry instance     = ApplicationDispatcher.GetInstance(assemblyName, new String[] { "" });
            Form   objForm      = instance.GetSearchDialog(null);

            if (objForm.ShowDialog() == DialogResult.OK)
            {
                var objForm1 = objForm as frmBase;
                if (objForm1 != null)
                {
                    foreach (DataGridViewRow item in objForm1.SelectedRows())
                    {
                        ProjectEntity entity = new ProjectEntity();
                        entity.ProjectCode = ConvertUtil.ToString(item.Cells["projectCodeColumn"].Value);
                        entity.ProjectName = ConvertUtil.ToString(item.Cells["projectNameColumn"].Value);

                        if (!string.IsNullOrEmpty(entity.ProjectCode))
                        {
                            this.txtProjectName.Text = entity.ProjectName;
                            this.txtProjectName.Tag  = entity.ProjectCode;

                            // 查询该项目的计算产值记录
                            ProjectAllocationCalcManager manager = new ProjectAllocationCalcManager();
                            ProjectAllocationCalcEntity  projectAllocationCalcEntity = manager.GetProjectAllocationCalcEntity(OnProgressChanged, entity.ProjectCode);

                            // 如果没有找到的话
                            if (projectAllocationCalcEntity == null)
                            {
                                projectAllocationCalcEntity             = new ProjectAllocationCalcEntity();
                                projectAllocationCalcEntity.ProjectCode = entity.ProjectCode;
                                projectAllocationCalcEntity.ProjectName = entity.ProjectName;
                                projectAllocationCalcEntity.Worth       = 0.0;
                            }
                            this.ProjectAllocationCalcEntity = projectAllocationCalcEntity;
                            break;
                        }
                    }
                }
            }
        }