当前位置: 首页>>代码示例>>C#>>正文


C# HyoaClass.Hyoa_flowfield类代码示例

本文整理汇总了C#中HyoaClass.Hyoa_flowfield的典型用法代码示例。如果您正苦于以下问题:C# HyoaClass.Hyoa_flowfield类的具体用法?C# HyoaClass.Hyoa_flowfield怎么用?C# HyoaClass.Hyoa_flowfield使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HyoaClass.Hyoa_flowfield类属于命名空间,在下文中一共展示了HyoaClass.Hyoa_flowfield类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckfmMainInput

    //保存或提交时的JS代码(判断是否必填项),动态架构    Written by xf 20110515
    public string CheckfmMainInput()
    {
        string ls_mid = "";
        if (this.Request.QueryString["mid"] != null)
        {
            ls_mid = this.Request.QueryString["mid"].ToString();
            if (ls_mid.Contains(","))
                ls_mid = ls_mid.Substring(0, ls_mid.IndexOf(","));
        }
        string ls_tableid = "";
        if (this.Request.QueryString["tableid"] != null)
        {
            ls_tableid = this.Request.QueryString["tableid"].ToString();
            if (ls_tableid.Contains(","))
                ls_tableid = ls_tableid.Substring(0, ls_tableid.IndexOf(","));
        }

        string ls_return = "";
        //如果是“可修改所有文档的权限人员”,则可以修改所有的字段,不需要提示是否必填了。
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString()))
        {
        }
        else
        {
            HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
            //根据模块ID和表单ID得到对应的配置字段
            DataTable dt_gettablecolumns = Hyoa_flowfield.GetflowfieldsbyMudelidAndTableid(ls_mid, ls_tableid);
            if (dt_gettablecolumns.Rows.Count > 0)
            {
                //判断是否必填
                for (int i = 0; i < dt_gettablecolumns.Rows.Count; i++)
                {
                    if (dt_gettablecolumns.Rows[i]["hy_required"].ToString() == "是")
                    {
                        if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "文本" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "多行文本" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "文本加按钮" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "多行文本加按钮" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "日期" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "口令")
                            ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".value==\"\"){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "不能为空!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".focus();return false;}}catch(err){}";

                        if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "数值")
                            ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".value==\"\"){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "不能为空!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".focus();return false;}if(isNaN(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".value)){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "必须为数值!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".focus();return false}}catch(err){}";

                        if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "对话框列表")
                            ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".selectedIndex==0){alert(\"请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".focus();return false;}}catch(err){}";

                        //if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "复选框")
                        //    ls_return += "try{var ls_select=\"\";var obj1=document.getElementsById(\"" + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "\");for(var i = 0; i < obj1.length; i++){if(obj1[i].checked){if(ls_select==\"\"){ls_select = obj1[i].value;}else{ls_select=ls_select+\"#\"+obj1[i].value;}}}if(ls_select==\"\"){alert('请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!');return false;}}catch(err){}";

                        //if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "单选框")
                        //    ls_return += "try{var ls_select=\"\";var obj1=document.getElementsById(\"" + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "\");for(var i = 0; i < obj1.length; i++){if(obj1[i].checked){if(ls_select==\"\"){ls_select = obj1[i].value;}else{ls_select=ls_select+\"#\"+obj1[i].value;}}}if(ls_select==\"\"){alert('请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!');return false;}}catch(err){}";
                    }
                    //哪个字段是待办事宜提醒的字段    edited by xf 20140625
                    if (dt_gettablecolumns.Rows[i]["hy_ifdbsybt"].ToString() == "是")
                    {
                        ls_return += "try{var d=document.getElementById('" + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "');if(d==null||typeof(d.value)=='undefined'){}else{document.getElementById('hy_bt').value=d.value;}}catch(err){}";
                    }
                }
            }
        }
        return ls_return;
    }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:61,代码来源:main.aspx.cs

示例2: btndelinfo_Click

    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));
    }
开发者ID:wjszxli,项目名称:Webapp,代码行数:33,代码来源:list_flowconfig.aspx.cs

示例3: btndelinfo_Click

 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
     String[] v_uids = this.txtuids.Value.Split(',');
     for (var i = 0; i < v_uids.Length; i++)
     {
         if (v_uids[i] != "")
         {
             Hyoa_flowfield.ID = v_uids[i];
             Hyoa_flowfield.Delete();
         }
     }
     this.txtuids.Value = "";
     //DataPlay(1);
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
开发者ID:wjszxli,项目名称:Webapp,代码行数:16,代码来源:list_flowfield.aspx.cs

示例4: CheckfmMainInput

    //保存或提交时的JS代码(判断是否必填项),动态架构    Written by xf 20110515
    public string CheckfmMainInput()
    {
        string ls_mid = "";
        if (this.Request.QueryString["mid"] != null)
        {
            ls_mid = this.Request.QueryString["mid"].ToString();
            if (ls_mid.Contains(","))
                ls_mid = ls_mid.Substring(0, ls_mid.IndexOf(","));
        }
        string ls_tableid = "";
        if (this.Request.QueryString["tableid"] != null)
        {
            ls_tableid = this.Request.QueryString["tableid"].ToString();
            if (ls_tableid.Contains(","))
                ls_tableid = ls_tableid.Substring(0, ls_tableid.IndexOf(","));
        }

        string ls_return = "";
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        //根据模块ID和表单ID得到对应的配置字段
        DataTable dt_gettablecolumns = Hyoa_flowfield.GetflowfieldsbyMudelidAndTableid(ls_mid, ls_tableid);
        if (dt_gettablecolumns.Rows.Count > 0)
        {
            //判断是否必填
            for (int i = 0; i < dt_gettablecolumns.Rows.Count; i++)
            {
                if (dt_gettablecolumns.Rows[i]["hy_required"].ToString() == "是")
                {
                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "文本" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "多行文本" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "文本加按钮" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "多行文本加按钮" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "日期" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "口令")
                        ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1.value==\"\"){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "不能为空!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1.focus();return false;}}catch(err){}";

                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "数值")
                        ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1.value==\"\"){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "不能为空!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1.focus();return false;}if(isNaN(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1.value)){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "必须为数值!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1.focus();return false}}catch(err){}";

                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "对话框列表")
                        ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1.selectedIndex==0){alert(\"请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1.focus();return false;}}catch(err){}";

                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "复选框")
                        ls_return += "try{var ls_select=\"\";var obj1=document.getElementsByName(\"" + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1\");for(var i = 0; i < obj1.length; i++){if(obj1[i].checked){if(ls_select==\"\"){ls_select = obj1[i].value;}else{ls_select=ls_select+\"#\"+obj1[i].value;}}}if(ls_select==\"\"){alert('请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!');return false;}}catch(err){}";

                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "单选框")
                        ls_return += "try{var ls_select=\"\";var obj1=document.getElementsByName(\"" + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "_1\");for(var i = 0; i < obj1.length; i++){if(obj1[i].checked){if(ls_select==\"\"){ls_select = obj1[i].value;}else{ls_select=ls_select+\"#\"+obj1[i].value;}}}if(ls_select==\"\"){alert('请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!');return false;}}catch(err){}";
                }
            }
        }
        return ls_return;
    }
开发者ID:wjszxli,项目名称:Webapp,代码行数:48,代码来源:main.aspx.cs

示例5: btndelinfo_Click

 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
     HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
     String[] v_uids = this.txtuids.Value.Split(',');
     for (var i = 0; i < v_uids.Length; i++)
     {
         if (v_uids[i] != "")
         {
             //找到字段配置信息
             DataTable dt = Hyoa_flowfield.Getflowfield(v_uids[i]);
             //删除SQL中的字段
             string sql = "ALTER TABLE hyc_" + this.txttableid.Value;
             sql += " DROP COLUMN hyc_" + dt.Rows[0]["hy_fieldid"].ToString();
             Hyoa_global.ExcuteSQL(sql);
             Hyoa_flowfield.ID = v_uids[i];
             Hyoa_flowfield.Delete();
         }
     }
     this.txtuids.Value = "";
     //DataPlay(1);
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:23,代码来源:list_flowfield.aspx.cs

示例6: hyjs

 public string hyjs()
 {
     //输出查询字段的JS start
     HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield();
     DataTable dtlistsearch = Hyoa_listsearchfield.GetlistsearchfieldsbyMudelidAndTableid(this.txtmudelid.Value,this.txttableid.Value);
     HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
     DataTable dtgetsqlfield;
     string ls_return = "";
     string fieldfz = "";//对应域JS域值
     ls_return += "<script>function jssearch()"; //js生成
     ls_return += "{fm = document.forms[0];";//js生成
     for (int t = 0; t < dtlistsearch.Rows.Count; t++)
     {
         //根据模块ID和当前域名和表名id得到SQL字段 ztmztm
         dtgetsqlfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.txtmudelid.Value, dtlistsearch.Rows[t]["hy_fieldid"].ToString(), this.txttableid.Value);
         fieldfz = "fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + ".value = fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_1.value;";
         if (dtgetsqlfield.Rows[0]["hy_fieldtype"].ToString()=="数值")
         {
             fieldfz = "fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_start.value = fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1.value;";
             fieldfz += "fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_end.value = fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1.value;";
         }
         if (dtgetsqlfield.Rows[0]["hy_fieldtype"].ToString() == "日期")
         {
             fieldfz = "fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_start.value = fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1.value;";
             fieldfz += "fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_end.value = fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1.value;";
         }
         if (dtgetsqlfield.Rows[0]["hy_fieldtype"].ToString() == "对话框列表")
         {
             //document.forms[0].fNumber(域名).options[document.forms[0].fNumber(域名).selectedIndex].text
             fieldfz += "fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + ".value = fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_1.options[fm." + dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString() + "_1.selectedIndex].text;";
         }
         ls_return += fieldfz;
         dtgetsqlfield.Clear();
     }
     ls_return += "fm.btnsearch.click();";//js生成
     ls_return += "}</script>";//js生成
     return ls_return;
 }
开发者ID:wjszxli,项目名称:Webapp,代码行数:38,代码来源:list_db.aspx.cs

示例7: GetFieldHtml

    //得到某一个字段的HTML
    //pi_flag 0:不赋值  1:需赋值
    //ifsearch:是否查询时使用 0:非查询时使用 1:查询时使用
    public string GetFieldHtml(string hy_mudelid, string hy_fieldid, string pi_flag, string hy_tableid, string ifsearch)
    {
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(hy_mudelid, hy_fieldid, hy_tableid);
        HyoaClass.DAO db = new HyoaClass.DAO();
        string lsField = "";
        string field_css = "";
        string field_value = "";
        string field_functionhy_onclick = "";
        string field_functionhy_ondblclick = "";
        string field_functionhy_onchange = "";
        string field_functionhy_onkeydown = "";
        string field_functionhy_onkeyup = "";

        if (dtfield.Rows.Count > 0)
        {
            //得到该字段的样式start
            if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
            {
                if (ifsearch == "0")
                    field_css += " readonly ";
            }
            if (dtfield.Rows[0]["hy_class"].ToString() != "")
            {
                field_css += " class='" + dtfield.Rows[0]["hy_class"].ToString() + "' ";
            }
            if (dtfield.Rows[0]["hy_width"].ToString() != "")
            {
                field_css += " style='width:" + dtfield.Rows[0]["hy_width"].ToString() + ";";
            }
            else
            {
                field_css += " style='";
            }
            if (dtfield.Rows[0]["hy_height"].ToString() != "")
            {
                field_css += " height:" + dtfield.Rows[0]["hy_height"].ToString() + "'";
            }
            else
            {
                field_css += "'";
            }

            //默认值
            //默认值取值的方式,查询时不使用默认值
            if (ifsearch == "0")
            {
                if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "")
                {
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0")
                        field_value += dtfield.Rows[0]["hy_defaultvalue"].ToString();

                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1")
                    {
                        DataTable dtdefault = db.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString());
                        if (dtdefault.Rows.Count > 0)
                            field_value += dtdefault.Rows[0][0].ToString();
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2")
                    {
                        field_value += Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString();
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3")
                    {
                        if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                            field_value += System.DateTime.Now.ToShortDateString();
                        else
                            field_value += System.DateTime.Now.ToString();
                    }
                }
            }

            //事件
            if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
            {
                field_functionhy_onclick += " onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" ";
            }
            if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
            {
                field_functionhy_ondblclick += " ondblclick=\"" + dtfield.Rows[0]["hy_ondblclick"].ToString() + "\" ";
            }
            if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
            {
                field_functionhy_onchange += " onchange=\"" + dtfield.Rows[0]["hy_onchange"].ToString() + "\" ";
            }
            if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
            {
                field_functionhy_onkeydown += " onkeydown=\"" + dtfield.Rows[0]["hy_onkeydown"].ToString() + "\" ";
            }
            if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
            {
                field_functionhy_onkeyup += " onkeyup=\"" + dtfield.Rows[0]["hy_onkeyup"].ToString() + "\" ";
            }
            //得到该字段的样式end
            string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString();
            //单行文本
            if (field_type == "文本")
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:Webapp,代码行数:101,代码来源:list_db.aspx.cs

示例8: GetSearchTableHtml

    //输出查询字段的表格(查询输入框)
    public void GetSearchTableHtml()
    {
        HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield();
        DataTable dtlistsearch = new DataTable();
        if (this.txtlistid.Value == "")
        {
            dtlistsearch = Hyoa_listsearchfield.GetlistsearchfieldsbyMudelidAndTableid(this.txtmudelid.Value, this.txttableid.Value);
        }
        else
        {
            dtlistsearch = Hyoa_listsearchfield.Getlistsearchfieldsbylistid(this.txtlistid.Value);
        }
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        //得到表单配置信息
        HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
        DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.txttableid.Value);

        int li_colnums_show = int.Parse(dt_tableconfig.Rows[0]["hy_colnum"].ToString()) / 2;    //一行显示几列
        int li_rows_show = 0;   //一共有几行
        int li_ifaddcols = 0;   //所有列显示完成后,是否需要补齐显示列 0:否 1:是
        int li_addcols = 0;     //需要补齐的列数量
        if (dtlistsearch.Rows.Count % li_colnums_show == 0)
        {
            li_rows_show = dtlistsearch.Rows.Count / li_colnums_show;
            li_ifaddcols = 0;
        }
        else
        {
            li_rows_show = (dtlistsearch.Rows.Count / li_colnums_show) + 1;
            li_ifaddcols = 1;
            li_addcols = li_colnums_show - (dtlistsearch.Rows.Count % li_colnums_show);
        }
        for (int i = 0; i < li_rows_show; i++)
        {
            TableRow tRow = new TableRow();
            tb_search.Rows.Add(tRow);
            for (int j = 0; j < li_colnums_show; j++)
            {
                //dtlistsearch中的记录行数
                int t = i * li_colnums_show + j;
                if ((t + 1) > dtlistsearch.Rows.Count)
                {
                    break;
                }
                //得到hyt_listsearchfield表中的hy_fieldid,
                GetFieldHtml(tRow, li_colnums_show, dtlistsearch.Rows[t]["hy_fieldid"].ToString());
            }
            //如果最后一行的列没有显示完整,则补齐
            if (li_ifaddcols == 1 && i == (li_rows_show - 1))
            {
                for (int k = 0; k < li_addcols; k++)
                {
                    TableCell tCell8 = new TableCell();
                    tRow.Cells.Add(tCell8);
                    tCell8.Height = Unit.Pixel(30);
                    tCell8.CssClass = "Tdcellleft";
                    tCell8.HorizontalAlign = HorizontalAlign.Center;
                    tCell8.Controls.Add(new LiteralControl("&nbsp;"));
                    TableCell tCell9 = new TableCell();
                    tRow.Cells.Add(tCell9);
                    tCell9.Height = Unit.Pixel(30);
                    tCell9.CssClass = "Tdcellright";
                    tCell9.HorizontalAlign = HorizontalAlign.Center;
                    tCell9.Controls.Add(new LiteralControl("&nbsp;"));
                }
            }
        }
        //插入查询按钮行
        TableRow tRow2 = new TableRow();
        tb_search.Rows.Add(tRow2);
        TableCell tCell3 = new TableCell();
        tRow2.Cells.Add(tCell3);
        tCell3.Height = Unit.Pixel(30);
        tCell3.CssClass = "Tdcellright";
        tCell3.HorizontalAlign = HorizontalAlign.Right;
        tCell3.ColumnSpan = li_colnums_show * 2;
        Button btnButton = new Button();
        btnButton.ID = "btnsearch_ht";
        btnButton.Text = " 查 询";
        btnButton.CssClass = "btn7";
        btnButton.Click += new EventHandler(btnsearch_Click);
        tCell3.Controls.Add(btnButton);
    }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:84,代码来源:list_selfdept.aspx.cs

示例9: GetFieldHtml

    //输出一个字段
    //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();
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:101,代码来源:main_look.aspx.cs

示例10: btnDRToSQL_Click


//.........这里部分代码省略.........
            lsTablekdjrht.Add("xmssjclf");

        }

        //信息化工程合同
        else if (this.tableid.Value == "Tablezdyht")
        {
            //合同编号
            lsTablekdjrht.Add("htbh");
            //单位名称
            lsTablekdjrht.Add("jfmc");
            //乙方名称
            lsTablekdjrht.Add("yfmc");
            //丙方名称
            lsTablekdjrht.Add("bfmc");
            //合同名称
            lsTablekdjrht.Add("htmc");
            //合同金额
            lsTablekdjrht.Add("htje");
            //签订时间
            lsTablekdjrht.Add("qdsj");
            //起始日期
            lsTablekdjrht.Add("htkssj");
            //结束日期
            lsTablekdjrht.Add("htzzsj");
            //合同内容
            lsTablekdjrht.Add("htnr");
            //负责人
            lsTablekdjrht.Add("fzr");

        }

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

        //链接SQL数据库
        if (FileUpload1.HasFile == false)   //HasFile用来检查FileUpload是否有指定文件
        {
            Response.Write("<script>alert('请您选择Excel文件')</script> ");
            return; //当无文件时,返回
        }
        string IsXls = System.IO.Path.GetExtension(FileUpload1.FileName).ToString().ToLower();  //System.IO.Path.GetExtension获得文件的扩展名
        if (IsXls != ".xls" && IsXls != ".xlsx")
        {
            Response.Write("<script>alert('只可以选择Excel文件')</script>");
            return; //当选择的不是Excel文件时,返回
        }

        //根据年份判断在该路径下是否存在以当年年份文件夹 否则将建立以该年份的文件夹
        string ls_ny = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
        //HttpContext.Current.Server.MapPath(相对路径):把相对路径转为服务器上的绝对路径。File.Exists(绝对路径):检查是否存在绝对路径指向的文件或目录。
        if (!Directory.Exists(HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny))
        {
            //System.IO.Directory.CreateDirectory(文件夹绝对路径):建立绝对路径文件夹。
            System.IO.Directory.CreateDirectory(@HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny);
        }
        string filename = DateTime.Now.ToString("hhMMss") + FileUpload1.FileName;              //重新为文件命名,获取Execle文件名  DateTime日期函数

        // 保存文件到路径,用Server.MapPath()取当前文件的绝对目录.在asp.net里""必须用"\"代替
        string savePath = Server.MapPath(("~\\upload/" + ls_ny + "\\") + filename);//Server.MapPath 获得虚拟服务器相对路径

        FileUpload1.SaveAs(savePath);                        //SaveAs 将上传的文件内容保存在服务器上
        DataSet ds = ExecleDs(savePath, filename);           //调用自定义方法
        DataRow[] dr = ds.Tables[0].Select();            //定义一个DataRow数组
        int rowsnum = ds.Tables[0].Rows.Count;
        int i_into = 0;
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:67,代码来源:import_excel_ht.aspx.cs

示例11: DataPlay

    private void DataPlay()
    {
        //是否启用
        this.ddlifsearch.Items.Insert(0, "是");
        this.ddlifsearch.Items.Insert(1, "否");
        this.ddlifflowdoc.Items.Insert(0, "是");
        this.ddlifflowdoc.Items.Insert(1, "否");
        this.ddlifshowsearch.Items.Insert(0, "是");
        this.ddlifshowsearch.Items.Insert(1, "否");
        //模块编号
        //加载模块信息
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dtmudel = Hyoa_mudel.Getmudels();
        if (dtmudel.Rows.Count > 0)
        {
            this.ddlmudelid.DataSource = dtmudel;
            this.ddlmudelid.DataTextField = "hy_mudelname";
            this.ddlmudelid.DataValueField = "hy_mudelid";
            this.ddlmudelid.DataBind();
            this.ddlmudelid.Items.Insert(0, new ListItem("请选择", "请选择"));
            this.ddlmudelid.SelectedIndex = 0;
        }

        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //判断当前用户是否有保存的权限
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
            {
                this.btn_submit.Visible = true; //保存
            }
            else
            {
                this.btn_submit.Visible = false; //保存
            }

            //旧文档
            HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
            if (this.Request.QueryString["op"] == "modify")
            {
                if (this.Request.QueryString["id"] != null)
                {
                    //根据id得到信息
                    this.txtdocid.Value = this.Request.QueryString["id"].ToString();
                    DataTable dt = Hyoa_listconfig.Getlistconfig(this.txtdocid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.txtsort.Text = dt.Rows[0]["hy_sort"].ToString();
                        if (dt.Rows[0]["hy_ifsearch"].ToString() == "是")
                        {
                            this.ddlifsearch.SelectedIndex = 0;
                        }
                        else
                        {
                            this.ddlifsearch.SelectedIndex = 1;
                        }
                        if (dt.Rows[0]["hy_ifshowsearch"].ToString() != "否")
                        {
                            this.ddlifshowsearch.SelectedIndex = 0;
                        }
                        else
                        {
                            this.ddlifshowsearch.SelectedIndex = 1;
                        }
                        this.ddlmudelid.SelectedValue = dt.Rows[0]["hy_mudelid"].ToString();
                        if (dt.Rows[0]["hy_ifflowdoc"].ToString() == "是")
                        {
                            this.ddlifflowdoc.SelectedIndex = 0;
                        }
                        else
                        {
                            this.ddlifflowdoc.SelectedIndex = 1;
                        }
                        this.txthy_listname.Text = dt.Rows[0]["hy_listname"].ToString();
                        this.txtwidth.Text = dt.Rows[0]["hy_width"].ToString();

                        //加载所有列信息
                        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
                        DataTable dtflowfield;

                        //dtflowfield = Hyoa_flowfield.Getflowfields();
                        dtflowfield = Hyoa_flowfield.GetflowfieldsbyMudelidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_tableid"].ToString());
                        if (dtflowfield.Rows.Count > 0)
                        {
                            this.ddlcolumnshow.DataSource = dtflowfield;
                            this.ddlcolumnshow.DataTextField = "hy_fieldname";
                            this.ddlcolumnshow.DataValueField = "hy_fieldid";
                            this.ddlcolumnshow.DataBind();
                            this.ddlcolumnshow.SelectedIndex = 0;
                        }
                        dtflowfield.Clear();

                        //将列都列出来
                        string[] lv_columnshowselect;
                        string[] lv_columnshowselectid;
                        lv_columnshowselect = dt.Rows[0]["hy_columnshow"].ToString().Split(',');
                        lv_columnshowselectid = dt.Rows[0]["hy_columnshowid"].ToString().Split(',');
                        for (int j = 0; j < lv_columnshowselect.Length; j++)
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:101,代码来源:main_listconfig.aspx.cs

示例12: getExcelContent

    //需要导出的内容
    private string getExcelContent()
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //根据表ID和模块ID得到当前传进来的模块是否有流程
        HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
        DataTable dttableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.txtmudelid.Value, this.txttableid.Value);

        //根据表单得到对应的所有字段
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        DataTable dtflowfield = Hyoa_flowfield.Getflowfieldsbytableid(dttableconfig.Rows[0]["ID"].ToString());
        //循环所有字段
        string ls_flowfield = "";
        if (dtflowfield.Rows.Count > 0)
        {
            for (int i = 0; i < dtflowfield.Rows.Count; i++)
            {
                string ls_fieldtype = dtflowfield.Rows[i]["hy_fieldtype"].ToString();
                if (ls_fieldtype == "文本" || ls_fieldtype == "多行文本" || ls_fieldtype == "文本加按钮" || ls_fieldtype == "多行文本加按钮" || ls_fieldtype == "日期" || ls_fieldtype == "数值" || ls_fieldtype == "对话框列表" || ls_fieldtype == "复选框" || ls_fieldtype == "单选框" || ls_fieldtype == "口令")
                {
                    ls_flowfield += ",a.hyc_" + dtflowfield.Rows[i]["hy_fieldid"].ToString();
                }
            }
        }

        HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
        DataTable dtlist = Hyoa_listconfig.Getlistconfig(this.txtlistid.Value);     //列表配置

        #region ---查询条件---
        string cmdStr_Search = "";
        if (txtsearchfields.Text != "")
        {
            string[] lv_searchfields = txtsearchfields.Text.Split(',');
            string[] lv_searchfields_sx = txtsearchfields_sx.Text.Split(',');
            for (int i = 0; i < lv_searchfields.Length; i++)
            {
                string ls_fieldid = lv_searchfields[i].ToString();
                string ls_fieldid_sx = lv_searchfields_sx[i].ToString();
                string ls_searchtext = "";
                if (this.Request.Form[ls_fieldid] != null)
                {
                    ls_searchtext = this.Request.Form[ls_fieldid].ToString();
                }
                if (ls_searchtext != "")
                {
                    if (ls_fieldid_sx == "0")
                    {
                        cmdStr_Search += " and hyc_" + ls_fieldid + " like '%" + ls_searchtext + "%' ";
                    }
                    else
                    {
                        if (ls_fieldid_sx == "1")
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                cmdStr_Search += " and left(CONVERT(varchar, hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ", 120 ) ,10) >= '" + ls_searchtext + "' ";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                cmdStr_Search += " and to_char(hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ",'YYYY-MM-DD') >= '" + ls_searchtext + "' ";
                            }
                        }
                        if (ls_fieldid_sx == "2")
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                cmdStr_Search += " and left(CONVERT(varchar, hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ", 120 ) ,10) <= '" + ls_searchtext + "' ";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                cmdStr_Search += " and to_char(hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ",'YYYY-MM-DD') <= '" + ls_searchtext + "' ";
                            }
                        }
                        if (ls_fieldid_sx == "3")
                        {
                            cmdStr_Search += " and hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + " >= " + ls_searchtext + " ";
                        }
                        if (ls_fieldid_sx == "4")
                        {
                            cmdStr_Search += " and hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + " <= " + ls_searchtext + " ";
                        }
                    }
                }
            }
        }
        #endregion ---查询条件---

        #region ---排序---
        string cmdStr_SearchSort = "";
        if (dtlist.Rows[0]["hy_sortfield1"].ToString() != "")
        {
            if (cmdStr_SearchSort == "")
            {
                cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield1"].ToString() + " " + dtlist.Rows[0]["hy_sorttype1"].ToString();
            }
            else
            {
                cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield1"].ToString() + " " + dtlist.Rows[0]["hy_sorttype1"].ToString();
            }
        }
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:101,代码来源:list_flc_search.aspx.cs

示例13: Button_Save_Click

    //保存
    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);

//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:101,代码来源:main_tablecopy.aspx.cs

示例14: ExpertControl

    /// <summary>
    /// 将Web控件导出
    /// </summary>
    /// <param name="source">控件实例</param>
    /// <param name="type">类型:Excel或Word</param>
    public void ExpertControl(string ls_ids, DocumentType type)
    {
        //设置Http的头信息,编码格式
        if (type == DocumentType.Excel)
        {
            //Excel
            Response.AppendHeader("Content-Disposition", "attachment;filename=result.xls");
            Response.ContentType = "application/ms-excel";
        }
        else if (type == DocumentType.Word)
        {
            //Word
            Response.AppendHeader("Content-Disposition", "attachment;filename=result.doc");
            Response.ContentType = "application/ms-word97";
        }
        Response.Charset = "Default";
        Response.ContentEncoding = System.Text.Encoding.Default;

        //关闭控件的视图状态
        //source.Page.EnableViewState = false;

        //初始化HtmlWriter
        //System.IO.StringWriter writer = new System.IO.StringWriter();
        //System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(writer);
        //source.RenderControl(htmlWriter);

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

        //根据模块ID+表单ID得到对应的域
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        DataTable dt_flowfield = Hyoa_flowfield.GetflowfieldsbyMudelidAndTableid(ls_mid, ls_tableid);

        string[] lv_left = new string[dt_flowfield.Rows.Count];
        double[] lv_tatal = new double[dt_flowfield.Rows.Count];
        string[] lv_right = new string[dt_flowfield.Rows.Count];
        for (int i = 0; i < dt_flowfield.Rows.Count; i++)
        {
            if (dt_flowfield.Rows[i]["hy_sqlfield"].ToString().Contains("hy_field"))
            {
                if (dt_flowfield.Rows[i]["hy_fieldname"].ToString().IndexOf('(') >= 0 && dt_flowfield.Rows[i]["hy_fieldname"].ToString().IndexOf(')') >= 0)
                {
                    lv_left[i] = dt_flowfield.Rows[i]["hy_fieldname"].ToString().Substring(0, dt_flowfield.Rows[i]["hy_fieldname"].ToString().LastIndexOf('('));
                    lv_tatal[i] = 0;
                    lv_right[i] = dt_flowfield.Rows[i]["hy_fieldname"].ToString().Substring(dt_flowfield.Rows[i]["hy_fieldname"].ToString().LastIndexOf('(') + 1, dt_flowfield.Rows[i]["hy_fieldname"].ToString().Length - dt_flowfield.Rows[i]["hy_fieldname"].ToString().LastIndexOf('(') - 2);
                }
                else
                {
                    lv_left[i] = dt_flowfield.Rows[i]["hy_fieldname"].ToString();
                    lv_tatal[i] = 0;
                    lv_right[i] = "";
                }
            }
        }

        //得到数据
        HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
        string[] lv_ids = ls_ids.Split(',');
        for (var i = 0; i < lv_ids.Length; i++)
        {
            if (lv_ids[i] != "")
            {
                DataTable dt = Hyoa_flowmain.Getflowmain(lv_ids[i]);
                if (dt.Rows.Count > 0)
                {
                    if (dt_flowfield.Rows.Count > 0)
                    {
                        for (var j = 0; j < dt_flowfield.Rows.Count; j++)
                        {
                            if (dt_flowfield.Rows[j]["hy_sqlfield"].ToString().Contains("hy_field"))
                            {
                                if (dt.Rows[0][dt_flowfield.Rows[j]["hy_sqlfield"].ToString()].ToString() == "")
                                    lv_tatal[j] = lv_tatal[j];
                                else
                                    lv_tatal[j] = lv_tatal[j] + double.Parse(dt.Rows[0][dt_flowfield.Rows[j]["hy_sqlfield"].ToString()].ToString());

                                //if (j < dt_flowfield.Rows.Count - 1)
                                //{
                                //    Response.Write(dt_flowfield.Rows[j]["hy_fieldname"].ToString() + ":");
                                //    Response.Write(dt.Rows[0][dt_flowfield.Rows[j]["hy_sqlfield"].ToString()].ToString() + ",");
                                //}
                            }
                        }
                        //Response.Write("\n");
                        //Response.Write("\n");
                    }
                }
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:Webapp,代码行数:101,代码来源:doc.aspx.cs

示例15: Button_Save_Click

    //保存
    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();
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:Webapp,代码行数:101,代码来源:main_tablecopy.aspx.cs


注:本文中的HyoaClass.Hyoa_flowfield类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。