コード例 #1
0
        void SetNumMax(CustomGroupBox groupBox)
        {
            DataTable tempTable = new DataTable();

            foreach (Control cl in groupBox.Controls)
            {
                if (cl is NumericUpDown)
                {
                    NumericUpDown numTemp = cl as NumericUpDown;

                    if (numTemp.Tag != null)
                    {
                        if (numTemp.Tag.ToString() == "经济效果")
                        {
                            tempTable       = m_mainService.GetReferenceInfo(dataGridView1.Tag.ToString());
                            tempTable       = DataSetHelper.OrderBy(tempTable, "Score");
                            numTemp.Maximum = Convert.ToInt32(tempTable.Rows[tempTable.Rows.Count - 1]["Score"]);
                        }
                        else
                        {
                            tempTable       = m_mainService.GetReferenceInfo(dataGridView2.Tag.ToString());
                            tempTable       = DataSetHelper.OrderBy(DataSetHelper.Where(tempTable, "ItemName = '" + numTemp.Tag.ToString() + "'"), "Score");
                            numTemp.Maximum = Convert.ToInt32(tempTable.Rows[tempTable.Rows.Count - 1]["Score"]);
                        }
                    }
                }
            }
        }
コード例 #2
0
        void SetInfo()
        {
            IFlowServer serverFlow = FlowControlService.ServerModuleFactory.GetServerModule <IFlowServer>();

            dataGridView1.DataSource = m_mainService.GetReferenceInfo(dataGridView1.Tag.ToString());
            dataGridView2.DataSource = m_mainService.GetReferenceInfo(dataGridView2.Tag.ToString());
            dataGridView3.DataSource = m_mainService.GetReferenceInfo(dataGridView3.Tag.ToString());

            if (m_lnqBillInfo != null)
            {
                lbBillStatus.Text = serverFlow.GetNowBillStatus(m_lnqBillInfo.BillNo);
                txtBillNo.Text    = m_lnqBillInfo.BillNo;

                Flow_FlowInfo flowInfo = serverFlow.GetNowFlowInfo(serverFlow.GetBusinessTypeID(CE_BillTypeEnum.创意提案, null),
                                                                   m_lnqBillInfo.BillNo);
                Flow_FlowData     flowData = serverFlow.GetBusinessOperationInfo(txtBillNo.Text, CE_CommonBillStatus.新建单据.ToString())[0];
                View_HR_Personnel sqrInfo  = UniversalFunction.GetPersonnelInfo(m_lnqBillInfo.Propose);

                txtDept.Text    = sqrInfo.部门名称;
                txtPropose.Text = sqrInfo.姓名;
                txtPropose.Tag  = sqrInfo.工号;

                txtImproveConditions_After.Text  = m_lnqBillInfo.ImproveConditions_After;
                txtImproveConditions_Before.Text = m_lnqBillInfo.ImproveConditions_Before;
                txtTask.Text              = m_lnqBillInfo.Task;
                dtpImproveEndDate.Value   = m_lnqBillInfo.ImproveEndDate;
                dtpImproveStartDate.Value = m_lnqBillInfo.ImproveStartDate;
                cmbExtensionCoverage.Text = m_lnqBillInfo.ExtensionCoverage;

                txtValueEffect.Text = m_lnqBillInfo.ValueEffect.ToString();

                numFGLD_Abstract.Value = m_lnqBillInfo.FGLD_Abstract == null ? 0 : (int)m_lnqBillInfo.FGLD_Abstract;
                numFGLD_Apply.Value    = m_lnqBillInfo.FGLD_Apply == null ? 0 : (int)m_lnqBillInfo.FGLD_Apply;
                numFGLD_Economy.Value  = m_lnqBillInfo.FGLD_Economy == null ? 0 : (int)m_lnqBillInfo.FGLD_Economy;
                numFGLD_Ideas.Value    = m_lnqBillInfo.FGLD_Ideas == null ? 0 : (int)m_lnqBillInfo.FGLD_Ideas;
                numFGLD_Strive.Value   = m_lnqBillInfo.FGLD_Strive == null ? 0 : (int)m_lnqBillInfo.FGLD_Strive;

                numFZR_Abstract.Value = m_lnqBillInfo.FZR_Abstract == null ? 0 : (int)m_lnqBillInfo.FZR_Abstract;
                numFZR_Apply.Value    = m_lnqBillInfo.FZR_Apply == null ? 0 : (int)m_lnqBillInfo.FZR_Apply;
                numFZR_Economy.Value  = m_lnqBillInfo.FZR_Economy == null ? 0 : (int)m_lnqBillInfo.FZR_Economy;
                numFZR_Ideas.Value    = m_lnqBillInfo.FZR_Ideas == null ? 0 : (int)m_lnqBillInfo.FZR_Ideas;
                numFZR_Strive.Value   = m_lnqBillInfo.FZR_Strive == null ? 0 : (int)m_lnqBillInfo.FZR_Strive;

                lbImproveConditions_After_FileNo_Look.Tag  = m_lnqBillInfo.ImproveConditions_After_FileNo;
                lbImproveConditions_Before_FileNo_Look.Tag = m_lnqBillInfo.ImproveConditions_Before_FileNo;

                List <string> lstCheck = m_lnqBillInfo.ProposalType.Split(',').ToList();

                foreach (Control cl in customGroupBox1.Controls)
                {
                    if (cl is CheckBox)
                    {
                        CheckBox cb = cl as CheckBox;

                        if (lstCheck.Contains(cb.Text))
                        {
                            cb.Checked = true;
                        }
                    }
                }

                foreach (Control cl in tabPage1.Controls)
                {
                    if (cl is CustomGroupBox)
                    {
                        CustomGroupBox gb = cl as CustomGroupBox;

                        if (gb.Tag != null && gb.Tag.ToString().Trim().Length > 0)
                        {
                            if (flowInfo.FlowID == Convert.ToInt32(gb.Tag))
                            {
                                gb.Enabled = true;
                            }
                            else
                            {
                                gb.Enabled = false;
                            }
                        }
                    }
                }

                if (lbBillStatus.Text != CE_CommonBillStatus.新建单据.ToString())
                {
                    txtImproveConditions_After.ReadOnly  = true;
                    txtImproveConditions_Before.ReadOnly = true;
                }
            }
            else
            {
                lbBillStatus.Text = CE_CommonBillStatus.新建单据.ToString();

                m_lnqBillInfo = new Business_CWQC_CreativePersentation();

                txtBillNo.Text       = this.FlowInfo_BillNo;
                m_lnqBillInfo.BillNo = txtBillNo.Text;
                View_HR_Personnel sqrInfo = UniversalFunction.GetPersonnelInfo(BasicInfo.LoginID);

                txtDept.Text    = sqrInfo.部门名称;
                txtPropose.Text = sqrInfo.姓名;
                txtPropose.Tag  = sqrInfo.工号;

                if (!isDirectAdd)
                {
                    customGroupBox6.Enabled = false;
                    customGroupBox7.Enabled = false;
                }
            }

            if (lbBillStatus.Text == CE_CommonBillStatus.新建单据.ToString())
            {
                lbImproveConditions_After_FileNo_Up.Visible  = true;
                lbImproveConditions_Before_FileNo_Up.Visible = true;
            }
            else
            {
                lbImproveConditions_After_FileNo_Up.Visible  = false;
                lbImproveConditions_Before_FileNo_Up.Visible = false;
            }

            if (lbImproveConditions_After_FileNo_Look.Tag != null && lbImproveConditions_After_FileNo_Look.Tag.ToString().Trim().Length > 0)
            {
                lbImproveConditions_After_FileNo_Look.Visible = true;
            }
            else
            {
                lbImproveConditions_After_FileNo_Look.Visible = false;
            }

            if (lbImproveConditions_Before_FileNo_Look.Tag != null && lbImproveConditions_Before_FileNo_Look.Tag.ToString().Trim().Length > 0)
            {
                lbImproveConditions_Before_FileNo_Look.Visible = true;
            }
            else
            {
                lbImproveConditions_Before_FileNo_Look.Visible = false;
            }

            FZRSetInfo();
            FGLDSetInfo();
            SetInfo_EffectValue();
        }