Esempio n. 1
0
    private void UpdateMgrTaskDeadLine(DateTime dt)
    {
        TY_OA_MgrTaskBFL      TaskBFL    = new TY_OA_MgrTaskBFL();
        TY_OA_MgrTaskDtlBFL   TaskDtlBFL = new TY_OA_MgrTaskDtlBFL();
        TY_OA_MgrTaskDtlModel TaskDtlMdl = TaskDtlBFL.GetTY_OA_MgrTaskDtl(RmsPM.BLL.ConvertRule.ToInt(Request.QueryString["MgrDtlCode"]));
        TY_OA_MgrTaskModel    TaskMdl    = TaskBFL.GetTY_OA_MgrTask(TaskDtlMdl.MgrCodeID);

        TaskMdl.DeadLine = dt;
        TaskBFL.Update(TaskMdl);
    }
Esempio n. 2
0
    private DateTime GetTaskDeadLine()
    {
        //主表要求完成时间为明细中最晚的那个
        DateTime            LastDate   = new DateTime();
        TY_OA_MgrTaskBFL    TaskBFL    = new TY_OA_MgrTaskBFL();
        TY_OA_MgrTaskDtlBFL TaskDtlBFL = new TY_OA_MgrTaskDtlBFL();

        TY_OA_MgrTaskDtlModel        TaskDtlMdl  = TaskDtlBFL.GetTY_OA_MgrTaskDtl(RmsPM.BLL.ConvertRule.ToInt(Request.QueryString["MgrDtlCode"]));
        List <TY_OA_MgrTaskDtlModel> TaskDtlMdls = TaskDtlBFL.GetTY_OA_MgrTaskDtlList(TaskDtlMdl.MgrCodeID);
        TY_OA_MgrTaskModel           TaskMdl     = TaskBFL.GetTY_OA_MgrTask(TaskDtlMdl.MgrCodeID);

        int i = 0;

        foreach (TY_OA_MgrTaskDtlModel SingleTaskMdl in TaskDtlMdls)
        {
            if (0 == i)
            {
                LastDate = SingleTaskMdl.DeadLine;
            }
            else
            {
                System.TimeSpan ts = LastDate.Subtract(SingleTaskMdl.DeadLine);
                if (ts.Days < 0)
                {
                    LastDate = SingleTaskMdl.DeadLine;
                }
            }
            i++;
        }
        if (TaskMdl.DeadLine == LastDate)
        {
            LastDate = DateTime.MinValue;
        }

        return(LastDate);
    }
Esempio n. 3
0
    protected void FormView1_DataBound(object sender, EventArgs e)
    {
        if (FormView1.CurrentMode == FormViewMode.ReadOnly)
        {
            Button btnDelete = ((Button)this.FormView1.Row.FindControl("btnDelete"));
            if (btnDelete != null)
            {
                btnDelete.Attributes["OnClick"] = "javascript:return confirm('确实要删除当前事宜吗?')";
            }


            TY_OA_MgrTaskBFL    Taskbfl    = new TY_OA_MgrTaskBFL();
            TY_OA_MgrTaskDtlBFL Taskdtlbfl = new TY_OA_MgrTaskDtlBFL();
            TY_OA_MgrTaskModel  TaskMl     = Taskbfl.GetTY_OA_MgrTask(RmsPM.BLL.ConvertRule.ToInt(this.MgrCode.Text));

            List <TY_OA_MgrTaskDtlModel> TaskDtlMl = Taskdtlbfl.GetTY_OA_MgrTaskDtlList(RmsPM.BLL.ConvertRule.ToInt(this.MgrCode.Text));
            foreach (TY_OA_MgrTaskDtlModel DtlMl in TaskDtlMl)
            {
                //有审核中或审核完的明细的任务不能删除
                if (DtlMl.State == "2" || DtlMl.State == "3")
                {
                    btnDelete.Visible = false;
                    break;
                }
            }

            string[] Links = TaskMl.ReferLink.Split(';');
            int      i     = -1;

            foreach (string EachLink in Links)
            {
                i++;
                if (!string.IsNullOrEmpty(EachLink))
                {
                    string[] ForLink = EachLink.Split(',');
                    //lblWorkFlowTitle.Text = ShowApplicationHyperLink(entity.GetString("WorkFlowTitle"), string.Format(ud_sHyperLinkFormat, this.OperationCode, this.ProjectCode));
                    ((System.Web.UI.HtmlControls.HtmlTableCell) this.FormView1.Row.FindControl("ReferLinkID")).InnerHtml += "<a href='##' onclick='MonitorgotoDirect(\"" + ForLink[0] + "\",\"" + ForLink[1] + "\",\"" + ForLink[2] + "\",\"" + ForLink[3] + "\",\"" + ForLink[4] + "\"); return false;'>" + RmsPM.BLL.WorkFlowRule.GetWorkFlowCaseTitle(ForLink[0]) + "</a>  ";
                    //((System.Web.UI.HtmlControls.HtmlTableCell)this.FormView1.Row.FindControl("ReferLinkID")).InnerHtml += "<a href='##' onclick='MonitorgotoDirect(" + EachLink + "," + "," + "," + "," + "); return false;'>" + RmsPM.BLL.WorkFlowRule.GetWorkFlowCaseTitle(EachLink) + "</a>&nbsp;";
                }
            }


            Label status = (Label)this.FormView1.Row.FindControl("StatusID");
            bool  isend  = true;
            TY_OA_MgrTaskDtlBFL dtbfl = new TY_OA_MgrTaskDtlBFL();
            if (this.MgrCode.Text != "")
            {
                List <TY_OA_MgrTaskDtlModel> dtlmdLst = dtbfl.GetTY_OA_MgrTaskDtlList(RmsPM.BLL.ConvertRule.ToInt(this.MgrCode.Text));

                foreach (TY_OA_MgrTaskDtlModel mdl in dtlmdLst)
                {
                    //有审核中流程则状态为未完成
                    if (mdl.State == "2")
                    {
                        isend = false;
                        if (status != null)
                        {
                            status.Text = "流程审评中";
                        }
                        break;
                    }
                }
            }
            if (isend && status != null)
            {
                status.Text = "无审核中流程";
            }

            //RmsOA.BFL.TY_OA_MgrTaskDtlBFL bfl = new RmsOA.BFL.TY_OA_MgrTaskDtlBFL();
            //List<TY_OA_MgrTaskDtlModel> Models = bfl.GetTY_OA_MgrTaskDtlList(RmsPM.BLL.ConvertRule.ToInt(this.MgrCode.Text));
            //ViewState["Models"] = Models;
        }
        else
        {
            DataGrid dgDtl = (DataGrid)this.FormView1.Row.FindControl("dgDtl");
            if (dgDtl != null)
            {
                RmsOA.BFL.TY_OA_MgrTaskDtlBFL bfl    = new RmsOA.BFL.TY_OA_MgrTaskDtlBFL();
                List <TY_OA_MgrTaskDtlModel>  Models = bfl.GetTY_OA_MgrTaskDtlList(RmsPM.BLL.ConvertRule.ToInt(this.MgrCode.Text));
                ViewState["Models"] = Models;
                BindDtl(Models);
            }
        }
    }