Beispiel #1
0
 //根据流程ID和环节ID和字段ID查找记录,用来判断某一环节能否修改这个字段
 //返回值:0:无权 1:有权
 public string IfCanWriteByFlowid_Tacheid_Fieldid(string pi_flowid,string pi_tacheid,string pi_fieldid)
 {
     string ls_return = "0";
     HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
     ls_return = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(pi_flowid, pi_tacheid, pi_fieldid);
     return ls_return;
 }
Beispiel #2
0
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
        HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
        HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();

        String[] v_uids = this.txtuids.Value.Split(',');
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                //删除流程信息
                Hyoa_flowinfor.hy_flowid = v_uids[i];
                Hyoa_flowinfor.Delete();
                //删除环节信息
                Hyoa_flowtache.DeleteByflowid(v_uids[i]);
                //删除流转信息
                Hyoa_flowwork.DeleteAllbyflowid(v_uids[i]);
                //删除流程对应的域
                Hyoa_flowfield.DeleteAllbyflowid(v_uids[i]);
                //删除流程环节对应的域
                Hyoa_flowtachefield.DeleteAllbyflowid(v_uids[i]);
                //删除流程环节对应的用户
                Hyoa_flowtacheuser.DeleteAllbyflowid(v_uids[i]);
            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
    //输出一个字段
    //li_tdnums_onerow:当前行已输出了几列
    //li_colnums_show:每行显示几列(标准情况下)
    //pi_isnewdoc 0:新文档  1:旧文档
    //ifhavarole:表单上是否有权限  0:lable输出 1:input输出
    //ifflowdoc:是否流程表单 0:非流程 1:流程
    //curtacheid:当前环节ID,用于判断字段是否在当前环节有权限
    public int GetFieldHtml(TableRow tRow, int li_tdnums_onerow, int li_colnums_show, string hy_fieldid, string pi_isnewdoc, string ifhavarole, string ifflowdoc, string curtacheid)
    {
        int li_return = li_tdnums_onerow;

        string ls_laborinput = "0";     //输出LABLE还是INPUT    0:LABLE    1:INPUT
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.hy_mudelid.Text, hy_fieldid, this.hy_tableid.Text);

        int li_left = 30;
        int li_right = 70;
        if (dtfield.Rows.Count > 0)
        {
            string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString();     //字段类型
            if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "5")   //如果设置了不显示左侧说明文字,则不加载左侧列
            {
                li_return += 1;
                //插入单元格(左侧)
                TableCell tCell = new TableCell();
                tRow.Cells.Add(tCell);
                tCell.Width = Unit.Percentage((li_left / li_colnums_show));
                tCell.Height = Unit.Pixel(30);
                tCell.CssClass = "Tdcellleft";
                tCell.HorizontalAlign = HorizontalAlign.Center;
                tCell.Controls.Add(new LiteralControl(dtfield.Rows[0]["hy_fieldname"].ToString()));
            }
            else
            {
                li_left = 50;
                li_right = 50;
            }
            //插入单元格(右侧)
            TableCell tCell2 = new TableCell();
            tRow.Cells.Add(tCell2);
            tCell2.Width = Unit.Percentage((li_right / li_colnums_show));
            tCell2.Height = Unit.Pixel(30);
            tCell2.CssClass = "Tdcellright";
            if (dtfield.Rows[0]["hy_align"].ToString() == "left")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Left;
            }
            if (dtfield.Rows[0]["hy_align"].ToString() == "center")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Center;
            }
            if (dtfield.Rows[0]["hy_align"].ToString() == "right")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Right;
            }
            tCell2.ColumnSpan = int.Parse(dtfield.Rows[0]["hy_tdnums"].ToString());
            li_return += int.Parse(dtfield.Rows[0]["hy_tdnums"].ToString());

            //赋值(新文档取配置的默认值,旧文档取数据库表中的值)
            string field_docvalue = "";
            if (pi_isnewdoc == "0")     //新文档
            {
                if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "-1")
                {
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0")
                    {
                        field_docvalue = dtfield.Rows[0]["hy_defaultvalue"].ToString();     //手工配置
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1")
                    {
                        DataTable dt_getfieldvalue = Hyoa_global.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString());
                        field_docvalue = dt_getfieldvalue.Rows[0][0].ToString();     //SQL语句
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2")
                    {
                        field_docvalue = Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString();     //SESSION
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3")
                    {
                        if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                            field_docvalue = System.DateTime.Now.ToString("yyyy-MM-dd");     //当前时间
                        else
                            field_docvalue = System.DateTime.Now.ToString("yyyy-MM-dd HH:MM:ss");     //当前时间
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "4")
                    {
                        //自动生成
                        if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值")
                        {
                            //得到目前最大的数值,然后+1,未找到则赋值为1
                            DataTable dt_autovalue = Hyoa_global.GetDataTable("select max(hyc_" + hy_fieldid + ") maxint from hyc_" + this.hy_tableid.Text);
                            if (dt_autovalue.Rows[0]["maxint"].ToString() == null || dt_autovalue.Rows[0]["maxint"].ToString() == "")
                                field_docvalue += "1";
                            else
                                field_docvalue += (System.Int32.Parse(dt_autovalue.Rows[0]["maxint"].ToString()) + 1).ToString();
                        }
                        else
                        {
                            field_docvalue += System.Guid.NewGuid().ToString();
                        }
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "5")
                    {
                        field_docvalue += dtfield.Rows[0]["hy_defaultvalue"].ToString();
                    }
                }
            }
            else
            {
                if (field_type == "文本" || field_type == "多行文本" || field_type == "多行文本_TEXT" || field_type == "文本加按钮" || field_type == "多行文本加按钮" || field_type == "日期" || field_type == "数值" || field_type == "对话框列表" || field_type == "复选框" || field_type == "单选框" || field_type == "口令" || field_type == "编辑器")
                {
                    string ls_sql = "select hyc_" + hy_fieldid + " from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'";
                    DataTable dt_getdocvalue = Hyoa_global.GetDataTable(ls_sql);
                    if (dt_getdocvalue.Rows.Count > 0)
                    {
                        field_docvalue = dt_getdocvalue.Rows[0][0].ToString();
                        if (field_type == "日期")
                        {
                            if (field_docvalue.Length > 8)
                            {
                                if (field_docvalue.Substring(0, 8) == "1900-1-1")
                                {
                                    field_docvalue = "&nbsp;";
                                }
                                else
                                {
                                    if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                                    {
                                        field_docvalue = System.DateTime.Parse(field_docvalue).ToString("yyyy-MM-dd");
                                    }
                                }
                            }
                        }
                    }
                }
                if (field_type == "说明文字")
                {
                    field_docvalue += dtfield.Rows[0]["hy_defaultvalue"].ToString();
                }
            }

            //判断是输出LABL还是INPUT
            if (pi_isnewdoc == "0")     //新文档
            {
                if (ifflowdoc == "0")   //非流程
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        ls_laborinput = "1";
                    }
                }
                else
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        //有流程(判断当前环节这个字段是否有权限)
                        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
                        ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid);
                        if (ls_laborinput == "0")
                        {
                            field_docvalue = "";
                        }
                    }
                    else
                    {
                        field_docvalue = "";
                    }
                }
            }
            else     //旧文档
            {
                if (ifflowdoc == "0")   //非流程
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        ls_laborinput = "1";
                        //如果文档已经确认,则输出lable
                        string ls_sql = "select hy_ifconfirm from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'";
                        DataTable dt_getifconfirm = Hyoa_global.GetDataTable(ls_sql);
                        if (dt_getifconfirm.Rows.Count > 0)
                        {
                            if (dt_getifconfirm.Rows[0]["hy_ifconfirm"].ToString() == "1")
                                ls_laborinput = "0";
                        }
                    }
                }
                else
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        //有流程(判断当前环节这个字段是否有权限)
                        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
                        ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid);
                        //如果流程结束了,则输出lable
                        if (hy_curtacheid.Text == "**")
                        {
                            ls_laborinput = "0";
                        }
                    }
                }
            }

            //如果是输出LABLE,值为空则赋为&nbsp;不为空时需要转换回车和空格
            if (ls_laborinput == "0")
            {
                if (field_docvalue == "")
                {
                    field_docvalue = "&nbsp;";
                }
                else
                {
                    if (field_type != "编辑器")
                    {
                        field_docvalue = RtfToText(field_docvalue);
                    }
                }
            }

            //单行文本
            if (field_type == "文本")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //多行文本
            if (field_type == "多行文本")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //多行文本_TEXT
            if (field_type == "多行文本_TEXT")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //按钮
            if (field_type == "按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = "&nbsp;";
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value='" + dtfield.Rows[0]["hy_fieldname"].ToString() + "' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //一直显示的按钮
            if (field_type == "一直显示的按钮")
            {
                //-----开始输出字段------
                Label txtTextBox = new Label();
                txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value='" + dtfield.Rows[0]["hy_fieldname"].ToString() + "' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                txtTextBox.Text = field_docvalue;
                tCell2.Controls.Add(txtTextBox);
            }
            //日期
            if (field_type == "日期")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //文本加按钮
            if (field_type == "文本加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    txtTextBox.Width = Unit.Parse("60%");
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //多行文本加按钮
            if (field_type == "多行文本加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //意见加按钮
            if (field_type == "意见加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    //txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" /><input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "_cz' value=' 重 置 ' class=btn3 onclick=\"document.getElementById('" + dtfield.Rows[0]["hy_fieldid"].ToString() + "').value='';\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //数值
            if (field_type == "数值")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //对话框列表(下拉框
            if (field_type == "对话框列表")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    DropDownList ddlDropDownList = new DropDownList();
                    ddlDropDownList.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        ddlDropDownList.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        ddlDropDownList.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        ddlDropDownList.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                ddlDropDownList.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            //如果SQL语句中含有特殊标示,则需要替换
                            string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                            if (ls_sql.Contains("用户ID"))
                            {
                                ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                            }
                            if (ls_sql.Contains("用户名"))
                            {
                                ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                            }
                            if (ls_sql.Contains("部门ID"))
                            {
                                ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                            }
                            if (ls_sql.Contains("部门名"))
                            {
                                ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                            }
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            ddlDropDownList.DataSource = dt_options;
                            ddlDropDownList.DataTextField = dt_options.Columns[0].ColumnName;
                            ddlDropDownList.DataValueField = dt_options.Columns[0].ColumnName;
                            ddlDropDownList.DataBind();
                        }
                    }
                    ddlDropDownList.Items.Insert(0, new ListItem("--请选择--", ""));
                    ddlDropDownList.SelectedValue = field_docvalue;
                    tCell2.Controls.Add(ddlDropDownList);
                }
            }
            //复选框(查询时直接显示文本框)
            if (field_type == "复选框")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    CheckBoxList txtTextBox = new CheckBoxList();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                txtTextBox.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        //如果SQL语句中含有特殊标示,则需要替换
                        string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                        if (ls_sql.Contains("用户ID"))
                        {
                            ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("用户名"))
                        {
                            ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门ID"))
                        {
                            ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门名"))
                        {
                            ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                        }
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            txtTextBox.DataSource = dt_options;
                            txtTextBox.DataTextField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataValueField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataBind();
                        }
                    }
                    if (field_docvalue != "")
                    {
                        field_docvalue = "," + field_docvalue + ",";
                        foreach (ListItem li in txtTextBox.Items)
                        {
                            if (field_docvalue.Contains(li.Value))
                                li.Selected = true;
                        }
                    }
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //单选框(查询时直接显示文本框)
            if (field_type == "单选框")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    RadioButtonList txtTextBox = new RadioButtonList();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                txtTextBox.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        //如果SQL语句中含有特殊标示,则需要替换
                        string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                        if (ls_sql.Contains("用户ID"))
                        {
                            ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("用户名"))
                        {
                            ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门ID"))
                        {
                            ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门名"))
                        {
                            ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                        }
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            txtTextBox.DataSource = dt_options;
                            txtTextBox.DataTextField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataValueField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataBind();
                        }
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //口令
            if (field_type == "口令")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = "&nbsp;";
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.Password;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //附件组件
            if (field_type == "附件组件")
            {
                //读取附件内容
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatheridandFatherfield(this.txtdocid.Value, hy_fieldid);
                field_docvalue = "";
                if (dt_fileatt.Rows.Count > 0)
                {
                    for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++)
                    {
                        field_docvalue += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "</a><br />";
                    }
                }
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (field_docvalue == "")
                    {
                        field_docvalue = "&nbsp;";
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue += "<input type=button id='uploadfile1' value='附件管理' class=btn3 onclick=\"window.open('ggdy/main_fileatt.aspx?fatherid=" + this.txtdocid.Value + "&fatherfield=" + hy_fieldid + "','filewindow','height=350,width=600,top=100,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');\" />";
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //说明文字
            if (field_type == "说明文字")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //编辑器
            if (field_type == "编辑器")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    //隐藏文本框
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    txtTextBox.Style.Value = "display:none";
                    tCell2.Controls.Add(txtTextBox);
                    //编辑器
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "eWebEditor" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<iframe ID=\"eWebEditor" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"system/eWebEditor/ewebeditor.htm?id=" + dtfield.Rows[0]["hy_fieldid"].ToString() + "&style=Portal\" frameborder=0 scrolling=no width=" + dtfield.Rows[0]["hy_width"].ToString() + " height=" + dtfield.Rows[0]["hy_height"].ToString() + "></iframe>";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //痕迹保留
            if (field_type == "痕迹保留")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=1&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                    //如果是流程模块,则根据环节判断一下
                    if (ifflowdoc == "1")
                    {
                        //判断是否为第一环节
                        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                        DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, "*");
                        if (dtflowwork.Rows.Count > 0)
                        {
                            if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == this.hy_curtacheid.Text)
                            {
                                field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                            }
                            else
                            {
                                //判断是否为最后一个环节
                                dtflowwork.Clear();
                                dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                                if (dtflowwork.Rows.Count > 0)
                                {
                                    if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                    {
                                        field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=0&jsxd=1&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                                    }
                                    else
                                    {
                                        field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=0&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                                    }
                                }

                            }
                        }
                    }
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //IFRAME列表
            if (field_type == "IFRAME列表")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    field_docvalue = "<iframe id=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" name=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"" + dtfield.Rows[0]["hy_defaultvalue"].ToString() + "&motherid=" + this.txtdocid.Value + "&ishaverole=0\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    field_docvalue = "<iframe id=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" name=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"" + dtfield.Rows[0]["hy_defaultvalue"].ToString() + "&motherid=" + this.txtdocid.Value + "&ishaverole=1\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //子表信息带链接

            //子表信息不带链接

        }
        return li_return;
    }
Beispiel #4
0
 //得到当前流程+当前环节能够修改的字段,以#分隔  Written by xf 20110516
 //输出时字段后边加“_1”,用于和前台页面HTML字段对应
 private void GetFlowtachefields()
 {
     string ls_Flowtachefields = "";
     HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
     DataTable dt_flowtachefield = Hyoa_flowtachefield.Getflowtachefield(this.hy_flowid.Text, this.hy_curtacheid.Text);
     if (dt_flowtachefield.Rows.Count > 0)
     {
         for (var i = 0; i < dt_flowtachefield.Rows.Count; i++)
         {
             ls_Flowtachefields += "#" + dt_flowtachefield.Rows[i]["hy_fieldid"].ToString() + "_1";
         }
         ls_Flowtachefields += "#";
     }
     this.txtflowtachefields.Text = ls_Flowtachefields;
 }
Beispiel #5
0
    //得到表单的HTML pi_flag 0:不赋值  1:需赋值    Written by xf 20110515
    //docid:旧文档使用时,文档ID
    //ifhavarole:是否有权限  0:lable输出 1:input输出
    //ifflowdoc:是否流程表单 0:非流程 1:流程
    //curtacheid:当前环节ID,用于判断字段是否在当前环节有权限
    public DataTable GetDataTableFieldHtml(string hy_mudelid, string hy_tableid, string pi_flag, string ifsearch, string docid, string ifhavarole, string ifflowdoc, string curtacheid)
    {
        //加载表单
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        //根据模块ID和表单ID得到对应的配置字段
        DataTable dt_gettablecolumns = Hyoa_flowfield.GetflowfieldsbyMudelidAndTableid(hy_mudelid, hy_tableid);
        string ls_html = "";
        Int32 li_tdnums = 0;    //TDS数(colspan的值相加)

        DataTable tempTable = new DataTable();
        DataColumn col = new DataColumn("displaycol", typeof(String)); //定义新的一列  add
        tempTable.Columns.Add(col);  //追加一列  add

        if (dt_gettablecolumns.Rows.Count > 0)
        {
            //先从配置表中将配置的列数取出,如果配置表中找不到,则默认为4列,并且设置相应的宽度start
            HyoaClass.Hyoa_detail Hyoa_detail = new HyoaClass.Hyoa_detail();
            int li_col = 4;//一行显示几列
            string ls_leftwidth = "15";//左侧列宽
            string ls_rightwidth = "35";//右侧列宽
            DataTable detaildt = Hyoa_detail.Getdetail(hy_tableid);
            if (detaildt.Rows.Count > 0)
            {
                li_col = int.Parse(detaildt.Rows[0]["hy_colnum"].ToString());
                if (detaildt.Rows[0]["hy_colnum"].ToString() == "6")
                {
                    ls_leftwidth = "10";
                    ls_rightwidth = "23";
                }
                else
                {
                    if (detaildt.Rows[0]["hy_colnum"].ToString() == "8")
                    {
                        ls_leftwidth = "5";
                        ls_rightwidth = "7";
                    }
                    else
                    {
                        if (detaildt.Rows[0]["hy_colnum"].ToString() == "10")
                        {
                            ls_leftwidth = "4";
                            ls_rightwidth = "6";
                        }
                    }
                }
            }
            //先从配置表中将配置的列数取出,如果配置表中找不到,则默认为4列,并且设置相应的宽度end

            //开始加载字段信息到DT中,用于前台显示
            for (int i = 0; i < dt_gettablecolumns.Rows.Count; i++)
            {
                if (i == 0)
                {
                    ls_html += "<TR height=\"30\">";
                }
                //输出字段说明列(文字说明除外)
                if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() != "说明文字")
                {
                    //20120724
                    //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                    if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                        ls_html += "<TD width=\"" + ls_leftwidth + "%\" align=\"center\" class=\"Tdcellleft\">" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "</TD>";
                    else
                        ls_html += "<div style=\"display:none\">" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "</div>";
                    //ls_html += "<TD width=\"" + ls_leftwidth + "%\" align=\"center\" class=\"Tdcellleft\">" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "</TD>";
                }
                //得到当前字段的值
                HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
                DataTable dt_flowmain = Hyoa_flowmain.Getflowmain(docid);
                string field_docvalue = "&nbsp;";
                if (dt_flowmain.Rows.Count > 0)
                {
                    if (dt_gettablecolumns.Rows[i]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                    {
                        field_docvalue = System.DateTime.Parse(dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString()).ToShortDateString() + field_docvalue;
                    }
                    else
                    {
                        //如果SQL为数值的字段部分,则需要截取小数点后边两位
                        if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "数值")
                        {
                            if (dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString().Contains(".") == true)
                                field_docvalue = float.Parse(dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString()).ToString("F2") + field_docvalue;
                            else
                                field_docvalue = dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString() + field_docvalue;
                        }
                        else
                        {
                            field_docvalue = dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString() + field_docvalue;
                        }
                    }
                }
                //输出字段列
                //this.Response.Write("<script>alert('" + ifhavarole + "');</script>");
                if (ifhavarole == "0")  //无权限(当前表单来讲)
                {
                    //附件组件的值需要特定读取(附件需要特殊处理) Added by xf 20110607
                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "附件组件")
                    {

                        field_docvalue = "";
                        //根据docid得到目前已上传的附件信息
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                        DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(docid);
                        if (dt_fileatt.Rows.Count > 0)
                        {
                            for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++)
                            {
                                string ls_name = "";
                                DataTable dt_user = Hyoa_user.Getuser(dt_fileatt.Rows[ii]["hy_userid"].ToString());
                                if (dt_user.Rows.Count > 0)
                                {
                                    ls_name = dt_user.Rows[0]["hy_username"].ToString();
                                }
                                field_docvalue += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "&nbsp;&nbsp;&nbsp;&nbsp;" + ls_name + "&nbsp;&nbsp;[" + dt_fileatt.Rows[ii]["hy_djsj"].ToString() + "]" + "</a><br />";
                            }
                        }
                        if (field_docvalue == "")
                            field_docvalue = "&nbsp;";
                    }
                    //痕迹保留组件的值需要读取(需要特殊处理) Added by xf 20110705
                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "痕迹保留")
                    {
                        field_docvalue = "";
                        field_docvalue += "<input type=button id=\"btn_zwxg\" value='正  文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=1&jsxd=1','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" ";
                        if (field_docvalue == "")
                            field_docvalue = "&nbsp;";
                    }
                    //ztmztmztmstart
                    //this.Response.Write("<script>alert('" + field_docvalue + "');</script>");
                    if (field_docvalue.Length > 7)
                    {

                        if (field_docvalue.Substring(0, 8) == "1900-1-1")
                        {
                            field_docvalue = "&nbsp;";
                        }
                    }
                    //ztmztmztmend
                    if (dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() == "1")
                    {
                        //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                        if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                            ls_html += "<TD width=\"" + ls_rightwidth + "%\" height=\"30px\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\">" + field_docvalue + "</TD>";
                        else
                            ls_html += "<div style=\"display:none\">" + field_docvalue + "</div>";
                        //ls_html += "<TD width=\"" + ls_rightwidth + "%\" height=\"30px\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\">" + field_docvalue + "</TD>";
                    }
                    else
                    {
                        //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                        if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                            ls_html += "<TD width=\"" + ls_rightwidth + "%\" height=\"30px\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\" colspan=" + dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() + ">" + field_docvalue + "</TD>";
                        else
                            ls_html += "<div style=\"display:none\">" + field_docvalue + "</div>";
                        //ls_html += "<TD width=\"" + ls_rightwidth + "%\" height=\"30px\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\" colspan=" + dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() + ">" + field_docvalue + "</TD>";
                    }
                }
                else
                {
                    //有权限(当前表单来讲)时,判断当前流程+当前环节对于这个字段是否有权限操作
                    string ls_ifhavarole = "0";    //默认没有权限(当前字段来讲)---该功能仅对于流程模块起作用
                    //非流程直接就有权限了
                    //this.Response.Write("<script>alert('" + ifflowdoc + "');</script>");
                    if (ifflowdoc == "0")
                    {
                        ls_ifhavarole = "1";
                    }
                    else
                    {
                        //判断当前字段是否有权限
                        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
                        ls_ifhavarole = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(dt_gettablecolumns.Rows[i]["hy_flowid"].ToString(), curtacheid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString());
                    }

                    if (dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() == "1")
                    {
                        //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                        if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                            ls_html += "<TD width=\"" + ls_rightwidth + "%\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</TD>";
                        else
                            ls_html += "<div style=\"display:none\">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</div>";
                        //ls_html += "<TD width=\"" + ls_rightwidth + "%\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</TD>";
                    }
                    else
                    {
                        //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                        if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                            ls_html += "<TD width=\"" + ls_rightwidth + "%\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\" colspan=" + dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() + ">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</TD>";
                        else
                            ls_html += "<div style=\"display:none\">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</div>";
                        //ls_html += "<TD width=\"" + ls_rightwidth + "%\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\" colspan=" + dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() + ">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</TD>";

                    }
                }
                //开始colspan值累加,如果是隐藏字段,不计算在内
                if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                {
                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "说明文字")
                        li_tdnums += System.Int32.Parse(dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString());
                    else
                        li_tdnums += System.Int32.Parse(dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString()) + 1;
                }
                //this.lbtest.Text += "," + li_tdnums;
                if (li_tdnums % li_col == 0 && dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                {
                    ls_html += "</tr>";
                    DataRow dr = tempTable.NewRow();
                    dr["displaycol"] = ls_html;  //将新值赋给相应的列  add
                    tempTable.Rows.Add(dr);
                    ls_html = "";
                    if (i != (dt_gettablecolumns.Rows.Count - 1))
                        ls_html += "<tr>";
                }
                //先从配置表中将配置的列数取出,如果配置表中找不到,则默认为4列end
            }
        }
        return tempTable;
    }
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "复制成功!";

        try
        {
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            HyoaClass.Hyoa_role Hyoa_role = new HyoaClass.Hyoa_role();
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
            HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
            HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield();
            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
            HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
            #region 生成权限
            DataTable dt = Hyoa_role.Getrole("Role" + this.txtmudelid.Text);
            if (dt.Rows.Count > 0)
            {
                Response.Write("<script>alert('该权限编号已存在,请重新填写!');history.back();</script>");
                return;
            }
            else
            {
                Hyoa_role.hy_roleid = "Role" + this.txtmudelid.Text;
                Hyoa_role.hy_rolename = this.txtmudelname.Text;
                Hyoa_role.hy_sort = System.Int32.Parse(this.txtno.Value);
                Hyoa_role.Insert();
            }
            #endregion

            #region 生成模块
            dt = Hyoa_mudel.Getmudel("Mudel" + this.txtmudelid.Text);
            if (dt.Rows.Count > 0)
            {
                Response.Write("<script>alert('该模块编号已存在,请重新填写!');history.back();</script>");
                return;
            }
            else
            {
                Hyoa_mudel.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                Hyoa_mudel.hy_mudelname = this.txtmudelname.Text;
                Hyoa_mudel.hy_sort = System.Int32.Parse(this.txtno.Value);
                Hyoa_mudel.hy_isenabled = "是";
                Hyoa_mudel.hy_roleid = "Role" + this.txtmudelid.Text;
                Hyoa_mudel.hy_qqroleid = "Role" + this.txtmudelid.Text;
                Hyoa_mudel.Insert();
            }
            #endregion

            #region 生成表单
            DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.ddlmudelid.SelectedValue);
            if (tableconfigdt.Rows.Count > 0)
            {
                Hyoa_tableconfig.ID = "Table" + this.txtmudelid.Text;
                Hyoa_tableconfig.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                Hyoa_tableconfig.hy_name = this.txtmudelname.Text;
                Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString();
                Hyoa_tableconfig.hy_sort = float.Parse(this.txtno.Value);
                Hyoa_tableconfig.hy_ifflowdoc = tableconfigdt.Rows[0]["hy_ifflowdoc"].ToString();
                Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString();
                Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString();
                Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString();
                Hyoa_tableconfig.hy_ifcomment = tableconfigdt.Rows[0]["hy_ifcomment"].ToString();
                Hyoa_tableconfig.hy_colnum = float.Parse(tableconfigdt.Rows[0]["hy_colnum"].ToString());
                Hyoa_tableconfig.hy_field1 = tableconfigdt.Rows[0]["hy_field1"].ToString();
                Hyoa_tableconfig.hy_field2 = tableconfigdt.Rows[0]["hy_field2"].ToString();
                Hyoa_tableconfig.hy_field3 = tableconfigdt.Rows[0]["hy_field3"].ToString();
                Hyoa_tableconfig.hy_field4 = tableconfigdt.Rows[0]["hy_field4"].ToString();
                Hyoa_tableconfig.hy_field5 = tableconfigdt.Rows[0]["hy_field5"].ToString();
                Hyoa_tableconfig.Insert();
            }
            #endregion

            #region 生成表单字段
            int i;
            DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.ddltableid.SelectedValue);
            if (flowfielddt.Rows.Count > 0)
            {
                for (i = 0; i < flowfielddt.Rows.Count; i++)
                {
                    Hyoa_flowfield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowfield.hy_tableid = "Table" + this.txtmudelid.Text;
                    Hyoa_flowfield.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                    Hyoa_flowfield.hy_flowid = "Flow" + this.txtmudelid.Text;
                    Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString();
                    Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString();
                    Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString();
                    Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString());
                    Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString();
                    Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString());
                    Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString();
                    Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString();
                    Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString();
                    Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString();
                    Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString();
                    Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString();
                    Hyoa_flowfield.hy_onfocus = flowfielddt.Rows[i]["hy_onfocus"].ToString();
                    Hyoa_flowfield.hy_onblur = flowfielddt.Rows[i]["hy_onblur"].ToString();
                    Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString();
                    Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString();
                    Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString();
                    Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString();
                    Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString());
                    Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString();
                    Hyoa_flowfield.hy_sort = float.Parse(flowfielddt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString());
                    Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString();
                    Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString();
                    Hyoa_flowfield.hy_ifhiddle = flowfielddt.Rows[i]["hy_ifhiddle"].ToString();
                    Hyoa_flowfield.hy_ifdbsybt = flowfielddt.Rows[i]["hy_ifdbsybt"].ToString();
                    Hyoa_flowfield.hy_field1 = flowfielddt.Rows[i]["hy_field1"].ToString();
                    Hyoa_flowfield.hy_field2 = flowfielddt.Rows[i]["hy_field2"].ToString();
                    Hyoa_flowfield.hy_field3 = flowfielddt.Rows[i]["hy_field3"].ToString();
                    Hyoa_flowfield.hy_field4 = flowfielddt.Rows[i]["hy_field4"].ToString();
                    Hyoa_flowfield.hy_field5 = flowfielddt.Rows[i]["hy_field5"].ToString();
                    Hyoa_flowfield.Insert();
                }
            }
            #endregion

            #region 生成SQL/ORACLE中的表
            string sql = "";
            if (Session["conntype"].ToString() == "SQL")
            {
                sql = "select * into hyc_Table" + this.txtmudelid.Text + " from hyc_" + this.ddltableid.SelectedValue + " where 1=0";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                sql = "create table hyc_Table" + this.txtmudelid.Text + " as select * from hyc_" + this.ddltableid.SelectedValue + " where 1=2";
            }
            Hyoa_global.ExcuteSQL(sql);
            #endregion

            #region 生成列表
            DataTable listconfigdt = Hyoa_listconfig.GetlistconfigsbyMudelidAndTableid(this.ddlmudelid.SelectedValue, this.ddltableid.SelectedValue);
            //列表ID
            string strListId = Hyoa_global.GetRandom();
            if (listconfigdt.Rows.Count > 0)
            {
                Hyoa_listconfig.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                Hyoa_listconfig.hy_tableid = "Table" + this.txtmudelid.Text;
                Hyoa_listconfig.hy_ifflowdoc = listconfigdt.Rows[0]["hy_ifflowdoc"].ToString();
                Hyoa_listconfig.hy_sort = System.Int32.Parse(this.txtno.Value);
                Hyoa_listconfig.hy_columnshowid = listconfigdt.Rows[0]["hy_columnshowid"].ToString();
                Hyoa_listconfig.hy_columnshow = listconfigdt.Rows[0]["hy_columnshow"].ToString();
                Hyoa_listconfig.hy_ifsearch = listconfigdt.Rows[0]["hy_ifsearch"].ToString();
                Hyoa_listconfig.hy_ifshowsearch = listconfigdt.Rows[0]["hy_ifshowsearch"].ToString();
                Hyoa_listconfig.hy_width = listconfigdt.Rows[0]["hy_width"].ToString();
                Hyoa_listconfig.hy_listname = this.txtmudelname.Text;
                Hyoa_listconfig.hy_sortfield1 = listconfigdt.Rows[0]["hy_sortfield1"].ToString();
                Hyoa_listconfig.hy_sorttype1 = listconfigdt.Rows[0]["hy_sorttype1"].ToString();
                Hyoa_listconfig.hy_sortfield2 = listconfigdt.Rows[0]["hy_sortfield2"].ToString();
                Hyoa_listconfig.hy_sorttype2 = listconfigdt.Rows[0]["hy_sorttype2"].ToString();
                Hyoa_listconfig.hy_sortfield3 = listconfigdt.Rows[0]["hy_sortfield3"].ToString();
                Hyoa_listconfig.hy_sorttype3 = listconfigdt.Rows[0]["hy_sorttype3"].ToString();
                Hyoa_listconfig.hy_fieldid_fl1 = listconfigdt.Rows[0]["hy_fieldid_fl1"].ToString();
                Hyoa_listconfig.hy_fieldname_fl1 = listconfigdt.Rows[0]["hy_fieldname_fl1"].ToString();
                Hyoa_listconfig.hy_sql_fl1 = listconfigdt.Rows[0]["hy_sql_fl1"].ToString();
                Hyoa_listconfig.hy_fieldid_fl2 = listconfigdt.Rows[0]["hy_fieldid_fl2"].ToString();
                Hyoa_listconfig.hy_fieldname_fl2 = listconfigdt.Rows[0]["hy_fieldname_fl2"].ToString();
                Hyoa_listconfig.hy_sql_fl2 = listconfigdt.Rows[0]["hy_sql_fl2"].ToString();
                Hyoa_listconfig.hy_fieldid_fl3 = listconfigdt.Rows[0]["hy_fieldid_fl3"].ToString();
                Hyoa_listconfig.hy_fieldname_fl3 = listconfigdt.Rows[0]["hy_fieldname_fl3"].ToString();
                Hyoa_listconfig.hy_sql_fl3 = listconfigdt.Rows[0]["hy_sql_fl3"].ToString();
                Hyoa_listconfig.ID = strListId;
                Hyoa_listconfig.Insert();
            }
            #endregion

            #region 生成列表查询条件
            DataTable listsearchdt = Hyoa_listsearchfield.GetlistsearchfieldsbyMudelidAndTableid(this.ddlmudelid.SelectedValue, this.ddltableid.SelectedValue);
            for (int m = 0; m < listsearchdt.Rows.Count; m++)
            {
                Hyoa_listsearchfield.ID = Hyoa_global.GetRandom();
                Hyoa_listsearchfield.hy_listid = strListId;
                Hyoa_listsearchfield.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                Hyoa_listsearchfield.hy_tableid = "Table" + this.txtmudelid.Text;
                Hyoa_listsearchfield.hy_field = listsearchdt.Rows[m]["hy_field"].ToString();
                Hyoa_listsearchfield.hy_fieldid = listsearchdt.Rows[m]["hy_fieldid"].ToString();
                Hyoa_listsearchfield.hy_sort = m + 2;
                Hyoa_listsearchfield.Insert();
            }
            #endregion

            #region 生成流程信息
            string lssoureceflowid = "";
            if (tableconfigdt.Rows[0]["hy_ifflowdoc"].ToString() == "是")
            {
                DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.ddlmudelid.SelectedValue);
                if (flowinfordt.Rows.Count > 0)
                {
                    //得到老模块的flowid 后面要用到
                    lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString();
                    //插入流程信息start
                    Hyoa_flowinfor.hy_flowid = "Flow" + this.txtmudelid.Text;
                    Hyoa_flowinfor.hy_flowname = this.txtmudelname.Text;
                    Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtno.Value);
                    Hyoa_flowinfor.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                    // Hyoa_flowinfor.hy_addbyalluser = flowinfordt.Rows[0]["hy_addbyalluser"].ToString();
                    Hyoa_flowinfor.Insert();
                }
                //插入流程信息end

                //流程环节
                DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid);
                if (flowtachedt.Rows.Count > 0)
                {
                    for (i = 0; i < flowtachedt.Rows.Count; i++)
                    {
                        Hyoa_flowtache.ID = Hyoa_global.GetRandom();
                        Hyoa_flowtache.hy_flowid = "Flow" + this.txtmudelid.Text;
                        Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString();
                        Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString();
                        Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString());
                        Hyoa_flowtache.hy_ifshowcurcomp = flowtachedt.Rows[i]["hy_ifshowcurcomp"].ToString();
                        Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString();
                        Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString();
                        Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString();
                        Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString();
                        Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString();
                        Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString();
                        Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString();
                        Hyoa_flowtache.hy_enablecondition = flowtachedt.Rows[i]["hy_enablecondition"].ToString();
                        Hyoa_flowtache.Insert();
                    }
                }

                //流程环节对应的域
                DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid);
                if (flowtachefielddt.Rows.Count > 0)
                {
                    for (i = 0; i < flowtachefielddt.Rows.Count; i++)
                    {
                        Hyoa_flowtachefield.ID = Hyoa_global.GetRandom();
                        Hyoa_flowtachefield.hy_flowid = "Flow" + this.txtmudelid.Text;
                        Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString();
                        Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString();
                        Hyoa_flowtachefield.Insert();
                    }
                }
                //流程环节对应的用户
                DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid);
                if (flowtacheuserdt.Rows.Count > 0)
                {
                    for (i = 0; i < flowtacheuserdt.Rows.Count; i++)
                    {
                        Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                        Hyoa_flowtacheuser.hy_flowid = "Flow" + this.txtmudelid.Text;
                        Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString();
                        Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString();
                        Hyoa_flowtacheuser.Insert();
                    }
                }
                //工作流
                DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid);
                if (flowworkdt.Rows.Count > 0)
                {
                    for (i = 0; i < flowworkdt.Rows.Count; i++)
                    {
                        Hyoa_flowwork.ID = Hyoa_global.GetRandom();
                        Hyoa_flowwork.hy_flowid = "Flow" + this.txtmudelid.Text;
                        Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString();
                        Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString();
                        Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString();
                        Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString();
                        Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString());
                        Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString();
                        Hyoa_flowwork.hy_identity_type = flowworkdt.Rows[i]["hy_identity_type"].ToString();
                        Hyoa_flowwork.hy_identity_id = flowworkdt.Rows[i]["hy_identity_id"].ToString();
                        Hyoa_flowwork.hy_jscondition = flowworkdt.Rows[i]["hy_jscondition"].ToString();
                        Hyoa_flowwork.hy_jscondition1 = flowworkdt.Rows[i]["hy_jscondition1"].ToString();
                        Hyoa_flowwork.hy_jscondition2 = flowworkdt.Rows[i]["hy_jscondition2"].ToString();
                        Hyoa_flowwork.hy_zdcyuserids = flowworkdt.Rows[i]["hy_zdcyuserids"].ToString();
                        Hyoa_flowwork.Insert();
                    }
                }

            }
            #endregion
        }
        catch
        {
            ls_tip = "复制失败!";
        }
        finally
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location.href='" + txturl.Text + "';</script>");
        }
    }
        //ntko_class db = new ntko_class();//实例ntko_class类
        protected void Page_Load(object sender, EventArgs e)
        {
            //title = db.getdemotitle();
            //attachpath = db.getattachpath();
            if (this.Session["hyuid"].ToString() == "")
                this.Response.Redirect("../login.aspx?url=" + this.Request.RawUrl);

            //加载模板
            HyoaClass.Hyoa_ntkotemplateFile Hyoa_ntkotemplateFile = new HyoaClass.Hyoa_ntkotemplateFile();
            DataTable dt_templateFile = Hyoa_ntkotemplateFile.GettemplateFiles();
            this.templateFile.DataSource = dt_templateFile;
            this.templateFile.DataTextField = "templateFilename";
            this.templateFile.DataValueField = "templateFileurl";
            this.templateFile.DataBind();
            this.templateFile.Items.Insert(0, new ListItem("--请选择模板--", ""));
            this.templateFile.SelectedIndex = 0;

            //加载印章
            HyoaClass.Hyoa_ntkoesp Hyoa_ntkoesp = new HyoaClass.Hyoa_ntkoesp();
            DataTable dt_esp = Hyoa_ntkoesp.Getesps();
            this.SignFileUrl.DataSource = dt_esp;
            this.SignFileUrl.DataTextField = "espname";
            this.SignFileUrl.DataValueField = "espurl";
            this.SignFileUrl.DataBind();
            this.SignFileUrl.Items.Insert(0, new ListItem("--请选择印章--", ""));
            this.SignFileUrl.SelectedIndex = 0;

            //加载红头
            HyoaClass.Hyoa_ntkohongtou Hyoa_ntkohongtou = new HyoaClass.Hyoa_ntkohongtou();
            DataTable dt_hongtou = Hyoa_ntkohongtou.Gethongtous();
            this.redHeadTemplateFile.DataSource = dt_hongtou;
            this.redHeadTemplateFile.DataTextField = "hongtouname";
            this.redHeadTemplateFile.DataValueField = "hongtouurl";
            this.redHeadTemplateFile.DataBind();
            this.redHeadTemplateFile.Items.Insert(0, new ListItem("--请选择红头--", ""));
            this.redHeadTemplateFile.SelectedIndex = 0;

            title = "宁波合益";
            hyusername = this.Session["hyuname"].ToString();
            //设置第一环节是否在痕迹模式下编辑
            tacheByhj = "0";//痕迹模式下编辑
            if (this.Request.QueryString["tacheByhj"] != null)
            {
                if (this.Request.QueryString["tacheByhj"].ToString() == "1")
                {
                    tacheByhj = "1";    //非痕迹模式下编辑
                }
            }
            //是否显示接受修订按钮
            if (this.Request.QueryString["jsxd"] != null)
            {
                if (this.Request.QueryString["jsxd"].ToString() == "1")
                {
                    btnjsxd = "<input id=\"Button2\" type=button style =\"width:70px;height:23px;\" onclick=\"TANGER_OCX_AllRevisions(true);\" runat=\"server\" value=\" 接受修订\"  />";
                }
            }

            newofficetype = Request.QueryString["newofficetype"];
            HyoaClass.Hyoa_ntko Hyoa_ntko = new HyoaClass.Hyoa_ntko();
            if (this.Request.QueryString["fatherid"] != null)
            {
                fatherid = this.Request.QueryString["fatherid"].ToString();

                DataTable dtfatherid = Hyoa_ntko.GetntkofileByfother(fatherid);
                //this.Response.Write("<script>alert('" + dtfatherid.Rows.Count + "');</script>");
                if (dtfatherid.Rows.Count > 0)
                {
                    url = dtfatherid.Rows[0]["fid"].ToString();

                    DataTable dt = Hyoa_ntko.Getntkofile(url);
                    if (dt.Rows.Count > 0)
                    {
                        fileid = dt.Rows[0]["fid"].ToString();
                        filetitle = dt.Rows[0]["ftitle"].ToString();
                        fileother = dt.Rows[0]["fother"].ToString();
                        filename = dt.Rows[0]["fname"].ToString();
                    }
                }
            }

            tableid = "";
            if (this.Request.QueryString["tableid"] != null)
            {
                tableid = Request.QueryString["tableid"].ToString();
            }

            //隐藏控制(根据fatherid)
            string ls_flowid = "";
            string ls_currenttacheid = "";
            HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string sql = "";
            sql = "select * from hyc_" + tableid + " where DOCID='" + fatherid + "' ";
            DataTable dt_flowmain = Hyoa_global.GetDataTable(sql);
            if (dt_flowmain.Rows.Count > 0)
            {
                ls_flowid = dt_flowmain.Rows[0]["hy_flowid"].ToString();
                ls_currenttacheid = dt_flowmain.Rows[0]["hy_curtacheid"].ToString();
                //根据当前环节ID得到对应的隐藏权限
                DataTable dt_flowtachefield = Hyoa_flowtachefield.Getflowtachefield_gl(ls_flowid, ls_currenttacheid);
                if (dt_flowtachefield.Rows.Count > 0)
                {
                    for (var i = 0; i < dt_flowtachefield.Rows.Count; i++)
                    {
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "选择模板")
                        {
                            xuanzemubangongneng.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "界面设置")
                        {
                            jiemianshezhi.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "打印控制")
                        {
                            dayinkongzhi.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "印章和图片")
                        {
                            yinzhanghetupiangongneng.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "套红功能")
                        {
                            taohonggongneng.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "接受修订")
                        {
                            jieshouxiuding.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "权限控制")
                        {
                            quanxiankongzhi.Visible = true;
                        }
                    }
                }
            }
            else
            {
                //未找到,则默认权限
                xuanzemubangongneng.Visible = true;
                jiemianshezhi.Visible = true;
                dayinkongzhi.Visible = true;
                yinzhanghetupiangongneng.Visible = true;
                taohonggongneng.Visible = true;
                jieshouxiuding.Visible = true;
                quanxiankongzhi.Visible = true;
            }

            //生成痕迹稿start
            //在接受修订环节,打开文档时生成痕迹稿。
            string lsMapPath="";
            string lsMapPathsdec = "";
            if (this.Request.QueryString["jsxd"] != null)
            {
                if (this.Request.QueryString["jsxd"].ToString() == "1")
                {
                    lsMapPath = Server.MapPath("~/")+"/NTKO/uploadOfficeFile/"+filename;    //虚拟目录的位置
                    if (filename.IndexOf(".doc") > 0)
                    {
                        lsMapPathsdec = Server.MapPath("~/") + "/NTKO/uploadOfficeFile/" + filename.Substring(0, filename.IndexOf(".doc")) + "hjbl" + ".doc";//虚拟目录的位置
                    }
                    if (filename.IndexOf(".wps") > 0)
                    {
                        lsMapPathsdec = Server.MapPath("~/") + "/NTKO/uploadOfficeFile/" + filename.Substring(0, filename.IndexOf(".wps")) + "hjbl" + ".wps";//虚拟目录的位置
                    }
                        //File.Delete(lsMapPathsdec);
                    if (File.Exists(lsMapPathsdec))
                    {
                        //如果文件已经存在了,就不用产生痕迹稿了
                    }
                    else
                    {   //如果没有生成则生成痕迹稿
                        File.Copy(lsMapPath, lsMapPathsdec, false);
                    }

                }
            }
            //生成痕迹稿end
        }
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

        //判断目的表单ID是否重复
        DataTable dt_table = Hyoa_tableconfig.GetTable(txttableidbymd.Text);
        if (dt_table.Rows.Count > 0)
        {
            Response.Write("<script>alert('目的表单ID已存在!');</script>");
            return;
        }

        //插入TABLE配置
        DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.lbmudelidbysource.Text);
        if (tableconfigdt.Rows.Count > 0)
        {
            Hyoa_tableconfig.ID = txttableidbymd.Text;
            Hyoa_tableconfig.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
            Hyoa_tableconfig.hy_name = this.txttablenamebymd.Text;
            Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString();
            Hyoa_tableconfig.hy_sort = float.Parse(this.txttablesortbymd.Text);
            Hyoa_tableconfig.hy_ifflowdoc = this.ddlifflowdoc.SelectedValue;
            Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString();
            Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString();
            Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString();
            Hyoa_tableconfig.hy_ifcomment = tableconfigdt.Rows[0]["hy_ifcomment"].ToString();
            Hyoa_tableconfig.hy_colnum = float.Parse(tableconfigdt.Rows[0]["hy_colnum"].ToString());
            Hyoa_tableconfig.hy_field1 = tableconfigdt.Rows[0]["hy_field1"].ToString();
            Hyoa_tableconfig.hy_field2 = tableconfigdt.Rows[0]["hy_field2"].ToString();
            Hyoa_tableconfig.hy_field3 = tableconfigdt.Rows[0]["hy_field3"].ToString();
            Hyoa_tableconfig.hy_field4 = tableconfigdt.Rows[0]["hy_field4"].ToString();
            Hyoa_tableconfig.hy_field5 = tableconfigdt.Rows[0]["hy_field5"].ToString();
            Hyoa_tableconfig.Insert();
        }

        //插入FIELD配置
        int i;
        DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.lbtableidbysorce.Text);
        if (flowfielddt.Rows.Count > 0)
        {
            for (i = 0; i < flowfielddt.Rows.Count; i++)
            {
                Hyoa_flowfield.ID = Hyoa_global.GetRandom();
                Hyoa_flowfield.hy_tableid = txttableidbymd.Text;
                Hyoa_flowfield.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
                Hyoa_flowfield.hy_flowid = this.txtflowidbymd.Text;
                Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString();
                Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString();
                Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString();
                Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString();
                Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString());
                Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString();
                Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString());
                Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString();
                Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString();
                Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString();
                Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString();
                Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString();
                Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString();
                Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString();
                Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString();
                Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString();
                Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString();
                Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString());
                Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString();
                Hyoa_flowfield.hy_sort = float.Parse(flowfielddt.Rows[i]["hy_sort"].ToString());
                Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString());
                Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString();
                Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString();
                Hyoa_flowfield.hy_ifhiddle = flowfielddt.Rows[i]["hy_ifhiddle"].ToString();
                Hyoa_flowfield.hy_ifdbsybt = flowfielddt.Rows[i]["hy_ifdbsybt"].ToString();
                Hyoa_flowfield.hy_field1 = flowfielddt.Rows[i]["hy_field1"].ToString();
                Hyoa_flowfield.hy_field2 = flowfielddt.Rows[i]["hy_field2"].ToString();
                Hyoa_flowfield.hy_field3 = flowfielddt.Rows[i]["hy_field3"].ToString();
                Hyoa_flowfield.hy_field4 = flowfielddt.Rows[i]["hy_field4"].ToString();
                Hyoa_flowfield.hy_field5 = flowfielddt.Rows[i]["hy_field5"].ToString();
                Hyoa_flowfield.Insert();
            }
        }

        //生成SQL/ORACLE中的表
        string sql = "";
        if (Session["conntype"].ToString() == "SQL")
        {
            sql = "select * into hyc_" + txttableidbymd.Text + " from hyc_" + this.lbtableidbysorce.Text + " where 1=0";
        }
        if (Session["conntype"].ToString() == "ORACLE")
        {
            sql = "create table hyc_" + txttableidbymd.Text + " as select * from hyc_" + this.lbtableidbysorce.Text + " where 1=2";
        }
        Hyoa_global.ExcuteSQL(sql);

        //以下为流程模块的功能,非流程模块不需要执行
        if (this.ddlifflowdoc.SelectedValue == "是")
        {
            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
            DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.lbmudelidbysource.Text);
            string lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString();//得到老模块的flowid 后面要用到
            //插入流程信息start
            Hyoa_flowinfor.hy_flowid = this.txtflowidbymd.Text;
            Hyoa_flowinfor.hy_flowname =this.txtflownamebymd.Text;
            Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtflowsortbymd.Text);
            Hyoa_flowinfor.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
            Hyoa_flowinfor.Insert();
            //插入流程信息end

            //string lssql3 = "select * from hyt_flowtache where hy_flowid = 'flow0004'";//流程对应的环节
            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid);
            if (flowtachedt.Rows.Count > 0)
            {
                for (i = 0; i < flowtachedt.Rows.Count; i++)
                {
                    Hyoa_flowtache.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtache.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString();
                    Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowtache.hy_ifshowcurcomp = flowtachedt.Rows[i]["hy_ifshowcurcomp"].ToString();
                    Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString();
                    Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString();
                    Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString();
                    Hyoa_flowtache.hy_enablecondition = flowtachedt.Rows[i]["hy_enablecondition"].ToString();
                    Hyoa_flowtache.Insert();
                }
            }

            //string lssql4 = "select * from hyt_flowtachefield where hy_flowid='flow0004'";//流程环节对应的域
            HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
            DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid);
            if (flowtachefielddt.Rows.Count > 0)
            {
                for (i = 0; i < flowtachefielddt.Rows.Count; i++)
                {
                    Hyoa_flowtachefield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtachefield.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowtachefield.Insert();
                }
            }
            //string lssql5 = "select * from hyt_flowtacheuser where hy_flowid='flow0004'";//流程环节对应的用户
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid);
            if (flowtacheuserdt.Rows.Count > 0)
            {
                for (i = 0; i < flowtacheuserdt.Rows.Count; i++)
                {
                    Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtacheuser.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString();
                    Hyoa_flowtacheuser.Insert();
                }
            }
            //string lssql6 = "select * from hyt_flowwork where hy_flowid='flow0004'";//流程的下环节对应什么,即工作流
            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
            DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid);
            if (flowworkdt.Rows.Count > 0)
            {
                for (i = 0; i < flowworkdt.Rows.Count; i++)
                {
                    Hyoa_flowwork.ID = Hyoa_global.GetRandom();
                    Hyoa_flowwork.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString();
                    Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString();
                    Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString();
                    Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString();
                    Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString();
                    Hyoa_flowwork.hy_identity_type = flowworkdt.Rows[i]["hy_identity_type"].ToString();
                    Hyoa_flowwork.hy_identity_id = flowworkdt.Rows[i]["hy_identity_id"].ToString();
                    Hyoa_flowwork.hy_jscondition = flowworkdt.Rows[i]["hy_jscondition"].ToString();
                    Hyoa_flowwork.hy_jscondition1 = flowworkdt.Rows[i]["hy_jscondition1"].ToString();
                    Hyoa_flowwork.hy_jscondition2 = flowworkdt.Rows[i]["hy_jscondition2"].ToString();
                    Hyoa_flowwork.hy_zdcyuserids = flowworkdt.Rows[i]["hy_zdcyuserids"].ToString();
                    Hyoa_flowwork.Insert();
                }
            }
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
Beispiel #9
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        string ls_tip = "保存成功!";

        //string lssql1 = "SELECT * FROM hyt_flowfield WHERE hy_tableid = '" + this.lbtableidbysorce.Text + "'"; //得到配置字段
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        int i;
        DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.lbtableidbysorce.Text);
        string newtableid;
        newtableid = Hyoa_global.GetRandom();
        if (flowfielddt.Rows.Count > 0)
        {
            for (i = 0; i < flowfielddt.Rows.Count; i++)
            {
                Hyoa_flowfield.ID = Hyoa_global.GetRandom();
                Hyoa_flowfield.hy_tableid = newtableid;
                Hyoa_flowfield.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
                Hyoa_flowfield.hy_flowid = this.txtflowidbymd.Text;
                Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString();
                Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString();
                Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString();
                Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString();
                Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString());
                Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString();
                Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString());
                Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString();
                Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString();
                Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString();
                Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString();
                Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString();
                Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString();
                Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString();
                Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString();
                Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString();
                Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString();
                Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString());
                Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString();
                Hyoa_flowfield.hy_sort = System.Int32.Parse(flowfielddt.Rows[i]["hy_sort"].ToString());
                Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString());
                Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString();
                Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString();
                Hyoa_flowfield.Insert();
            }
        }

        HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); //hyt_tableconfig
        DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.lbmudelidbysource.Text);
        if (tableconfigdt.Rows.Count > 0)
        {
            Hyoa_tableconfig.ID = newtableid;
            Hyoa_tableconfig.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
            Hyoa_tableconfig.hy_name = this.txttablenamebymd.Text;
            Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString();
            Hyoa_tableconfig.hy_sort = System.Int32.Parse(this.txttablesortbymd.Text);
            Hyoa_tableconfig.hy_ifflowdoc = this.ddlifflowdoc.SelectedValue;
            Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString();
            Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString();
            Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString();
            Hyoa_tableconfig.Insert();
        }

        //以下为流程模块的功能,非流程模块不需要执行
        if (this.ddlifflowdoc.SelectedValue == "是")
        {
            //string lssql2 = "SELECT * FROM hyt_flowinfor WHERE hy_mudelid = 'bgyply'";//得到模块对应的流程
            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
            DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.lbmudelidbysource.Text);
            string lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString();//得到老模块的flowid 后面要用到
            //插入流程信息start
            Hyoa_flowinfor.hy_flowid = this.txtflowidbymd.Text;
            Hyoa_flowinfor.hy_flowname =this.txtflownamebymd.Text;
            Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtflowsortbymd.Text);
            Hyoa_flowinfor.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
            Hyoa_flowinfor.Insert();
            //插入流程信息end

            //string lssql3 = "select * from hyt_flowtache where hy_flowid = 'flow0004'";//流程对应的环节
            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid);
            if (flowtachedt.Rows.Count > 0)
            {
                for (i = 0; i < flowtachedt.Rows.Count; i++)
                {
                    Hyoa_flowtache.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtache.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString();
                    Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString();
                    Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString();
                    Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString();
                    Hyoa_flowtache.Insert();
                }
            }

            //string lssql4 = "select * from hyt_flowtachefield where hy_flowid='flow0004'";//流程环节对应的域
            HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
            DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid);
            if (flowtachefielddt.Rows.Count > 0)
            {
                for (i = 0; i < flowtachefielddt.Rows.Count; i++)
                {
                    Hyoa_flowtachefield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtachefield.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowtachefield.Insert();
                }
            }
            //string lssql5 = "select * from hyt_flowtacheuser where hy_flowid='flow0004'";//流程环节对应的用户
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid);
            if (flowtacheuserdt.Rows.Count > 0)
            {
                for (i = 0; i < flowtacheuserdt.Rows.Count; i++)
                {
                    Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtacheuser.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString();
                    Hyoa_flowtacheuser.Insert();
                }
            }
            //string lssql6 = "select * from hyt_flowwork where hy_flowid='flow0004'";//流程的下环节对应什么,即工作流
            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
            DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid);
            if (flowworkdt.Rows.Count > 0)
            {
                for (i = 0; i < flowworkdt.Rows.Count; i++)
                {
                    Hyoa_flowwork.ID = Hyoa_global.GetRandom();
                    Hyoa_flowwork.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString();
                    Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString();
                    Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString();
                    Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString();
                    Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString();
                    Hyoa_flowwork.Insert();
                }
            }
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
Beispiel #10
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        string ls_tip = "保存成功!";

        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
        HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
        HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();

        //先判断流程是否已经存在
        DataTable dt = Hyoa_flowinfor.Getflowinfor(this.txtFlowID.Value);
        if (dt.Rows.Count > 0)
        {
            Response.Write("<script>alert('该流程已存在,请重新填写!');history.back();</script>");
            return;
        }
        else
        {
            //添加流程信息
            Hyoa_flowinfor.hy_flowid = this.txtFlowID.Value;
            Hyoa_flowinfor.hy_flowname = this.txtFlowCh.Value;
            Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtFlowSort.Value);
            Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue;
            Hyoa_flowinfor.Insert();
            //添加环节信息
            DataTable dtflowtache = Hyoa_flowtache.Getflowtachebyflowid(this.txtSrcFlowID.Value);
            if (dtflowtache.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowtache.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowtache.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtache.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowtache.hy_tacheid = dtflowtache.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtache.hy_tachename = dtflowtache.Rows[i]["hy_tachename"].ToString();
                    Hyoa_flowtache.hy_sort = System.Int32.Parse(dtflowtache.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowtache.hy_ifshowcurdept = dtflowtache.Rows[i]["hy_ifshowcurdept"].ToString();
                    Hyoa_flowtache.hy_XValue = dtflowtache.Rows[i]["hy_XValue"].ToString();
                    Hyoa_flowtache.hy_YValue = dtflowtache.Rows[i]["hy_YValue"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendSms = dtflowtache.Rows[i]["hy_rdDoIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendMessage = dtflowtache.Rows[i]["hy_rdDoIsSendMessage"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendSms = dtflowtache.Rows[i]["hy_rdPassIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendMessage = dtflowtache.Rows[i]["hy_rdPassIsSendMessage"].ToString();
                    Hyoa_flowtache.Insert();
                }
            }
            //添加流转信息
            DataTable dtflowwork = Hyoa_flowwork.Getflowworksbyflowid(this.txtSrcFlowID.Value);
            if (dtflowwork.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowwork.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowwork.ID = Hyoa_global.GetRandom();
                    Hyoa_flowwork.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowwork.hy_curtacheid = dtflowwork.Rows[i]["hy_curtacheid"].ToString();
                    Hyoa_flowwork.hy_curtachename = dtflowwork.Rows[i]["hy_curtachename"].ToString();
                    Hyoa_flowwork.hy_nexttacheid = dtflowwork.Rows[i]["hy_nexttacheid"].ToString();
                    Hyoa_flowwork.hy_nexttachename = dtflowwork.Rows[i]["hy_nexttachename"].ToString();
                    Hyoa_flowwork.hy_sort = System.Int32.Parse(dtflowwork.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowwork.hy_actiontype = dtflowwork.Rows[i]["hy_actiontype"].ToString();
                    Hyoa_flowwork.Insert();
                }
            }
            //添加流程对应的域
            DataTable dtflowfield = Hyoa_flowfield.Getflowfieldsbyflowid(this.txtSrcFlowID.Value);
            if (dtflowfield.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowfield.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowfield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowfield.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowfield.hy_fieldid = dtflowfield.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowfield.hy_fieldname = dtflowfield.Rows[i]["hy_fieldname"].ToString();
                    Hyoa_flowfield.hy_fieldtype = dtflowfield.Rows[i]["hy_fieldtype"].ToString();
                    Hyoa_flowfield.hy_config = dtflowfield.Rows[i]["hy_config"].ToString();
                    Hyoa_flowfield.hy_sort = System.Int32.Parse(dtflowfield.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowfield.Insert();
                }
            }
            //添加流程环节对应的域
            DataTable dtflowtachefield = Hyoa_flowtachefield.Getflowtachefieldbyflowid(this.txtSrcFlowID.Value);
            if (dtflowtachefield.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowtachefield.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowtachefield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtachefield.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowtachefield.hy_tacheid = dtflowtachefield.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtachefield.hy_fieldid = dtflowtachefield.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowtachefield.Insert();
                }
            }
            //添加流程环节对应的人员
            DataTable dtflowtacheuser = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(this.txtSrcFlowID.Value);
            if (dtflowtacheuser.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowtacheuser.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtacheuser.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowtacheuser.hy_tacheid = dtflowtacheuser.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtacheuser.hy_userid = dtflowtacheuser.Rows[i]["hy_userid"].ToString();
                    Hyoa_flowtacheuser.Insert();
                }
            }
        }

        //处理完成后的提示及跳转
        Response.Write("<script>alert('" + ls_tip + "');window.opener.location.reload();self.close();</script>");
    }