Пример #1
0
        private void InitControl(long DocID)
        {
            UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();

            SqlDataReader dr;             //存放人物的数据
            DataTable     dt = null;



            df.GetStyleDescription(FlowID, 0, out dr);
            if (DocID > 0)
            {
                df.GetDocumentInfo(DocID, out dt);
            }

            ht.Style["Left"] = "1px";
            ht.Style["Top"]  = "1px";

            al.Clear();
            AddHeadlin();

            while (dr.Read())
            {
                TextBox txt = new TextBox();

                txt.ID = "txt" + dr["Field_Name"].ToString();
                al.Add(dr["Field_Name"].ToString());

                if (dr["MultiLine"].ToString() != "False")
                {
                    txt.TextMode = TextBoxMode.MultiLine;
                }
                txt.Height   = Int32.Parse(dr["Height"].ToString());
                txt.Width    = Int32.Parse(dr["Width"].ToString());
                txt.CssClass = "Input3";

                if (DocID > 0)
                {
                    if (dt.Rows.Count > 0)
                    {
                        txt.Text = dt.Rows[0][dr["Field_Name"].ToString()].ToString();
                    }
                    else
                    {
                        txt.Text = "不存在";
                    }
                }
                else
                {
                    txt.Text = "";
                }


                TableRow  tr = new TableRow();
                TableCell tl = new TableCell();
                TableCell tc = new TableCell();
                Literal   lt = new Literal();

                lt.Text = dr["Example"].ToString();

                tc.Controls.Add(txt);
                if (FieldNum == 0 || dr["judged"].ToString() == "True")
                {
                    RequiredFieldValidator rfv = new RequiredFieldValidator();
                    rfv.ControlToValidate  = txt.ID;
                    rfv.ErrorMessage       = "(*)";
                    rfv.Display            = ValidatorDisplay.Dynamic;
                    rfv.EnableClientScript = true;

                    tc.Controls.Add(rfv);
                }
                if (dr["judged"].ToString() == "True")
                {
                    RegularExpressionValidator rev = new RegularExpressionValidator();

                    rev.ErrorMessage         = "填写数字";
                    rev.ControlToValidate    = txt.ID;
                    rev.ValidationExpression = @"\d+";

                    rev.Display = ValidatorDisplay.Dynamic;

                    tc.Controls.Add(rev);
                }


                tc.Controls.Add(lt);

                tl.Text = dr["Field_Description"].ToString() + ":";

                if (dr["MultiLine"].ToString() != "False")
                {
                    tl.VerticalAlign = VerticalAlign.Top;
                }
                else
                {
                    tl.VerticalAlign = VerticalAlign.Middle;
                }
                tl.HorizontalAlign = HorizontalAlign.Right;


                tr.Cells.Add(tl);
                tr.Cells.Add(tc);
                ht.Rows.Add(tr);

                tc = null;
                tl = null;
                tr = null;

                FieldNum += 1;
            }
            dr.Close();
            dr = null;

            if (DocID > 0)
            {
                AddAttach(DocID);
            }

            AddAttachControl();
            AddProjectControl();
            AddControl();

            //=============================//
            //			添加批注
            //=============================//
            DataTable dtPostil;

            df.GetDocumentPostil(DocID, out dtPostil);

            if (dtPostil != null)
            {
                if (dtPostil.Rows.Count > 0)
                {
                    Table tb = new Table();
                    tb.CssClass = "GbText";
                    tb.Width    = Unit.Percentage(98);
                    AddRow(tb, "审批意见");
                    AddPostitleHead(tb);

                    for (int i = 0; i < dtPostil.Rows.Count; i++)
                    {
                        AddRow(tb, 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());
                    }
                    AddTable(ht, tb);
                }
            }
            dtPostil = null;
        }
Пример #2
0
        private void InitControl(long DocID)
        {
            UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();

            SqlDataReader dr; //������������
            DataTable dt	= null;

            df.GetStyleDescription(FlowID,0,out dr);
            if(DocID>0)
                df.GetDocumentInfo(DocID,out dt);

            ht.Style["Left"]="1px";
            ht.Style["Top"]="1px";

            al.Clear();
            AddHeadlin();

            while(dr.Read())
            {
                TextBox txt					= new TextBox();

                txt.ID ="txt" + dr["Field_Name"].ToString();
                al.Add(dr["Field_Name"].ToString());

                if(dr["MultiLine"].ToString()!="False")
                {
                    txt.TextMode = TextBoxMode.MultiLine;
                }
                txt.Height		= Int32.Parse( dr["Height"].ToString());
                txt.Width		= Int32.Parse( dr["Width"].ToString());
                txt.CssClass	= "Input3";

                if(DocID>0)
                {
                    if(dt.Rows.Count >0)
                        txt.Text = dt.Rows[0][dr["Field_Name"].ToString()].ToString();
                    else
                        txt.Text ="������";
                }
                else
                    txt.Text ="";

                TableRow  tr	= new TableRow();
                TableCell tl	= new TableCell();
                TableCell tc	= new TableCell();
                Literal lt		= new Literal();

                lt.Text			= dr["Example"].ToString();

                tc.Controls.Add(txt);
                if(FieldNum==0||dr["judged"].ToString()=="True")
                {
                    RequiredFieldValidator  rfv		= new RequiredFieldValidator();
                    rfv.ControlToValidate			= txt.ID;
                    rfv.ErrorMessage				= "(*)";
                    rfv.Display						= ValidatorDisplay.Dynamic;
                    rfv.EnableClientScript			= true;

                    tc.Controls.Add(rfv);
                }
                if(dr["judged"].ToString()=="True")
                {

                    RegularExpressionValidator rev	= new RegularExpressionValidator();

                    rev.ErrorMessage				= "�����";
                    rev.ControlToValidate			= txt.ID;
                    rev.ValidationExpression		= @"\d+";

                    rev.Display						= ValidatorDisplay.Dynamic;

                    tc.Controls.Add(rev);

                }

                tc.Controls.Add(lt);

                tl.Text					= dr["Field_Description"].ToString() + ":";

                if(dr["MultiLine"].ToString()!="False")
                    tl.VerticalAlign	= VerticalAlign.Top;
                else
                    tl.VerticalAlign	= VerticalAlign.Middle;
                tl.HorizontalAlign		= HorizontalAlign.Right;

                tr.Cells.Add(tl);
                tr.Cells.Add(tc);
                ht.Rows.Add(tr);

                tc = null;
                tl = null;
                tr = null;

                FieldNum +=1;

            }
            dr.Close();
            dr = null;

            if(DocID>0)
                AddAttach(DocID);

            AddAttachControl();
            AddProjectControl();
            AddControl();

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

            if(dtPostil!=null)
            {
                if(dtPostil.Rows.Count>0)
                {
                    Table tb	= new Table();
                    tb.CssClass ="GbText";
                    tb.Width = Unit.Percentage(98);
                    AddRow(tb,"�������");
                    AddPostitleHead(tb);

                    for(int i=0;i<dtPostil.Rows.Count;i++)
                    {
                        AddRow(tb,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());
                    }
                    AddTable(ht,tb);
                }
            }
            dtPostil = null;
        }
Пример #3
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);

            }
        }
Пример #4
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);
            }
        }
Пример #5
0
        private void InitControl(long DocID)
        {
            UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();

            SqlDataReader dr = null; //������������
            DataTable dt = null;

            try
            {

                df.GetStyleDescription(FlowID, 0, out dr);
                if (DocID > 0)
                    df.GetDocumentInfo(DocID, out dt);

                ht.Style["Left"] = "1px";
                ht.Style["Top"] = "1px";

                al.Clear();
                AddHeadlin();

                while (dr.Read())
                {
                    TextBox txt = new TextBox();

                    txt.ID = "txt" + dr["Field_Name"].ToString();
                    al.Add(dr["Field_Name"].ToString());

                    if (dr["MultiLine"].ToString() != "False")
                    {
                        txt.TextMode = TextBoxMode.MultiLine;
                    }
                    if ("d" == dr["Field_Type"].ToString())
                    {
                        txt.Attributes.Add("onfocus", "setday(this);");
                        txt.AutoPostBack = true;
                        // txt.Visible = false;
                        txt.ReadOnly = true;

                    }
                    txt.Height = Int32.Parse(dr["Height"].ToString());
                    txt.Width = Int32.Parse(dr["Width"].ToString());
                    txt.CssClass = "Input3";

                    if (DocID > 0)
                    {
                        if (dt.Rows.Count > 0)
                        {
                            txt.Text = dt.Rows[0][dr["Field_Name"].ToString()].ToString();
                        }
                        else
                        {
                            txt.Text = "������";
                        }
                    }
                    else
                    {
                        txt.Text = "";
                    }

                    TableCell tc = new TableCell();

                    if ("d" == dr["Field_Type"].ToString() || "c" == dr["Field_Type"].ToString() || "n" == dr["Field_Type"].ToString() || null == dr["Field_Type"].ToString())
                    {
                        //nothing to do
                        tc.Controls.Add(txt);
                    }
                    else
                    {
                        //txt.Visible = false;
                        bool isDdl = IsDdlControl(dr["Field_Type"].ToString());
                        if (isDdl)
                        {
                            txt.Width = 0;
                            tc.Controls.Add(txt);
                            string fieldID = dr["Field_Type"].ToString();
                            DataTable dtFieldValue = df.GetFieldValueList(int.Parse(fieldID));
                            DropDownList ddl = new DropDownList();
                            ddl.ID = "ddl" + dr["Field_Name"].ToString();
                            ddl.DataSource = dtFieldValue;
                            ddl.DataTextField = dtFieldValue.Columns["FieldValue_Name"].ToString();
                            ddl.DataValueField = dtFieldValue.Columns["FieldValue_Name"].ToString();

                            ddl.DataBind();

                            ddl.Items.Insert(0, new ListItem("��ѡ��", ""));
                            ddl.Attributes.Add("onchange", "javascript:setTextValue('" + txt.ID + "','" + ddl.ID + "');");
                            if (DocID > 0)
                            {
                                if (dt.Rows.Count > 0)
                                {
                                    //txt.Text = dt.Rows[0][dr["Field_Name"].ToString()].ToString();
                                    ddl.SelectedValue = dt.Rows[0][dr["Field_Name"].ToString()].ToString();
                                }

                            }

                            //onchange="javascript:setTimeout('__doPostBack(\'ddld\',\'\')', 0)" language="javascript"
                            tc.Controls.Add(ddl);
                        }
                        else
                        {
                            txt.Text = getAutoNumber(dr["Field_Type"].ToString());
                            txt.Text = txt.Text+DateTime.Now.Year.ToString()+ this.flowNumber.PadLeft(4,'0').ToString();

                            txt.ReadOnly = true;
                            if (DocID > 0)
                            {
                                if (dt.Rows.Count > 0)
                                {
                                    //txt.Text = dt.Rows[0][dr["Field_Name"].ToString()].ToString();
                                    txt.Text = dt.Rows[0][dr["Field_Name"].ToString()].ToString();
                                }

                            }
                            tc.Controls.Add(txt);
                        }

                    }
                    //tc.Controls.Add(txt);

                    TableRow tr = new TableRow();
                    TableCell tl = new TableCell();

                    Literal lt = new Literal();

                    lt.Text = dr["Example"].ToString();

                    if (FieldNum == 0 || dr["judged"].ToString() == "True")
                    {
                        RequiredFieldValidator rfv = new RequiredFieldValidator();
                        rfv.ControlToValidate = txt.ID;
                        rfv.ErrorMessage = "(*)";
                        rfv.Display = ValidatorDisplay.Dynamic;
                        rfv.EnableClientScript = true;

                        tc.Controls.Add(rfv);
                    }
                    //if (dr["judged"].ToString() == "True")
                    //{

                    //    RegularExpressionValidator rev = new RegularExpressionValidator();

                    //    rev.ErrorMessage = "�����";
                    //    rev.ControlToValidate = txt.ID;
                    //    rev.ValidationExpression = @"\d+";

                    //    rev.Display = ValidatorDisplay.Dynamic;

                    //    tc.Controls.Add(rev);

                    //}
                    if ("n" == dr["Field_Type"].ToString())
                    {

                        RegularExpressionValidator rev = new RegularExpressionValidator();

                        rev.ErrorMessage = "��д���֣�����λС��";
                        rev.ControlToValidate = txt.ID;
                        rev.ValidationExpression = @"^\d{1,10}(\.\d{2})?$";

                        rev.Display = ValidatorDisplay.Dynamic;

                        tc.Controls.Add(rev);

                    }
                    //if ("d" == dr["Field_Type"].ToString()) //�������ֶ���֤
                    //{
                    //    RegularExpressionValidator revDate = new RegularExpressionValidator();

                    //    revDate.ErrorMessage = "�����";
                    //    revDate.ControlToValidate = txt.ID;
                    //    revDate.ValidationExpression = @"\d+";

                    //    revDate.Display = ValidatorDisplay.Dynamic;

                    //    tc.Controls.Add(revDate);
                    //}

                    tc.Controls.Add(lt);

                    tl.Text = dr["Field_Description"].ToString() + ":";

                    if (dr["MultiLine"].ToString() != "False")
                        tl.VerticalAlign = VerticalAlign.Top;
                    else
                        tl.VerticalAlign = VerticalAlign.Middle;
                    tl.HorizontalAlign = HorizontalAlign.Right;

                    tr.Cells.Add(tl);
                    tr.Cells.Add(tc);
                    ht.Rows.Add(tr);

                    tc = null;
                    tl = null;
                    tr = null;

                    FieldNum += 1;

                }
            }
            finally
            {

                if (dr != null)
                {
                    dr.Close();
                }
                dr = null;
            }
            if (DocID > 0)
                AddAttach(DocID);

            AddAttachControl();
            AddProjectControl();
            AddControl();

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

            if (dtPostil != null)
            {
                if (dtPostil.Rows.Count > 0)
                {
                    Table tb = new Table();
                    tb.CssClass = "GbText";
                    tb.Width = Unit.Percentage(98);
                    AddRow(tb, "�������");
                    AddPostitleHead(tb);

                    for (int i = 0; i < dtPostil.Rows.Count; i++)
                    {
                        AddRow(tb, 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());
                    }
                    AddTable(ht, tb);
                }
            }
            dtPostil = null;
        }