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


C# HyoaClass.Hyoa_global.isHaveRole方法代码示例

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


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

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string ls_docids="";
        string ls_filepath="";

        if (this.Request.QueryString["docids"] != null)
        {
            ls_docids = this.Request.QueryString["docids"].ToString();
        }
        string[] lv_docids;
        lv_docids = ls_docids.Split(',');
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        DataTable dt = new DataTable();
        for (int j = 0; j < lv_docids.Length; j++)
        {
            dt = Hyoa_fileatt.Getfileatt(lv_docids[j]);
            if (dt.Rows[0]["hy_userid"].ToString() == Session["hyuid"].ToString() || Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString()))
            {
                ls_filepath = Server.MapPath("~/") + dt.Rows[0]["hy_filepath"].ToString();
                //this.Response.Write(ls_filepath);
                //return;
                if (File.Exists(ls_filepath))
                {
                    System.IO.File.Delete(ls_filepath);
                }
                Hyoa_fileatt.ID = lv_docids[j];
                Hyoa_fileatt.Delete();
            }
            dt.Clear();
        }
        this.Response.Write("aaa");
        return ;
    }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:34,代码来源:Hy_delfileatt.aspx.cs

示例2: 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

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            if (this.Request.QueryString["pop"] != null)
            {
                this.txtifpop.Value = this.Request.QueryString["pop"].ToString();   //是否弹出窗口
            }
            //esppath = Server.MapPath("esp");
            //if (this.Session["hyuid"].ToString() == "")
            //    this.Response.Redirect("../login.aspx");
            if (Request.QueryString["url"] != null)
            {
                this.url.Value = Request.QueryString["url"].ToString();
            }
            if (Request.QueryString["espid"] != null)
            {
                this.txtdocid.Value = Request.QueryString["espid"].ToString();
            }
            //按钮控制
            this.tdCreateNew.Visible = false;
            this.tdSave.Visible = false;

            //判断当前用户是否有新建删除权限
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string ls_mudelid = "Mudelfwgl";
            string ls_role = "";
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_mudel = Hyoa_mudel.Getmudel(ls_mudelid);
            if (dt_mudel.Rows.Count > 0)
            {
                ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();
            }
            if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
            {
                if (Request.QueryString["op"] != null)
                {
                    string ls_op = Request.QueryString["op"].ToString();
                    txtop.Value = ls_op;
                    if (ls_op == "add")
                    {
                        this.tdCreateNew.Visible = true;
                        this.tdSave.Visible = true;
                        this.txtdocid.Value = Hyoa_global.GetRandom();
                    }
                }
            }

        }
    }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:50,代码来源:espedit.aspx.cs

示例4: hy_nav

 public string hy_nav()
 {
     string hy_nav = "";
     HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
     //得到一级目录
     HyoaClass.Hyoa_ml Hyoa_ml = new HyoaClass.Hyoa_ml();
     DataTable dt = Hyoa_ml.GetFirstmls();
     if (dt.Rows.Count > 0)
     {
         string ls_flag1 = "0"; //无权限
         int j = 0;
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             ls_flag1 = "0";
             //输出一级
             if (dt.Rows[i]["hy_role"].ToString() == "" || dt.Rows[i]["hy_role"] == null)
             {
                 ls_flag1 = "1";     //有权限(没有设置role)
             }
             else
             {
                 if (Hyoa_global.isHaveRole(dt.Rows[i]["hy_role"].ToString(), Session["hyuid"].ToString()))
                 {
                     ls_flag1 = "1"; //有权限
                 }
             }
             if (dt.Rows[i]["hy_ifqy"].ToString() != "是")
             {
                 //未启用,直接赋为无权限
                 ls_flag1 = "0";
             }
             if (ls_flag1 == "1")
             {
                 hy_nav += "<div id=\"div_" + i.ToString() + "\" title=\"<img src=" + dt.Rows[i]["hy_pic"].ToString() + " /> " + dt.Rows[i]["MLName"].ToString() + "\" iconcss=\"menu-icon-model\" class=\"l-scroll\" >";
                 hy_nav += "<ul id=\"global_channel_tree" + (j + 1).ToString() + "\" style=\"margin-top: 3px;\">";
                 hy_nav += GetSecMl(dt.Rows[i]["MLID"].ToString());
                 hy_nav += "</ul>";
                 hy_nav += "</div>";
                 j += 1;
             }
         }
     }
     return hy_nav;
 }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:44,代码来源:index_style1.aspx.cs

示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        if (!this.IsPostBack)
        {
            if (this.Request.QueryString["flowid"] != null)
            {
                string ls_flowid = this.Request.QueryString["flowid"].ToString();
                this.txtflowid.Value = ls_flowid;

                //判断一下是否是管理员
                HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()) == true)
                {
                    HyoaClass.Hyoa_lcdz Hyoa_lcdz = new HyoaClass.Hyoa_lcdz();
                    //制作流程图
                    this.txtFlowXML.Value = Hyoa_lcdz.GetXmlBody(ls_flowid);
                }
            }
        }
    }
开发者ID:wjszxli,项目名称:Webapp,代码行数:23,代码来源:Hy_lcdz.aspx.cs

示例6: DataPlay

    private void DataPlay()
    {
        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; //保存
            }

            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                if (this.Request.QueryString["id"] != null)
                {
                    //根据id得到信息
                    this.txtdocid.Value = this.Request.QueryString["id"].ToString();
                    HyoaClass.Hyoa_link Hyoa_link = new HyoaClass.Hyoa_link();
                    DataTable dt = Hyoa_link.Getlink(this.txtdocid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.txtsort.Value = dt.Rows[0]["hy_sort"].ToString();
                        this.txtname.Value = dt.Rows[0]["hy_linkname"].ToString();
                        this.txtlink.Value = dt.Rows[0]["hy_linkurl"].ToString();
                    }
                    dt.Clear();
                }
            }
        }
    }
开发者ID:wjszxli,项目名称:Webapp,代码行数:37,代码来源:main_link.aspx.cs

示例7: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        if (!this.IsPostBack)
        {
            //判断是否有权限
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
            {

            }
            else
            {
                this.tdsave.Visible = false;
                Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>");
            }
            if (this.Request.QueryString["userid"] != null)
            {
                this.txtuserid.Value = this.Request.QueryString["userid"].ToString();
            }
        }
    }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:24,代码来源:Hy_XgmmByAdmin.aspx.cs

示例8: DataPlay

    private void DataPlay(int PageNo)
    {
        //得到当前模块对应的role
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
        string ls_role = "Rolegwk";
        if (dt_mudel.Rows.Count > 0)
            ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();

        //判断当前用户是否有删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.tddeldoc.Visible = true; //删除
            this.tdnewdoc.Visible = true;//新建
        }
        else
        {
            this.isrole.Value = "0";
            this.tddeldoc.Visible = false; //删除
            this.tdnewdoc.Visible = false;//新建
        }

        //得到当前页号
        this.curpage.Text = PageNo.ToString();

        //已流转完成的全局公告
        string sql = "";
        string lstypeid = "";
        if (this.Request.QueryString["type"] != null)
        {
            lstypeid = this.Request.QueryString["type"].ToString();
        }
        sql = "select * from hyp_gwk where 1=1";

        if (this.hy_djsj_start_1.Value != "")
        {
            if (Session["conntype"].ToString() == "SQL")
            {
                sql += " and hy_djsj>='" + this.hy_djsj_start_1.Value + "' ";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                sql += " and to_char(hy_djsj,'YYYY-MM-DD')>='" + this.hy_djsj_start_1.Value + "' ";
            }
        }
        if (this.hy_djsj_end_1.Value != "")
        {
            if (Session["conntype"].ToString() == "SQL")
            {
                sql += " and hy_djsj<='" + this.hy_djsj_end_1.Value + "' ";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                sql += " and to_char(hy_djsj,'YYYY-MM-DD')<='" + this.hy_djsj_end_1.Value + "' ";
            }
        }
        if (this.hy_bt_1.Value != "")
            sql += " and hy_bt like '%" + this.hy_bt_1.Value + "%' ";

        if (this.hy_wh_1.Value != "")
            sql += " and hy_wh like '%" + this.hy_wh_1.Value + "%' ";

        if (lstypeid != "")
            sql += " and hy_typeid = '" + lstypeid + "' ";

        sql += " order by hy_djsj desc ";

        DataTable dt = Hyoa_global.GetDataTable(sql);
        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("lookfileatt", typeof(String)); //定义新的一列  add
        tempTable.Columns.Add(col);  //追加一列  add
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }

            //fileatt
            string ls_classnames = "";   //add
            if (dt.Rows[i]["hy_mudelid"].ToString() == "Mudelfwgl")
            {
                string lssqlfwglfile;
                lssqlfwglfile = "select * from files where fother = '" + dt.Rows[i]["hy_fatherid"].ToString() + "'";
                DataTable dtfwglfile = Hyoa_global.GetDataTable(lssqlfwglfile);
                if (dtfwglfile.Rows.Count > 0)
                {
                    for (int jfile = 0; jfile < dtfwglfile.Rows.Count; jfile++)
                    {
                        if (ls_classnames == "")
                        {
                            ls_classnames = "<a href='../NTKO/" + dtfwglfile.Rows[jfile]["fpath"].ToString() + "/" + dtfwglfile.Rows[jfile]["fname"].ToString() + "' target=_blank>正文</a>";
                        }
                        else
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:101,代码来源:list.aspx.cs

示例9: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("login.aspx");

        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole("Rolescsylc", Session["hyuid"].ToString()))
        {
            isdellcrole.Value = "1";
        }
        if (this.Request.QueryString["mid"] != null)
        {
            //得到模块ID
            this.txtmudelid.Value = this.Request.QueryString["mid"].ToString();
        }
        else
        {
            this.Response.Write("<script>alert('模块ID没有传入,请联系管理员!');</script>");
            return;
        }
        if (this.Request.QueryString["tableid"] != null)
        {
            //表的ID
            this.txttableid.Value = this.Request.QueryString["tableid"].ToString();
            //得到表名
            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
            DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.txttableid.Value);
            if (dt_tableconfig.Rows.Count > 0)
                this.lblcurtachenameshow.Text = dt_tableconfig.Rows[0]["hy_name"].ToString();
        }
        else
        {
            this.Response.Write("<script>alert('表单ID没有传入,请联系管理员!');</script>");
            return;
        }
        if (this.Request.QueryString["listid"] != null)
        {
            //得到列表ID
            if (this.Request.QueryString["listid"].ToString() != "")
            {
                this.txtlistid.Value = this.Request.QueryString["listid"].ToString();
            }
        }
        else
        {
            this.Response.Write("<script>alert('列表ID没有传入,请联系管理员!');</script>");
            return;
        }
        //判断是否需要查询
        HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
        DataTable dt_listconfig = Hyoa_listconfig.Getlistconfig(this.txtlistid.Value);
        if (dt_listconfig.Rows.Count > 0)
        {
            if (dt_listconfig.Rows[0]["hy_ifsearch"].ToString() == "是")
                GetSearchTableHtml();//查询表格动态生成
        }
        if (!IsPostBack)
        {
            DataPlay(1);   //列表区动态生成
            PageListItem();
            EnabledWhatButton();
        }
    }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:63,代码来源:list_myadd.aspx.cs

示例10: DataPlay

    private void DataPlay(int PageNo)
    {
        //得到当前模块对应的role
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
        string ls_role = "Role9999";
        if (dt_mudel.Rows.Count > 0)
            ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();

        //判断当前用户是否有删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.tddeldoc.Visible = true;
        }
        else
        {
            this.isrole.Value = "0";
            this.tddeldoc.Visible = false;
        }

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.DAO db = new HyoaClass.DAO();
        //已流转完成的工作月汇报
        string sql = "";

        sql = "select * from hyp_flowmain where hy_mudelid='" + this.txtmudelid.Value + "' and hy_tableid='" + this.txttableid.Value + "' and hy_curtacheid='**' ";

        if (this.hy_djsj_start_1.Value != "")
            sql += " and hy_djsj>='" + this.hy_djsj_start_1.Value + "' ";

        if (this.hy_djsj_end_1.Value != "")
            sql += " and hy_djsj<='" + this.hy_djsj_end_1.Value + "' ";

        if (this.hy_djrname_1.Value != "")
            sql += " and hy_djrname like '%" + this.hy_djrname_1.Value + "%' ";

        if (this.hy_djrbmname_1.Value != "")
            sql += " and hy_djrbmname like '%" + this.hy_djrbmname_1.Value + "%' ";

        sql += " order by hy_djsj desc ";

        DataTable dt = db.GetDataTable(sql);
        DataTable tempTable = dt.Clone();
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }

        int TotalRecord = dt.Rows.Count;
        this.sumts.Text = TotalRecord.ToString();
        this.sumts2.Text = TotalRecord.ToString();
        this.ShowTotalRecord.Text = TotalRecord.ToString();
        //计算及显示总页数
        int TotalPage;
        if (TotalRecord < System.Int32.Parse(PageSize.Text))
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0)
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1;

            }
            else
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text);

            }
        }
        this.ShowTotalPage.Text = TotalPage.ToString();
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }
开发者ID:wjszxli,项目名称:Webapp,代码行数:87,代码来源:list_ks.aspx.cs

示例11: DataPlay

    private void DataPlay()
    {
        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; //保存
            }

            //新文档
            if (this.Request.QueryString["op"] == "add")
            {
                if (this.hy_deptid.Text != "")
                {
                    //根据部门ID得到部门名称
                    HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
                    DataTable dtdept = Hyoa_dept.Getdept(this.hy_deptid.Text);
                    if (dtdept.Rows.Count > 0)
                        this.hy_deptname.Text = dtdept.Rows[0]["hy_deptname"].ToString();

                    this.ddlifleader.Items.Insert(0, "否");
                    this.ddlifleader.Items.Insert(1, "是");

                    this.ddlisenabled.Items.Insert(0, "是");
                    this.ddlisenabled.Items.Insert(1, "否");

                    this.ddlxb.Items.Insert(0, "--请选择--");
                    this.ddlxb.Items.Insert(1, "男");
                    this.ddlxb.Items.Insert(2, "女");

                    dtdept.Clear();
                }
            }
            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                if (this.Request.QueryString["userid"] != null)
                {
                    this.ddlifleader.Items.Insert(0, "否");
                    this.ddlifleader.Items.Insert(1, "是");

                    this.ddlisenabled.Items.Insert(0, "是");
                    this.ddlisenabled.Items.Insert(1, "否");

                    this.ddlxb.Items.Insert(0, "--请选择--");
                    this.ddlxb.Items.Insert(1, "男");
                    this.ddlxb.Items.Insert(2, "女");

                    //根据用户ID得到信息
                    this.txtuserid.Text = this.Request.QueryString["userid"].ToString();
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    HyoaClass.Hyoa_user_detail Hyoa_user_detail = new HyoaClass.Hyoa_user_detail();
                    DataTable dtuser = Hyoa_user.Getuserallinfo(this.txtuserid.Text);
                    if (dtuser.Rows.Count > 0)
                    {
                        this.txtusername.Value = dtuser.Rows[0]["hy_username"].ToString();
                        this.hy_deptid.Text = dtuser.Rows[0]["hy_deptid"].ToString();
                        this.hy_deptname.Text = dtuser.Rows[0]["hy_deptname"].ToString();
                        this.txtposition.Value = dtuser.Rows[0]["hy_post"].ToString();

                        if (dtuser.Rows[0]["hy_ifleader"].ToString() == "是")
                            this.ddlifleader.SelectedIndex = 1;
                        else
                            this.ddlifleader.SelectedIndex = 0;

                        this.txtofficetel.Value = dtuser.Rows[0]["hy_officetel"].ToString();
                        this.txthometel.Value = dtuser.Rows[0]["hy_hometel"].ToString();
                        this.txtmobile.Value = dtuser.Rows[0]["hy_mobile"].ToString();
                        this.txtvirtualtel.Value = dtuser.Rows[0]["hy_virtualnumber"].ToString();
                        this.txtuserno.Value = dtuser.Rows[0]["hy_sort"].ToString();

                        if (dtuser.Rows[0]["hy_isenabled"].ToString() == "是")
                            this.ddlisenabled.SelectedIndex = 0;
                        else
                            this.ddlisenabled.SelectedIndex = 1;

                        DataTable dtdetail = Hyoa_user_detail.Getuserdetail(this.txtuserid.Text);
                        if (dtdetail.Rows.Count > 0)
                        {
                            this.txtbirthday.Value = System.DateTime.Parse(dtdetail.Rows[0]["hy_birthday"].ToString()).ToString("yyyy-MM-dd");
                            this.txtfjh.Value = dtdetail.Rows[0]["hy_fjh"].ToString();
                            this.ddlxb.SelectedValue = dtdetail.Rows[0]["hy_xb"].ToString();
                            this.txtzzmm.Value = dtdetail.Rows[0]["hy_zzmm"].ToString();
                            this.txtxl.Value = dtdetail.Rows[0]["hy_xl"].ToString();
                            this.txtbyyx.Value = dtdetail.Rows[0]["hy_byyx"].ToString();

                            if (dtdetail.Rows[0]["hy_jdwsj"].ToString() != "" && dtdetail.Rows[0]["hy_jdwsj"].ToString() != null && dtdetail.Rows[0]["hy_jdwsj"].ToString() != "1900-01-01")
                                this.txtjdwsj.Value = System.DateTime.Parse(dtdetail.Rows[0]["hy_jdwsj"].ToString()).ToShortDateString();

                            this.txtjtzz.Value = dtdetail.Rows[0]["hy_jtzz"].ToString();
                            this.txtsfzhm.Value = dtdetail.Rows[0]["hy_sfzhm"].ToString();
                        }
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:Webapp,代码行数:101,代码来源:main_user.aspx.cs

示例12: DataPlay

    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.tdnewdoc.Visible = true; //新建
            this.tddeldoc.Visible = true; //删除

        }
        else
        {
            this.isrole.Value = "0";
            this.tdnewdoc.Visible = false; //新建
            this.tddeldoc.Visible = false; //删除
        }

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();

        DataTable dt;
        Hyoa_flowinfor.hy_flowname = this.hy_bt_1.Value;
        dt = Hyoa_flowinfor.GetflowinforsByflowname();

        DataTable tempTable = dt.Clone();
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }

        int TotalRecord = dt.Rows.Count;
        this.sumts.Text = TotalRecord.ToString();
        this.sumts2.Text = TotalRecord.ToString();
        this.ShowTotalRecord.Text = TotalRecord.ToString();
        //计算及显示总页数
        int TotalPage;
        if (TotalRecord < System.Int32.Parse(PageSize.Text))
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0)
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1;

            }
            else
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text);

            }
        }
        this.ShowTotalPage.Text = TotalPage.ToString();
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }
开发者ID:wjszxli,项目名称:Webapp,代码行数:68,代码来源:list_flowconfig.aspx.cs

示例13: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() =="")
            this.Response.Redirect("/login.aspx");

        if (this.Request.QueryString["mid"] != null)
        {
            //得到模块ID
            this.txtmudelid.Value = this.Request.QueryString["mid"].ToString();
        }
        else
        {
            this.Response.Write("<script>alert('模块ID没有传入,请联系管理员!');</script>");
            return;
        }
        if (this.Request.QueryString["tableid"] != null)
        {
            //表的ID
            this.txttableid.Value = this.Request.QueryString["tableid"].ToString();
            //得到表名
            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
            DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.txttableid.Value);
            if (dt_tableconfig.Rows.Count > 0)
                this.lblcurtachenameshow.Text = dt_tableconfig.Rows[0]["hy_name"].ToString();
        }
        else
        {
            this.Response.Write("<script>alert('表单ID没有传入,请联系管理员!');</script>");
            return;
        }

        if (!IsPostBack)
        {
            //判断是否需要查询(目前一个表单只能对应一个列表,所以直接用表单ID进行查找)
            HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
            DataTable dt_listconfig = Hyoa_listconfig.GetlistconfigByTableid(this.txttableid.Value);
            if (dt_listconfig.Rows.Count > 0)
            {
                if (dt_listconfig.Rows[0]["hy_ifsearch"].ToString() == "是")
                    GetSearchTableHtml();//查询表格动态生成
            }

            DataPlay(1);   //列表区动态生成
            PageListItem();
            EnabledWhatButton();
            if (this.txtmudelid.Value == "kqgl" && this.txttableid.Value == "74e7e280-4fc5-4ccb-be3d-0f995ac2c934")
            {
                this.delcontrol_my.Visible = false;
                this.newcontrol.Visible = false;

            }
            if (this.txtmudelid.Value == "clgl" && this.txttableid.Value == "0b5c53fe-114b-4fa3-8b59-4163b3053504")
            {
                this.exportexcel.Visible = true;
            }

            ///只有管理员岗位能删除(大榭特有)
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
            {
            }
            else
            {
                this.delcontrol.Visible = false;
                this.delcontrol_my.Visible = false;
            }

        }
    }
开发者ID:wjszxli,项目名称:Webapp,代码行数:69,代码来源:list_db.aspx.cs

示例14: GetFieldHtml


//.........这里部分代码省略.........
                    ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid);
                    if (ls_laborinput == "0")
                    {
                        field_docvalue = "";
                    }
                }
                else
                {
                    field_docvalue = "";
                }
            }
            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";
                    }
                    if (ls_laborinput == "1")
                    {
                        //如果当前字段中文名为“结束流程按钮”,则这个字段主要用于收文中阅件时,可点击这个按钮结束流程,用于控制这个按钮的隐藏和显示
                        if (dtfield.Rows[0]["hy_fieldname"].ToString() == "结束流程按钮")
                        {
                            td_flowend.Visible = true;
                        }
                    }
                }
                //如果是“可修改所有文档的权限人员”,则可以修改所有的字段
                if (Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString()))
                {
                    ls_laborinput = "1";
                }
            }

            //如果是输出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);
                }
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:67,代码来源:main.aspx.cs

示例15: DataPlay

    private void DataPlay(int PageNo)
    {
        //得到当前模块对应的role
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
        string ls_role = "Role9999";
        if (dt_mudel.Rows.Count > 0)
        {
            ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();
        }
        //根据表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_global Hyoa_global = new HyoaClass.Hyoa_global();
        //如果有流程的话,新建按钮就一直显示,不用作判断的,只要判断删除按钮就行。
        if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.delcontrol.Visible = true;
            this.newcontrol.Visible = true;
        }
        else
        {
            this.isrole.Value = "0";
            this.newcontrol.Visible = true;
        }

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

        this.lbdisplaytitle.Text = "";
        //得到当前页号
        this.curpage.Text = PageNo.ToString();

        //---查询条件---开始
        string cmdStr_Search = "";
        if (this.txttableid.Value == "Tablefpbd")
        {
            cmdStr_Search += " and hyc_sfbf <> '1' ";
        }
        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 + "' ";
//.........这里部分代码省略.........
开发者ID:wjszxli,项目名称:hyoav10_gdcrm,代码行数:101,代码来源:list_zb.aspx.cs


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