Exemple #1
0
        public List <Bus_FocalWork_MonthlyProgress_Content> GetList_ProgressContent(Bus_FocalWork_MonthlyProgress billInfo)
        {
            List <Bus_FocalWork_MonthlyProgress_Content> result = new List <Bus_FocalWork_MonthlyProgress_Content>();

            DateTime tempDate =
                Convert.ToDateTime(billInfo.YearMonth.Substring(0, 4) + "-"
                                   + billInfo.YearMonth.Substring(4, 2) + "-1").AddMonths(1).AddDays(-1);

            string strSql = "select * from Bus_FocalWork where DutyUser = '******' and StartDate <= '" + tempDate.ToShortDateString()
                            + "' and TaskStatus not in ('已完成','终止')";
            DataTable tempTable = GlobalObject.DatabaseServer.QueryInfo(strSql);

            foreach (DataRow dr in tempTable.Rows)
            {
                Bus_FocalWork_MonthlyProgress_Content tempContent = new Bus_FocalWork_MonthlyProgress_Content();

                tempContent.BillNo      = billInfo.BillNo;
                tempContent.F_Id        = Guid.NewGuid().ToString();
                tempContent.FocalWorkId = dr["F_Id"].ToString();

                result.Add(tempContent);
            }

            return(result);
        }
Exemple #2
0
        void lbKeyPoint_Click(object sender, EventArgs e)
        {
            if (((Label)sender).Tag == null)
            {
                rbDelay.Checked            = false;
                rbNo.Checked               = false;
                rbYes.Checked              = false;
                txtProgressContent.Text    = "";
                txtNextPlan.Text           = "";
                btnConnectKeyPoint.Tag     = null;
                btnConnectKeyPoint.Visible = false;
                return;
            }

            Bus_FocalWork_MonthlyProgress_Content content = ((Label)sender).Tag as Bus_FocalWork_MonthlyProgress_Content;

            txtProgressContent.Text = content.ProgressContent;
            txtNextPlan.Text        = content.NextPlan;

            List <Bus_FocalWork_MonthlyProgress_KeyPoint> lstKeyTemp = (from a in _Service_FocalWork.GetList_ProgressKeyPoint(content.BillNo)
                                                                        where a.FocalWorkId == content.FocalWorkId
                                                                        select a).ToList();

            btnConnectKeyPoint.Tag = lstKeyTemp;
            if (lstKeyTemp == null || lstKeyTemp.Count() == 0)
            {
                btnConnectKeyPoint.Visible = false;
            }
            else
            {
                btnConnectKeyPoint.Visible = true;
            }

            if (!GeneralFunction.IsNullOrEmpty(content.Evaluate))
            {
                switch (content.Evaluate)
                {
                case "已完成":
                    rbYes.Checked = true;
                    break;

                case "未完成":
                    rbNo.Checked = true;
                    break;

                case "延期":
                    rbDelay.Checked = true;
                    break;

                default:
                    rbDelay.Checked = false;
                    rbNo.Checked    = false;
                    rbYes.Checked   = false;
                    break;
                }
            }
        }
Exemple #3
0
        private void 重点工作详细信息_Load(object sender, EventArgs e)
        {
            if (_Lnq_FocalWork == null)
            {
                return;
            }

            labelTitle.Text = _Lnq_FocalWork.TaskName;

            txtTaskDescription.Text = _Lnq_FocalWork.TaskDescription;
            txtExpectedGoal.Text    = _Lnq_FocalWork.ExpectedGoal;
            dtpStartDate.Value      = (DateTime)_Lnq_FocalWork.StartDate;
            dtpEndDate.Value        = (DateTime)_Lnq_FocalWork.EndDate;
            txtDutyUser.Text        = UniversalFunction.GetPersonnelInfo(_Lnq_FocalWork.DutyUser).姓名;

            lbStatus.Text = _Lnq_FocalWork.TaskStatus;

            if (lbStatus.Text == "延期")
            {
                lbStatus.ForeColor = Color.Yellow;
            }
            else if (lbStatus.Text == "待启动")
            {
                lbStatus.ForeColor = Color.Black;
            }
            else if (lbStatus.Text == "已完成")
            {
                lbStatus.ForeColor = Color.Black;
            }

            DateTime startDate = Convert.ToDateTime(dtpStartDate.Value.Year.ToString() + "-" + dtpStartDate.Value.Month.ToString("D2") + "-1");
            DateTime endDate   = lbStatus.Text == "已完成" ? _Service_FocalWork.GetEndDate(_Lnq_FocalWork.F_Id) :
                                 Convert.ToDateTime(ServerTime.Time.Year.ToString() + "-" + ServerTime.Time.Month.ToString("D2") + "-1");

            while (startDate <= endDate)
            {
                Label lbKeyPoint = new Label();
                lbKeyPoint.AutoSize = true;
                lbKeyPoint.Font     = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));

                Bus_FocalWork_MonthlyProgress_Content content = _Service_FocalWork.GetSingle_Content(_Lnq_FocalWork.F_Id,
                                                                                                     startDate.Year.ToString() + startDate.Month.ToString("D2"));

                lbKeyPoint.Tag  = content;
                lbKeyPoint.Text = startDate.Year.ToString() + "年" + startDate.Month.ToString("D2") + "月\r\n    ";

                if (content == null || GeneralFunction.IsNullOrEmpty(content.Evaluate))
                {
                    lbKeyPoint.Text += "?";
                }
                else
                {
                    switch (content.Evaluate)
                    {
                    case "已完成":
                        lbKeyPoint.Text     += "○";
                        lbKeyPoint.BackColor = Color.Green;
                        break;

                    case "未完成":
                        lbKeyPoint.Text     += "×";
                        lbKeyPoint.BackColor = Color.Red;
                        break;

                    case "延期":
                        lbKeyPoint.Text     += "△";
                        lbKeyPoint.BackColor = Color.Yellow;
                        break;

                    default:
                        break;
                    }
                }

                lbKeyPoint.Click += new EventHandler(lbKeyPoint_Click);

                flowLayoutPanel1.Controls.Add(lbKeyPoint);

                if (startDate < endDate)
                {
                    Label lbConnect = new Label();
                    lbConnect.AutoSize = true;
                    lbConnect.Text     = "——→";
                    lbConnect.Font     = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    flowLayoutPanel1.Controls.Add(lbConnect);
                }

                startDate = startDate.AddMonths(1);
            }

            if (!GeneralFunction.IsNullOrEmpty(_YearMonth))
            {
                gbTaskName.Visible = false;

                foreach (Control cl in flowLayoutPanel1.Controls)
                {
                    Label lb = cl as Label;

                    if (lb.Text.Length > 8)
                    {
                        if (lb.Text.Substring(0, 4) == _YearMonth.Substring(0, 4) &&
                            lb.Text.Substring(5, 2) == _YearMonth.Substring(4, 2))
                        {
                            lbKeyPoint_Click(lb, null);
                            break;
                        }
                    }
                }
            }
        }
Exemple #4
0
        private bool 重点工作明细_PanelGetDataInfo(CE_FlowOperationType flowOperationType)
        {
            try
            {
                foreach (Control cl in flowLayoutPanel1.Controls)
                {
                    if (cl is RadioButton)
                    {
                        if (!((RadioButton)cl).Checked)
                        {
                            continue;
                        }

                        RadioButton rb = cl as RadioButton;

                        Bus_FocalWork_MonthlyProgress_Content content = rb.Tag as Bus_FocalWork_MonthlyProgress_Content;

                        content.ProgressContent = txtProgressContent.Text;
                        content.NextPlan        = txtNextPlan.Text;

                        if (rbYes.Checked)
                        {
                            content.Evaluate = "已完成";
                        }
                        else if (rbNo.Checked)
                        {
                            content.Evaluate = "未完成";
                        }
                        else if (rbDelay.Checked)
                        {
                            content.Evaluate = "延期";
                        }

                        break;
                    }
                }

                if (flowOperationType == CE_FlowOperationType.提交)
                {
                    foreach (Bus_FocalWork_MonthlyProgress_Content content in _List_Content)
                    {
                        Bus_FocalWork focalWork = _Service_FocalWork.GetSingle_FocalWork(content.FocalWorkId);
                        if (GeneralFunction.IsNullOrEmpty(content.Evaluate))
                        {
                            throw new Exception("【" + focalWork.TaskName + "】,未进行评价");
                        }

                        if (GeneralFunction.IsNullOrEmpty(content.NextPlan))
                        {
                            throw new Exception("【" + focalWork.TaskName + "】,未填写【下月计划】");
                        }

                        if (GeneralFunction.IsNullOrEmpty(content.ProgressContent))
                        {
                            throw new Exception("【" + focalWork.TaskName + "】,未填写【工作进展】");
                        }

                        List <Bus_FocalWork_MonthlyProgress_KeyPoint> lstTempKey = (from a in _List_KeyPoint
                                                                                    where a.BillNo == _Lnq_BillInfo.BillNo &&
                                                                                    a.FocalWorkId == content.FocalWorkId
                                                                                    select a).ToList();

                        foreach (Bus_FocalWork_MonthlyProgress_KeyPoint keyPoint in lstTempKey)
                        {
                            if (GeneralFunction.IsNullOrEmpty(keyPoint.Evaluate))
                            {
                                Bus_FocalWork_KeyPoint tempKey = _Service_FocalWork.GetSingle_KeyPoint(keyPoint.KeyPointId);
                                throw new Exception("【" + focalWork.TaskName + "】中的关键节点【" + tempKey.KeyPointName + "】,未进行评价");
                            }
                        }
                    }
                }

                this.FlowInfo_BillNo = _Lnq_BillInfo.BillNo;
                this.ResultInfo      = _Lnq_BillInfo;

                this.ResultList = new List <object>();
                this.ResultList.Add(flowOperationType);
                this.ResultList.Add(_List_Content);
                this.ResultList.Add(_List_KeyPoint);

                return(true);
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
                return(false);
            }
        }
Exemple #5
0
        void rb_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton rb = sender as RadioButton;

            if (rb.Checked)
            {
                Bus_FocalWork_MonthlyProgress_Content content = rb.Tag as Bus_FocalWork_MonthlyProgress_Content;
                Bus_FocalWork focalWork = _Service_FocalWork.GetSingle_FocalWork(content.FocalWorkId);

                txtExpectedGoal.Text    = focalWork.ExpectedGoal;
                txtTaskDescription.Text = focalWork.TaskDescription;
                txtDutyUser.Text        = UniversalFunction.GetPersonnelInfo(focalWork.DutyUser).姓名;
                dtpEndDate.Value        = (DateTime)focalWork.EndDate;
                dtpStartDate.Value      = (DateTime)focalWork.StartDate;
                btnKeyPoint.Tag         = focalWork.F_Id;

                txtProgressContent.Text = content.ProgressContent;
                txtNextPlan.Text        = content.NextPlan;

                List <Bus_FocalWork_MonthlyProgress_KeyPoint> lstKey = (from a in _List_KeyPoint
                                                                        where a.FocalWorkId == content.FocalWorkId
                                                                        select a).ToList();

                btnSetKeyPoint.Tag = lstKey;

                if (lstKey == null || lstKey.Count() == 0)
                {
                    btnSetKeyPoint.Visible = false;
                }
                else
                {
                    btnSetKeyPoint.Visible = true;
                }

                if (!GeneralFunction.IsNullOrEmpty(content.Evaluate))
                {
                    switch (content.Evaluate)
                    {
                    case "已完成":
                        rbYes.Checked = true;
                        break;

                    case "未完成":
                        rbNo.Checked = true;
                        break;

                    case "延期":
                        rbDelay.Checked = true;
                        break;

                    default:
                        rbDelay.Checked = false;
                        rbNo.Checked    = false;
                        rbYes.Checked   = false;
                        break;
                    }
                }
                else
                {
                    rbDelay.Checked = false;
                    rbNo.Checked    = false;
                    rbYes.Checked   = false;
                }
            }
            else
            {
                Bus_FocalWork_MonthlyProgress_Content content = rb.Tag as Bus_FocalWork_MonthlyProgress_Content;

                content.ProgressContent = txtProgressContent.Text;
                content.NextPlan        = txtNextPlan.Text;

                if (rbYes.Checked)
                {
                    content.Evaluate = "已完成";
                }
                else if (rbNo.Checked)
                {
                    content.Evaluate = "未完成";
                }
                else if (rbDelay.Checked)
                {
                    content.Evaluate = "延期";
                }
            }
        }