예제 #1
0
        private void Bind()
        {
            UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();
            Database mySQL = new Database();

            long FlowID;
            long StepID;

            DataTable dt;

            FlowID = df.GetDocumentFlowID(DocID);
            StepID = df.GetDocumentStepID(DocID);

            cmdPostilFinish.Visible = cmdPostilFinish.Visible && df.GetStepRightToFinish(FlowID, StepID) == 1?true:false;
            ProjectID = Int32.Parse(PID.Value);

            //流程批阅状态并且按照项目流转
            if (FlowState == true && df.IsProject(UserName, DocID))
            {
                if (!Page.IsPostBack)
                {
                    ddlProject.Visible = true;
                    ddlProject.Items.Clear();

                    df.GetProject(UserName, out dt);

                    ddlProject.DataSource     = dt.DefaultView;
                    ddlProject.DataTextField  = "ClassName";
                    ddlProject.DataValueField = "ClassID";
                    ddlProject.DataBind();

                    if (ddlProject.Items.Count > 0)
                    {
                        PID.Value = ddlProject.Items[0].Value;
                    }
                    else
                    {
                        PID.Value = "-1";
                    }
                }
            }
            else
            {
                ddlProject.Visible = false;
            }

            df.GetDocumentInfo(DocID, out dt);

            AddRow(tabDispDocument, "基本信息");

            AddRow(tabDispDocument, "流程:", dt.Rows[0]["flow_name"].ToString());
            AddRow(tabDispDocument, "发送者:", dt.Rows[0]["realname"].ToString());
            AddRow(tabDispDocument, "发送日期:", dt.Rows[0]["doc_added_date"].ToString());
            AddRow(tabDispDocument, "当前步骤:", "<a href='DisplayTacheMember.aspx?DocID=" + DocID.ToString() + "&ReturnPage=" + ReturnPage.ToString() + "'>" + dt.Rows[0]["Step_name"].ToString() + "</a>");

            AddRow(tabDispDocument, "详细表单");

            if (dt.Rows.Count > 0)
            {
                FlowID = Int32.Parse(dt.Rows[0]["flow_id"].ToString());

                HtmlForm PostilDocument = (HtmlForm)this.Page.FindControl("PostilDocument");

                //=============================//
                //			添加正文
                //=============================//
                DataTable dtSheet;
                df.GetStyleDescription(FlowID, 0, out dtSheet);

                for (int i = 0; i < dtSheet.Rows.Count; i++)
                {
                    AddRow(tabDispDocument, dtSheet.Rows[i]["Field_Description"].ToString() + ":", dt.Rows[0][dtSheet.Rows[i]["Field_Name"].ToString()].ToString());
                }

                dtSheet = null;

                //=============================//
                //			添加附件
                //=============================//
                AddAttach(DocID);

                //=============================//
                //			添加批注
                //=============================//
                DataTable dtPostil;
                df.GetDocumentPostil(DocID, out dtPostil);

                if (dtPostil.Rows.Count > 0)
                {
                    AddRow(tabDispDocument, "审批意见");
                    AddPostitleHead(tabDispDocument);

                    for (int i = 0; i < dtPostil.Rows.Count; i++)
                    {
                        AddRow(tabDispDocument, dtPostil.Rows[i]["RealName"].ToString(), dtPostil.Rows[i]["Postil_Date"].ToString(), dtPostil.Rows[i]["Postil_Content"].ToString(), Int32.Parse(dtPostil.Rows[i]["Postil_Type"].ToString()), dtPostil.Rows[i]["FileName"].ToString(), dtPostil.Rows[i]["FileVisualPath"].ToString(), dtPostil.Rows[i]["usedtime"].ToString());
                    }
                }

                dtPostil = null;

                AddProjectControl();
                AddControl(tabDispDocument);
            }
        }
예제 #2
0
        private void Bind()
        {
            UDS.Components.DocumentFlow df	= new UDS.Components.DocumentFlow();
            Database	mySQL				= new Database();

            long			FlowID;
            long			StepID;

            DataTable	dt;

            FlowID	= df.GetDocumentFlowID(DocID);
            StepID	= df.GetDocumentStepID(DocID);

            cmdPostilFinish.Visible  =cmdPostilFinish.Visible&&df.GetStepRightToFinish(FlowID,StepID) == 1?true:false;
            ProjectID = Int32.Parse(PID.Value);

            //��������״̬���Ұ�����Ŀ��ת
            if(FlowState==true&&df.IsProject(UserName,DocID))
            {
                if(!Page.IsPostBack)
                {
                    ddlProject.Visible = true;
                    ddlProject.Items.Clear();

                    df.GetProject(UserName,out dt);

                    ddlProject.DataSource		= dt.DefaultView;
                    ddlProject.DataTextField	= "ClassName";
                    ddlProject.DataValueField	= "ClassID";
                    ddlProject.DataBind();

                    if(ddlProject.Items.Count>0)
                    {
                        PID.Value = ddlProject.Items[0].Value;
                    }
                    else
                        PID.Value = "-1";
                }

            }
            else
            {
                ddlProject.Visible = false;
            }

            df.GetDocumentInfo(DocID,out dt);

            AddRow(tabDispDocument,"������Ϣ");

            AddRow(tabDispDocument,"����:",dt.Rows[0]["flow_name"].ToString());
            AddRow(tabDispDocument,"������:",dt.Rows[0]["realname"].ToString());
            AddRow(tabDispDocument,"��������:",dt.Rows[0]["doc_added_date"].ToString());
            AddRow(tabDispDocument,"��ǰ����:","<a href='DisplayTacheMember.aspx?DocID=" + DocID.ToString() + "&ReturnPage=" + ReturnPage.ToString() + "'>" + dt.Rows[0]["Step_name"].ToString() + "</a>");

            AddRow(tabDispDocument,"��ϸ���");

            if(dt.Rows.Count >0)
            {

                FlowID = Int32.Parse(dt.Rows[0]["flow_id"].ToString());

                HtmlForm PostilDocument   = (HtmlForm)this.Page.FindControl("PostilDocument");

                //=============================//
                //			�������
                //=============================//
                DataTable dtSheet;
                df.GetStyleDescription(FlowID,0,out dtSheet);

                for(int i =0;i<dtSheet.Rows.Count;i++)
                {
                    AddRow(tabDispDocument,dtSheet.Rows[i]["Field_Description"].ToString() + ":",dt.Rows[0][dtSheet.Rows[i]["Field_Name"].ToString()].ToString());
                }

                dtSheet = null;

                //=============================//
                //			��Ӹ���
                //=============================//
                AddAttach(DocID);

                //=============================//
                //			�����ע
                //=============================//
                DataTable dtPostil;
                df.GetDocumentPostil(DocID,out dtPostil);

                if(dtPostil.Rows.Count>0)
                {
                    AddRow(tabDispDocument,"�������");
                    AddPostitleHead(tabDispDocument);

                    for(int i=0;i<dtPostil.Rows.Count;i++)
                    {
                        AddRow(tabDispDocument,dtPostil.Rows[i]["RealName"].ToString(),dtPostil.Rows[i]["Postil_Date"].ToString(),dtPostil.Rows[i]["Postil_Content"].ToString(),Int32.Parse(dtPostil.Rows[i]["Postil_Type"].ToString() ),dtPostil.Rows[i]["FileName"].ToString(),dtPostil.Rows[i]["FileVisualPath"].ToString(),dtPostil.Rows[i]["usedtime"].ToString());
                    }
                }

                dtPostil = null;

                AddProjectControl();
                AddControl(tabDispDocument);

            }
        }