Пример #1
0
    public void hy_dbsy()
    {
        //得到待办事宜
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        DataTable dt;
        dt = Hyoa_dbsy.Getdbsys_dbanddy(this.Session["hyuid"].ToString());
        int i, j;
        string lstitle;
        i = 8;//显示条数
        if (dt.Rows.Count < i)
            i = dt.Rows.Count;

        for (j = 0; j < i; j++)
        {
            string ls_mudelid = dt.Rows[j]["hy_mudelid"].ToString();
            string ls_mudelname = "";
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_getmudel = Hyoa_mudel.Getmudel(ls_mudelid);
            if (dt_getmudel.Rows.Count > 0)
                ls_mudelname = dt_getmudel.Rows[0]["hy_mudelname"].ToString();

            lstitle = "[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString();
            if (ls_mudelid == "yzgl")
            {
                lstitle = lstitle + "用印申请";
            }
            if (lstitle.Length > 35)
                lstitle = lstitle.Substring(0, 35) + "...";
            this.lbdbsy.Text += "<tr height='18px'><td valign='top'>·<a href='ggdy/Hy_DbToYb.aspx?id=" + dt.Rows[j]["ID"].ToString() + "' title='[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString() + "' target='_blank'>" + lstitle + "</a>&nbsp;&nbsp;[" + System.DateTime.Parse(dt.Rows[j]["hy_createtime"].ToString()).ToShortDateString().ToString() + "]</td></tr>";
        }
        if (this.lbdbsy.Text == "")
            this.lbdbsy.Text = "·暂无记录!";
    }
Пример #2
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        if (this.txtop.Value == "add")
        {
            //先判断这个模块编号是否已经存在
            DataTable dt = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
            if (dt.Rows.Count > 0)
            {
                Response.Write("<script>alert('该模块编号已存在,请重新填写!');history.back();</script>");
                return;
            }
            if(this.txtid.Text.Length<6)
            {
                Response.Write("<script>alert('模块编号长度必须大于5位!');history.back();</script>");
                return;
            }
            if (this.txtid.Text.Substring(0, 5) != "Mudel")
            {
                Response.Write("<script>alert('模块编号必须以Mudel开头!');history.back();</script>");
                return;
            }
            Hyoa_mudel.hy_mudelid = this.txtid.Text;
            Hyoa_mudel.hy_mudelname = this.txtname.Value;
            Hyoa_mudel.hy_sort = System.Int32.Parse(this.txtsort.Value);
            Hyoa_mudel.hy_isenabled = this.ddlisenabled.SelectedValue;
            Hyoa_mudel.hy_roleid = this.ddlrole.SelectedValue;
            Hyoa_mudel.hy_qqroleid = this.ddlqqrole.SelectedValue;
            Hyoa_mudel.Insert();
        }
        else
        {
            Hyoa_mudel.hy_mudelid = this.txtid.Text;
            Hyoa_mudel.hy_mudelname = this.txtname.Value;
            Hyoa_mudel.hy_sort = System.Int32.Parse(this.txtsort.Value);
            Hyoa_mudel.hy_isenabled = this.ddlisenabled.SelectedValue;
            Hyoa_mudel.hy_roleid = this.ddlrole.SelectedValue;
            Hyoa_mudel.hy_qqroleid = this.ddlqqrole.SelectedValue;
            Hyoa_mudel.Update();
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
Пример #3
0
 public string hy_mudelname()
 {
     string mudelname = "";
     if (this.Request.QueryString["mid"] != null)
     {
         //得到模块中文名
         HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
         DataTable dtmudel = Hyoa_mudel.Getmudel(Request.QueryString["mid"].ToString());
         mudelname = dtmudel.Rows[0]["hy_mudelname"].ToString();
         dtmudel.Clear();
     }
     return mudelname;
 }
Пример #4
0
    public void hyjstx()
    {
        HyoaClass.Hyoa_jstx Hyoa_jstx = new HyoaClass.Hyoa_jstx();
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();

        try
        {
            DataTable dt = Hyoa_jstx.Getjstxs_wf();
            if (dt.Rows.Count > 0)
            {
                string ls_content = "";
                string ls_mudelname = "消息提醒";
                string ls_url = "";
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    //得到模块名称
                    DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_from"].ToString());
                    if (dt_mudel.Rows.Count > 0)
                        ls_mudelname = dt_mudel.Rows[0]["hy_mudelname"].ToString();

                    //如果没找到该文档对应的待办事宜,则不发送消息
                    DataTable dt_dbsy = Hyoa_dbsy.Getdbsybydocid(dt.Rows[i]["DOCID"].ToString());
                    if (dt_dbsy.Rows.Count > 0)
                    {
                        ls_url = dt_dbsy.Rows[0]["hy_url"].ToString();
                        ls_content = "[" + ls_mudelname + "]-<a href='" + amtooa_ym + "/jstx_login.aspx?uid=" + dt.Rows[i]["hy_jsrid"].ToString() + "&key=cd04fa144ec48507&redirectto=" + ls_url + "' target=_blank>" + dt.Rows[i]["hy_content"].ToString() + "</a>";
                        int li_value = SendMessage("消息提醒", ls_content, dt.Rows[i]["hy_jsrid"].ToString());
                        if (li_value == 1)
                        {
                            Hyoa_jstx.ID = dt.Rows[i]["ID"].ToString();
                            Hyoa_jstx.hy_state = 1;
                            Hyoa_jstx.Update();
                        }
                        else
                        {
                            Hyoa_jstx.ID = dt.Rows[i]["ID"].ToString();
                            Hyoa_jstx.hy_state = 2;
                            Hyoa_jstx.Update();
                        }
                    }
                }
            }
        }
        catch
        {
        }
        finally
        {
        }
    }
Пример #5
0
    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();
                    }
                }
            }

        }
    }
Пример #6
0
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
     String[] v_uids = this.txtuids.Value.Split(',');
     for (var i = 0; i < v_uids.Length; i++)
     {
         if (v_uids[i] != "")
         {
             Hyoa_mudel.hy_mudelid = v_uids[i];
             Hyoa_mudel.Delete();
         }
     }
     this.txtuids.Value = "";
     //DataPlay(1);
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
Пример #7
0
    //待办事宜
    private void hy_dbsy()
    {
        string ls_html = "";
        int i, j;
        string ls_title = "";
        string ls_title2 = "";
        string ls_url = "";
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        DataTable dt = Hyoa_dbsy.Getdbsys_db(this.Session["hyuid"].ToString());
        i = 7; //显示条数
        if (dt.Rows.Count < i)
            i = dt.Rows.Count;
        for (j = 0; j < i; j++)
        {
            string ls_mudelid = dt.Rows[j]["hy_mudelid"].ToString();
            string ls_mudelname = "";
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_getmudel = Hyoa_mudel.Getmudel(ls_mudelid);
            if (dt_getmudel.Rows.Count > 0)
                ls_mudelname = dt_getmudel.Rows[0]["hy_mudelname"].ToString();

            ls_title = "[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString();
            if (ls_title.Length > 35)
                ls_title2 = ls_title.Substring(0, 35) + "...";
            else
                ls_title2 = ls_title;

            ls_url = "ggdy/Hy_DbToYb.aspx?id=" + dt.Rows[j]["ID"].ToString() + "&pop=1&rnd=" + System.Guid.NewGuid().ToString();
            ls_html += "<tr>";
            ls_html += "<td width=\"10\" align=\"center\">·</td>";
            ls_html += "<td height=\"26\"><a title=\"" + ls_title + "\" onclick=\"window.open('" + ls_url + "')\" href=\"javascript:\"><b>" + ls_title2 + "</b></a></td>";
            ls_html += "<td width=\"70\" align=\"center\"><font color='#2D2D2D' >" + System.DateTime.Parse(dt.Rows[j]["hy_createtime"].ToString()).ToString("yyyy-MM-dd") + "</font></td>";
            ls_html += "</tr>";

        }
        if (ls_html == "")
        {
            ls_html = "<tr><td>· 暂无待办事宜!</td></tr>";
        }
        this.lbldbsy.Text = ls_html;
    }
    public string hy_mudelname()
    {
        string mudelname = "";
        if (this.Request.QueryString["mid"] != null)
        {
            //得到模块中文名
            string ls_mid = "";
            ls_mid = this.Request.QueryString["mid"].ToString();
            if (ls_mid.Contains(","))
                ls_mid = ls_mid.Substring(0, ls_mid.IndexOf(","));

            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dtmudel = Hyoa_mudel.Getmudel(ls_mid);
            //Response.Write(Request.QueryString["mid"].ToString());
            if (dtmudel.Rows.Count > 0)
            {
                mudelname = dtmudel.Rows[0]["hy_mudelname"].ToString();
            }
        }
        return mudelname;
    }
Пример #9
0
    //加载主表单    Written by xf 20110515
    private void DataPlay()
    {
        txtsavefields.Text = "";
        txtsavefields_sx.Text = "";

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

            #region 新文档
            if (this.Request.QueryString["op"] == "add")
            {
                this.td_ydry.Visible = false; //新文档时,“已读人员”按钮隐藏
                this.txtiffirsttache.Value = "1"; //新文档时,“是否第一环节”置为1

                //文档ID(保存POST到当前页面时,DOCID不重新加载)
                if (!this.IsPostBack)
                {
                    this.txtdocid.Value = Hyoa_global.GetRandom();
                    this.hy_djsj.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
                this.hy_djrid.Text = this.Session["hyuid"].ToString();
                this.hy_djrname.Text = this.Session["hyuname"].ToString();
                this.hy_djrbmid.Text = this.Session["hydeptid"].ToString();
                this.hy_djrbmname.Text = this.Session["hydeptname"].ToString();

                HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                if (dt_tableconfig.Rows.Count > 0)
                {
                    if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是")
                    {
                        //根据模块ID得到流程信息
                        HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
                        DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text);
                        if (dt.Rows.Count > 0)
                        {
                            //判断当前用户是否有登记权限
                            //得到第一环节ID
                            string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString());
                            if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString()))
                            {
                                this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                                this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                                this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString();
                                this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                this.hy_curclrid.Text = this.Session["hyuid"].ToString();
                                this.hy_curclrname.Text = this.Session["hyuname"].ToString();
                                this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                this.txtSystemClRight.Value = "1";

                                //-------条件流程start-------
                                HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
                                DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid);
                                if (dt_firsttache.Rows.Count > 0)
                                {
                                    if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是")
                                        ConditionFlow(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid);
                                }
                                //-------条件流程end-------
                            }
                            else
                            {
                                if (this.txtifpop.Value == "")
                                {
                                    this.td_submit.Visible = false;
                                    this.td_nextstep.Visible = false;
                                    Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>");
                                    return;
                                }
                                else
                                {
                                    this.td_submit.Visible = false;
                                    this.td_nextstep.Visible = false;
                                    Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>");
                                    return;
                                }
                            }
                        }
                        dt.Clear();
                        this.td_nextstep.Visible = true; //提交
                    }
                }
                //加载页面
                if (this.hy_tableid.Text == "Tablefpbd")
                {
                        this.td_dc.Visible = true;
                }
                GetMainTableHtml("0", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);
                this.td_submit.Visible = true; //保存
                hywebopen_newdoc();     //新文档OPEN时的特殊处理

            }
            #endregion

            #region 旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                this.td_browseflow.Visible = true;  //查看流程

                if (this.Request.QueryString["docid"] != null)
                {
                    this.txtdocid.Value = this.Request.QueryString["docid"].ToString();
                    string sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "' ";

                    DataTable dt = Hyoa_global.GetDataTable(sql);
                    if (dt.Rows.Count > 0)
                    {
                        this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString();
                        this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString();
                        this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                        this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                        this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString();
                        this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString();
                        this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString();
                        this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString();
                        this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString();
                        this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString();
                        this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString();
                        this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString();
                        if (!this.IsPostBack)
                        {
                            this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString();
                        }
                        this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString();
                        this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString();
                        this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString();
                        this.hy_readdatelist.Text = dt.Rows[0]["hy_readdatelist"].ToString();
                        this.hy_clrylist.Text = dt.Rows[0]["hy_clrylist"].ToString();
                        this.hy_cyrylist.Text = dt.Rows[0]["hy_cyrylist"].ToString();
                        this.hy_motherid.Text = dt.Rows[0]["hy_motherid"].ToString();
                        this.hy_ifconfirm.Text = dt.Rows[0]["hy_ifconfirm"].ToString();
                        UpdateReadFlag();  //打开时添加阅读情况
                    }
                    dt.Clear();

                    //流程已结束
                    if (this.hy_curtacheid.Text == "**")
                    {
                        this.lblcurtachenameshow.Text = "流程已结束";

                        //20111216 add start
                        if (this.hy_mudelid.Text == "Mudelfwgl" || this.hy_mudelid.Text == "Mudelswgl")
                        {
                            //有发布权限
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            {
                                this.td_fabu.Visible = true;  //收发文模块流程结束后显示发布按钮
                                //收发文流程结束后分发轮阅  20140809 hjadd start
                                this.td_ffly.Visible = true;  //收发文模块流程结束后显示分发按钮
                                //收发文流程结束后分发轮阅  20140809 hjadd start
                            }
                        }
                        //20111216 add end

                        //判断是否为传阅人
                        HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                        dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                        if (dt.Rows.Count > 0)
                        {
                            this.txtSystemClRight.Value = "0";
                            this.txtSystemYdRight.Value = "1";
                        }
                        //判断是否历史处理人
                        //判断是否是历史处理人员
                        if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                        {
                            this.txtifhistoryclr.Value = "1";
                            this.txtSystemClRight.Value = "0";
                            this.txtSystemYdRight.Value = "1";
                        }
                    }
                    else
                    {
                        //////////////流程未结束///////////////////////
                        //判断是否为当前处理人
                        if (("," + this.hy_curclrid.Text + ",").IndexOf(("," + this.Session["hyuid"].ToString() + ",")) >= 0)
                        {
                            this.txtSystemClRight.Value = "1";
                            this.td_submit.Visible = true; //保存
                            this.td_nextstep.Visible = true; //提交
                            if (this.hy_curtacheid.Text != "tache0001")
                            {
                                this.td_returnsumbit.Visible = true; //退回
                            }

                            //-------条件流程start-------
                            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
                            DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            if (dt_firsttache.Rows.Count > 0)
                            {
                                if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是")
                                    ConditionFlow(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            }
                            //-------条件流程end-------
                        }
                        else
                        {
                            //判断是否为传阅人
                            HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                            dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                            if (dt.Rows.Count > 0)
                            {
                                this.txtSystemYdRight.Value = "1";
                            }
                            //判断是否是上一环节处理人
                            if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                            {
                                this.txtiflastclr.Value = "1";
                                this.txtSystemYdRight.Value = "1";
                                this.td_withdraw.Visible = true; //收回
                                this.td_press.Visible = true; //催办
                            }
                            else
                            {
                                //判断是否是历史处理人员
                                if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                {
                                    this.txtifhistoryclr.Value = "1";
                                    this.txtSystemYdRight.Value = "1";
                                    this.td_press.Visible = true; //催办
                                }
                            }
                        }
                        //判断是否为第一个环节
                        HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
                        DataTable dt_flowhistoryinfo_cl = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
                        if (dt_flowhistoryinfo_cl.Rows.Count == 1)
                        {
                            this.txtiffirsttache.Value = "1"; //旧文档时,如果历史处理环节中只有一条记录,“是否第一环节”置为1
                        }
                        dt_flowhistoryinfo_cl.Clear();

                        //判断是否为最后一个环节
                        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                        DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                        if (dtflowwork.Rows.Count > 0)
                        {
                            if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                this.txtiflasttache.Value = "1";
                        }
                        dtflowwork.Clear();
                        //////////////流程未结束///////////////////////
                    }

                    //如果表单是流程后公开显示,则置为阅读权限
                    if (this.hy_curtacheid.Text == "**")
                    {
                        HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                        DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.hy_tableid.Text);
                        if (dt_tableconfig.Rows.Count > 0)
                        {
                            if (dt_tableconfig.Rows[0]["hy_ispuballByflowYB"].ToString() == "是")
                            {
                                this.txtSystemYdRight.Value = "1";
                            }
                        }
                    }
                    //没有操作权限的用户,如果是全权用户,则置为阅读权限    ADD BY XF 2011-11-17
                    if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                    {
                        //得到当前模块对应的全权用户组
                        HyoaClass.Hyoa_mudel Hyoa_mudel_forqqyh = new HyoaClass.Hyoa_mudel();
                        DataTable dt_mudel_forqqyh = Hyoa_mudel_forqqyh.Getmudel(this.hy_mudelid.Text);
                        if (dt_mudel_forqqyh.Rows.Count > 0)
                        {
                            if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != null)
                            {
                                if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != "")
                                {
                                    string ls_role_forqqyh = dt_mudel_forqqyh.Rows[0]["hy_qqroleid"].ToString();
                                    HyoaClass.Hyoa_global Hyoa_global_forqqyh = new HyoaClass.Hyoa_global();
                                    if (Hyoa_global_forqqyh.isHaveRole(ls_role_forqqyh, this.Session["hyuid"].ToString()))
                                    {
                                        this.txtSystemYdRight.Value = "1";  //阅读权限
                                    }
                                }
                            }
                        }
                    }

                    //指定的特殊模块,流转过程中,所有人员可以浏览该文档
                    hySetYdRight_TS();

                    //如果是“可修改所有文档的权限人员”,则可以修改所有的,可以把已办文件转在办
                    if (Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString()))
                    {
                        this.txtSystemYdRight.Value = "1";
                        this.td_submit.Visible = true; //保存
                        if (this.hy_curtacheid.Text == "**")
                            this.td_ybtozb.Visible = true; //已办转在办
                    }

                    //既没有处理权限,又没有阅读权限的情况下
                    if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                    {
                        if (this.txtifpop.Value == "")
                        {
                            this.td_submit.Visible = false;
                            this.td_nextstep.Visible = false;
                            Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>");
                            return;
                        }
                        else
                        {
                            this.td_submit.Visible = false;
                            this.td_nextstep.Visible = false;
                            Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>");
                            return;
                        }
                    }

                    //加载页面
                    if (this.hy_tableid.Text == "Tablefpbd")
                    {
                            this.td_dc.Visible = true;

                    }
                    GetMainTableHtml("1", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);

                    //----加载补充意见页面 s add by xf 2013-6-24-----
                    HyoaClass.Hyoa_tableconfig Hyoa_tableconfig_forbcyj = new HyoaClass.Hyoa_tableconfig();
                    DataTable dt_tableconfig_forbcyj = Hyoa_tableconfig_forbcyj.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                    if (dt_tableconfig_forbcyj.Rows.Count > 0)
                    {
                        if (dt_tableconfig_forbcyj.Rows[0]["hy_ifcomment"] != null)
                        {
                            if (dt_tableconfig_forbcyj.Rows[0]["hy_ifcomment"].ToString() == "是")
                            {
                                this.tb_nbsp.Visible = true;
                                this.tb_bctitle.Visible = true;
                                this.tb_bcbody.Visible = true;
                                if (this.txtSystemClRight.Value == "0")
                                {
                                    this.td_bcyj.Visible = true;
                                    this.tr_bcyj.Visible = true;
                                }

                                //得到已经补充意见内容
                                HyoaClass.Hyoa_bcyj Hyoa_bcyj = new HyoaClass.Hyoa_bcyj();
                                DataTable dt_bcyj = Hyoa_bcyj.GetdocsByfatherid(this.txtdocid.Value);
                                if (dt_bcyj.Rows.Count > 0)
                                {
                                    //输出补充意见记录
                                    this.lblbody_bcyj.Text = "";
                                    for (var i = 0; i < dt_bcyj.Rows.Count; i++)
                                    {
                                        this.lblbody_bcyj.Text += dt_bcyj.Rows[i]["hy_bcbody"].ToString() + "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                        this.lblbody_bcyj.Text += "(补充意见人:" + dt_bcyj.Rows[i]["hy_bcusername"].ToString() + "&nbsp;&nbsp;&nbsp;所在部门:" + dt_bcyj.Rows[i]["hy_bcdeptname"].ToString();
                                        this.lblbody_bcyj.Text += "&nbsp;&nbsp;&nbsp;补充时间:" + dt_bcyj.Rows[i]["hy_bctime"].ToString() + "&nbsp;&nbsp;&nbsp;IP:" + dt_bcyj.Rows[i]["hy_bcip"].ToString();
                                        this.lblbody_bcyj.Text += ")<br><hr height=1 color=#DEEEFE></hr>";
                                    }
                                }
                            }
                        }
                    }
                    //----加载补充意见页面 e-----
                }
                hywebopen_olddoc(); //旧文档OPEN的特殊处理
            }
            #endregion
        }
    }
Пример #10
0
    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()) || Hyoa_global.isHaveRole("Role9999", 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 ls_user = "";
        if (this.Request.QueryString["user"] != null)
            ls_user = this.Request.QueryString["user"].ToString();

        string sql = "";

        sql = "select * from hyp_flowmain where hy_mudelid='" + this.txtmudelid.Value + "' and hy_tableid='" + this.txttableid.Value + "' ";
        sql += " and hy_field1='" + ls_user + "' and left(convert(char(7),getdate(),120),4)=left(convert(char(7),hy_field31,120),4) order by hy_field31 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();
    }
Пример #11
0
    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
                        {
                            ls_classnames += "<br>" + "<a href='../NTKO/" + dtfwglfile.Rows[jfile]["fpath"].ToString() + "/" + dtfwglfile.Rows[jfile]["fname"].ToString() + "' target=_blank>正文</a>";
                        }
                    }
                }

            }
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dtfile = new DataTable();
            if (dt.Rows[i]["hy_fatherid"].ToString() == "")
            {
                dtfile = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[i]["ID"].ToString());
            }
            else
            {
                dtfile = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[i]["hy_fatherid"].ToString());
            }

            if (dtfile.Rows.Count > 0)
            {
                for (int ifile = 0; ifile < dtfile.Rows.Count; ifile++)
                {
                    if (ls_classnames == "")
                    {
                        ls_classnames = "<a href='../" + dtfile.Rows[ifile]["hy_filepath"].ToString() + "' target=_blank>" + dtfile.Rows[ifile]["hy_filename"].ToString() + "</a>";
                    }
                    else
                    {
                        ls_classnames += "<br>" + "<a href='../" + dtfile.Rows[ifile]["hy_filepath"].ToString() + "' target=_blank>" + dtfile.Rows[ifile]["hy_filename"].ToString() + "</a>";
                    }
                }
            }

            dr["lookfileatt"] = ls_classnames;  //将新值赋给相应的列  add

            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();
    }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!this.IsPostBack)
        //{
        //    string aa = "[{'stuName':[{'name':'Tom'},{'name':'Jack'},{'name':'jony'}]},{'className':[{'class':'基础日语'},{'class':'中级日语'},{'class':'Java SE'}]}]";
        //    this.Response.Write(aa);

        //}
        //else
        //{
            //string aa = Request.Form["username"];
            //this.Response.Write(aa);
        //}

        //HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        //DataTable dt = Hyoa_dbsy.Getdbsybyuserid("3810332");
        //DataTable dt = Hyoa_dbsy.Getdbsybyuserid("admin");
        string userid = Request.QueryString["userid"].ToString();
        string curpage = Request.QueryString["gotoPage"].ToString();
        int endPage=1;
        int onePageCount=7;
        HyoaClass.DAO db = new HyoaClass.DAO();
        //string lssql = "select * from hyt_dbsy where hy_dbrid='" + userid + "'";

        string lssql = "Select top " + onePageCount.ToString() + " * from hyt_dbsy  where hy_dbrid='" + userid + "'" + " and docid not in(select top " + ((int.Parse(curpage) - 1) * onePageCount).ToString() + " docid from hyt_dbsy " + "where hy_dbrid='" + userid + "'" + " " + " order by hy_createtime desc" + ")" + " " + " order by hy_createtime desc";

        DataTable dt = db.GetDataTable(lssql);

        string lstitle="";
        string lssj = "";
        string aa = "{\"list\":[";
        int lisum = dt.Rows.Count;
        for (int i = 0; i < lisum; i++)
        {
            lstitle = "";
            lssj = "";
            string ls_mudelid = dt.Rows[i]["hy_mudelid"].ToString();
            string ls_mudelname = "";
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_getmudel = Hyoa_mudel.Getmudel(ls_mudelid);
            if (dt_getmudel.Rows.Count > 0)
                ls_mudelname = dt_getmudel.Rows[0]["hy_mudelname"].ToString();
            lstitle = "[" + ls_mudelname + "]" + dt.Rows[i]["hy_subbt"].ToString() + "-" + dt.Rows[i]["hy_bt"].ToString();
            if(lstitle.Length >16)
                lstitle=lstitle.Substring (0,16)+"...";

            lssj="[" + System.DateTime.Parse(dt.Rows[i]["hy_createtime"].ToString()).ToString("MM-dd") + "]";
            if (i == lisum - 1)
            {
                aa += "{\"title\":\"" + lstitle + "\", \"sj\":\"" + lssj + "\"}";
            }
            else
            {
                aa += "{\"title\":\"" + lstitle + "\", \"sj\":\"" + lssj + "\"},";
            }

        }
        aa += "]";

        aa += ",\"page\": {";
        aa += "\"beginPage\":1,";
        aa += "\"count\":" + lisum.ToString()+ ",";
        aa += "\"currentPage\":" + curpage + ",";
        if(lisum%10==0)
        {
           endPage= lisum/onePageCount;
        }
        else
        {
          endPage= lisum/onePageCount+1;
        }

        aa += "\"endPage\":" + endPage.ToString() + ",";
        aa += "\"gotoPage\":" + curpage + ",";
        aa += "\"hasNextPage\":true,";
        aa += "\"hasPrePage\":false,";
        aa += "\"onClickFunction\":\"_submit\",";
        aa += "\"onePageCount\":" + onePageCount.ToString() + ",";
        aa += "\"startCount\":0,";
        aa += "\"totalPage\":" + endPage.ToString() + "}";
        aa += "}";
        this.Response.Write(aa);
    }
Пример #13
0
    private void DataPlay(int PageNo)
    {
        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string sql = "";

        DataTable dt = new DataTable();
        if (txtmid.Text == "dbsy")
        {
            dt = Hyoa_dbsy.Getdbsys_db(Session["hyuid"].ToString());
        }
        if (txtmid.Text == "dysy")
        {
            dt = Hyoa_dbsy.Getdbsys_dy(Session["hyuid"].ToString());
        }
        if (txtmid.Text == "ybsy")
        {
            dt = Hyoa_dbsy.Getdbsys_yb(Session["hyuid"].ToString());
        }
        if (txtmid.Text == "yysy")
        {
            dt = Hyoa_dbsy.Getdbsys_yy(Session["hyuid"].ToString());
        }
        //电子邮件
        if (this.Request.QueryString["mid"] == "mail")
        {
            //收件箱
            if (this.Request.QueryString["tableid"].ToString() == "sjx")
            {
                sql = "select * from hyt_mail where hy_jsrid='" + Session["hyuid"].ToString() + "' and hy_type='收件' ";
                if (txtname.Value != "")
                {
                    sql += " and hy_title like '%" + txtname.Value + "%' ";
                }
                sql += " order by hy_datetime desc ";
                dt = Hyoa_global.GetDataTable(sql);
            }
            //发件箱
            if (this.Request.QueryString["tableid"].ToString() == "fjx")
            {
                sql = "select * from hyt_mail where hy_fsrid='" + Session["hyuid"].ToString() + "' and hy_type='发件' ";
                if (txtname.Value != "")
                {
                    sql += " and hy_title like '%" + txtname.Value + "%' ";
                }
                sql += " order by hy_datetime desc ";
                dt = Hyoa_global.GetDataTable(sql);
            }
        }
        //日程安排
        if (this.Request.QueryString["mid"] == "Mudelrcap")
        {
            sql = "select * from hyc_Tablercap where hy_djrid='" + Session["hyuid"].ToString() + "' ";
            if (txtname.Value != "")
            {
                sql += " and hyc_zt like '%" + txtname.Value + "%' ";
            }
            sql += " order by hyc_qssj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //个人通讯录
        if (this.Request.QueryString["mid"] == "Mudelgrtxl")
        {
            sql = "select * from hyc_Tablegrtxl where hy_djrid='" + Session["hyuid"].ToString() + "' ";
            if (txtname.Value != "")
            {
                sql += " and hyc_xm like '%" + txtname.Value + "%' ";
            }
            sql += " order by hyc_xm ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //个人通讯录类别
        if (this.Request.QueryString["mid"] == "Mudelgrtxllb")
        {
            sql = "select * from hyc_Tablegrtxllb where hy_djrid='" + Session["hyuid"].ToString() + "' ";
            sql += " order by hyc_pxh ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //通知公告
        if (this.Request.QueryString["mid"] == "Mudeltzgg")
        {
            sql = "select * from hyc_Tabletzgg where 1=1 ";
            if (txtname.Value != "")
            {
                sql += " and hyc_bt like '%" + txtname.Value + "%' ";
            }
            sql += " order by hyc_djsj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //最新公文
        if (this.Request.QueryString["mid"] == "gwk")
        {
            sql = "select * from hyp_gwk where 1=1 ";
            if (txtname.Value != "")
            {
                sql += " and hy_bt like '%" + txtname.Value + "%' ";
            }
            sql += " order by hy_djsj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //工作日志
        if (this.Request.QueryString["mid"] == "Mudelgzrz")
        {
            sql = "select * from hyc_Tablegzrz where 1=1 ";
            if (txtname.Value != "")
            {
                sql += " and hyc_zt like '%" + txtname.Value + "%' ";
            }
            if (this.Request.QueryString["type"].ToString() == "dept")
            {
                sql += " and hy_djrbmid = '" + Session["hydeptid"].ToString() + "' ";
            }
            else
            {
                sql += " and hy_djrid = '" + Session["hyuid"].ToString() + "' ";
            }
            sql += " order by hy_djsj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //请假管理
        if (this.Request.QueryString["mid"] == "Mudelqjsq")
        {
            sql = "select distinct a.* from hyc_Tableqjsq a,hyp_flowhistoryinfo_cl b where a.DOCID=b.DOCID and (','+b.hy_clrid+',' like '%," + Session["hyuid"].ToString() + ",%' or ','+b.hy_cyrid+',' like '%," + Session["hyuid"].ToString() + ",%') and b.hy_ifth!='是'   ";
            if (txtname.Value != "")
            {
                sql += " and hyc_qjsy like '%" + txtname.Value + "%' ";
            }
            sql += " order by a.hy_djsj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }

        DataTable tempTable = dt.Clone();
        //模块名称
        DataColumn col1 = new DataColumn("show_mudelname", typeof(String));
        tempTable.Columns.Add(col1);
        //显示的标题
        DataColumn col2 = new DataColumn("show_bt", typeof(String));
        tempTable.Columns.Add(col2);
        //显示的时间
        DataColumn col3 = new DataColumn("show_sj", typeof(String));
        tempTable.Columns.Add(col3);
        //显示的连接
        DataColumn col4 = new DataColumn("show_lj", typeof(String));
        tempTable.Columns.Add(col4);
        //删除按钮
        DataColumn col5 = new DataColumn("show_delinfo", typeof(String));
        tempTable.Columns.Add(col5);

        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];
            }

            dr["show_mudelname"] = this.lblmudelname.Text;

            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_mudel = Hyoa_mudel.Getmudel(txtmid.Text);
            string ls_role = "Role9999";
            if (dt_mudel.Rows.Count > 0)
            {
                ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();
            }

            if (txtmid.Text == "dbsy" || txtmid.Text == "dysy" || txtmid.Text == "ybsy" || txtmid.Text == "yysy")
            {
                dr["show_bt"] = dt.Rows[i]["hy_subbt"].ToString() + "-" + dt.Rows[i]["hy_bt"].ToString();
                dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hy_createtime"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = dt.Rows[i]["hy_url"].ToString().Replace("main.aspx", "wap_main.aspx");
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>";
            }
            //电子邮件
            if (this.Request.QueryString["mid"] == "mail")
            {
                dr["show_bt"] = dt.Rows[i]["hy_title"].ToString();
                dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hy_datetime"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main_mailread.aspx?op=modify&mid=mail&tableid=sjx&docid=" + dt.Rows[i]["ID"].ToString() + "&url=wap_list.aspx?mid=mail&tableid=sjx&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>";
            }
            //日程安排
            if (this.Request.QueryString["mid"] == "Mudelrcap")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_zt"].ToString();
                dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_qssj"].ToString()).ToString("yyyy-MM-dd") + "至" + System.DateTime.Parse(dt.Rows[i]["hyc_jssj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelrcap&tableid=Tablercap&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelrcap&tableid=Tablercap&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除]</a>";
            }
            //个人通信录
            if (this.Request.QueryString["mid"] == "Mudelgrtxl")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_xm"].ToString();
                dr["show_sj"] = "手机:" + dt.Rows[i]["hyc_sj"].ToString();
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgrtxl&tableid=Tablegrtxl&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgrtxl&tableid=Tablegrtxl&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
            }
            //个人通信录类别
            if (this.Request.QueryString["mid"] == "Mudelgrtxllb")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_lb"].ToString();
                dr["show_sj"] = "序号:" + dt.Rows[i]["hyc_pxh"].ToString();
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgrtxl&tableid=Tablegrtxllb&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgrtxl&tableid=Tablegrtxllb&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
            }
            //通知公告
            if (this.Request.QueryString["mid"] == "Mudeltzgg")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_bt"].ToString();
                dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_djsj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudeltzgg&tableid=Tabletzgg&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudeltzgg&tableid=Tabletzgg&page=" + this.curpage.Text;
                //判断权限
                if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
                {
                    dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
                }
            }
            //公文库
            if (this.Request.QueryString["mid"] == "gwk")
            {
                dr["show_bt"] = dt.Rows[i]["hy_bt"].ToString();
                dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hy_djsj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main_gwk.aspx?op=modify&mid=gwk&tableid=gwk&docid=" + dt.Rows[i]["ID"].ToString() + "&url=wap_list.aspx?mid=gwk&tableid=gwk&page=" + this.curpage.Text;
                //判断权限
                if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
                {
                    dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>";
                }
            }
            //工作日志
            if (this.Request.QueryString["mid"] == "Mudelgzrz")
            {
                dr["show_bt"] = "[" + dt.Rows[i]["hy_djrname"].ToString() + "]" + dt.Rows[i]["hyc_zt"].ToString();
                dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_djsj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgzrz&tableid=Tablegzrz&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgzrz&tableid=Tablegzrz&type=" + this.Request.QueryString["type"].ToString() + "&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
            }
            //请假管理
            if (this.Request.QueryString["mid"] == "Mudelqjsq")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_qjr"].ToString() + "[" + dt.Rows[i]["hy_curtachename"].ToString() + "]";
                dr["show_sj"] = "请假时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_qjsj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelqjsq&tableid=Tableqjsq&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelqjsq&tableid=Tableqjsq&page=" + this.curpage.Text;
                //判断权限
                if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
                {
                    dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
                }
            }
            tempTable.Rows.Add(dr);
        }

        int TotalRecord = dt.Rows.Count;
        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();
    }
Пример #14
0
    private void DataPlay()
    {
        //加载一级目录ID、一级目录名称、每个一级目录最大的二级目录
        HyoaClass.Hyoa_ml Hyoa_firstml = new HyoaClass.Hyoa_ml();
        DataTable dtfirstml = Hyoa_firstml.GetFirstmls();
        if (dtfirstml.Rows.Count > 0)
        {
            this.ddlfirstmlid.DataSource = dtfirstml;
            this.ddlfirstmlid.DataTextField = "MLID";
            this.ddlfirstmlid.DataValueField = "MLID";
            this.ddlfirstmlid.DataBind();
            this.ddlfirstmlid.Items.Insert(0, "--请选择--");
            this.ddlfirstmlid.SelectedIndex = 0;
            this.ddlfirstmlname.DataSource = dtfirstml;
            this.ddlfirstmlname.DataTextField = "MLName";
            this.ddlfirstmlname.DataValueField = "MLName";
            this.ddlfirstmlname.DataBind();
            this.ddlfirstmlname.Items.Insert(0, "--请选择--");
            this.ddlfirstmlname.SelectedIndex = 0;
            //加载每个一级目录最大的二级目录
            string ls_id;
            for (var i = 0; i < dtfirstml.Rows.Count; i++)
            {
                ls_id = Hyoa_firstml.GetMaxMLID(dtfirstml.Rows[i]["MLID"].ToString());
                this.ddlsecondmlid.Items.Insert(i, ls_id);
            }
            this.ddlsecondmlid.Items.Insert(0, "--请选择--");
            this.ddlsecondmlid.SelectedIndex = 0;
        }

        //加载模块信息
        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, "--请选择--");
            this.ddlmudelid.SelectedIndex = 0;
        }

        //加载权限
        HyoaClass.Hyoa_role Hyoa_role = new HyoaClass.Hyoa_role();
        DataTable dtrole = Hyoa_role.Getroles();
        if (dtrole.Rows.Count > 0)
        {
            this.ddlrole.DataSource = dtrole;
            this.ddlrole.DataTextField = "hy_rolename";
            this.ddlrole.DataValueField = "hy_roleid";
            this.ddlrole.DataBind();
            this.ddlrole.Items.Insert(0, "--请选择--");
            this.ddlrole.SelectedIndex = 0;
        }

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

        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_ml Hyoa_ml = new HyoaClass.Hyoa_ml();

            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                if (this.Request.QueryString["id"] != null)
                {
                    //根据id得到信息
                    this.lblid.Value = this.Request.QueryString["id"].ToString();
                    this.txtMLID.Value = this.Request.QueryString["id"].ToString();
                    DataTable dt = Hyoa_ml.Getml(this.lblid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.txtname.Value = dt.Rows[0]["MLName"].ToString();
                        this.txtlink.Value = dt.Rows[0]["hy_link"].ToString();
                        this.ddltarget.SelectedValue = dt.Rows[0]["hy_target"].ToString();
                        this.ddlrole.SelectedValue = dt.Rows[0]["hy_role"].ToString();
                        this.txtsort.Value = dt.Rows[0]["hy_sort"].ToString();
                        //模块信息定位
                        for (var i = 0; i < this.ddlmudelid.Items.Count; i++)
                        {
                            if (this.ddlmudelid.Items[i].Value == dt.Rows[0]["hy_mudelid"].ToString())
                            {
                                this.ddlmudelid.SelectedIndex = i;
                            }
                        }
                        //一级目录定位
                        for (var i = 0; i < this.ddlfirstmlid.Items.Count; i++)
                        {
                            if (this.ddlfirstmlid.Items[i].Value == dt.Rows[0]["MLID"].ToString().Substring(0,3))
                            {
                                this.ddlfirstmlid.SelectedIndex = i;
                                this.ddlfirstmlname.SelectedIndex = i;
                            }
                        }

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

                        //根据模块信息得到对应的选择表单值
                        if (dt.Rows[0]["hy_tableid"] != "" && dt.Rows[0]["hy_tableid"] != null)
                        {
                            this.ddltableid.Items.Clear();
                            //根据模块ID得到表单ID
                            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                            DataTable dtgettableid = Hyoa_tableconfig.GetTablesbymudelid(dt.Rows[0]["hy_mudelid"].ToString());
                            if (dtgettableid.Rows.Count > 0)
                            {
                                for (var i = 0; i < dtgettableid.Rows.Count; i++)
                                {
                                    this.ddltableid.Items.Insert(i, new ListItem(dtgettableid.Rows[i]["hy_name"].ToString(), dtgettableid.Rows[i]["ID"].ToString()));
                                }
                                this.ddltableid.Items.Insert(0, new ListItem("--请选择--", ""));
                                //定位
                                this.ddltableid.SelectedValue = dt.Rows[0]["hy_tableid"].ToString();
                            }
                        }
                    }
                    dt.Clear();
                }
            }
        }
    }
Пример #15
0
 public string hy_mudelname()
 {
     //得到模块中文名
     HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
     DataTable dtmudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
     string mudelname = dtmudel.Rows[0]["hy_mudelname"].ToString();
     dtmudel.Clear();
     return mudelname;
 }
Пример #16
0
    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++)
                        {
                            this.ddlcolumnshowselect.Items.Insert(j, new ListItem(lv_columnshowselect[j], lv_columnshowselectid[j]));
                        }

                        //根据模块信息得到对应的选择表单值
                        if (dt.Rows[0]["hy_tableid"] != "" && dt.Rows[0]["hy_tableid"] != null)
                        {
                            this.ddltableid.Items.Clear();
                            //根据模块ID得到表单ID
                            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                            DataTable dtgettableid = Hyoa_tableconfig.GetTablesbymudelid(dt.Rows[0]["hy_mudelid"].ToString());
                            if (dtgettableid.Rows.Count > 0)
                            {
                                for (var i = 0; i < dtgettableid.Rows.Count; i++)
                                {
                                    this.ddltableid.Items.Insert(i, new ListItem(dtgettableid.Rows[i]["hy_name"].ToString(), dtgettableid.Rows[i]["ID"].ToString()));
                                }
                                this.ddltableid.Items.Insert(0, new ListItem("--请选择--", ""));
                                this.ddltableid.Attributes.Add("onchange ", "mudelidonchang() ");
                                //定位
                                this.ddltableid.SelectedValue = dt.Rows[0]["hy_tableid"].ToString();
                            }
                        }

                        //排序的字段
                        //根据模块ID+表单ID+字段ID得到字段中文名
                        DataTable dt_flowfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_sortfield1"].ToString(), dt.Rows[0]["hy_tableid"].ToString());
                        if (dt_flowfield.Rows.Count > 0)
                        {
                            this.searchsort1.Items.Insert(0, new ListItem(dt_flowfield.Rows[0]["hy_fieldname"].ToString(), dt.Rows[0]["hy_sortfield1"].ToString()));
                        }
                        this.ddlsorttype1.SelectedValue = dt.Rows[0]["hy_sorttype1"].ToString();
                        dt_flowfield.Clear();
                        dt_flowfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_sortfield2"].ToString(), dt.Rows[0]["hy_tableid"].ToString());
                        if (dt_flowfield.Rows.Count > 0)
                        {
                            this.searchsort2.Items.Insert(0, new ListItem(dt_flowfield.Rows[0]["hy_fieldname"].ToString(), dt.Rows[0]["hy_sortfield2"].ToString()));
                        }
                        this.ddlsorttype2.SelectedValue = dt.Rows[0]["hy_sorttype2"].ToString();
                        dt_flowfield.Clear();
                        dt_flowfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_sortfield3"].ToString(), dt.Rows[0]["hy_tableid"].ToString());
                        if (dt_flowfield.Rows.Count > 0)
                        {
                            this.searchsort3.Items.Insert(0, new ListItem(dt_flowfield.Rows[0]["hy_fieldname"].ToString(), dt.Rows[0]["hy_sortfield3"].ToString()));
                        }
                        this.ddlsorttype3.SelectedValue = dt.Rows[0]["hy_sorttype3"].ToString();
                        dt_flowfield.Clear();
                        //分类的字段
                        this.txthy_field_fl1.Text = dt.Rows[0]["hy_sql_fl1"].ToString();
                        if (dt.Rows[0]["hy_fieldid_fl1"].ToString() != "")
                        {
                            this.flfield1.Items.Insert(0, new ListItem(dt.Rows[0]["hy_fieldname_fl1"].ToString(), dt.Rows[0]["hy_fieldid_fl1"].ToString()));
                        }
                        this.txthy_field_fl2.Text = dt.Rows[0]["hy_sql_fl2"].ToString();
                        if (dt.Rows[0]["hy_fieldid_fl2"].ToString() != "")
                        {
                            this.flfield2.Items.Insert(0, new ListItem(dt.Rows[0]["hy_fieldname_fl2"].ToString(), dt.Rows[0]["hy_fieldid_fl2"].ToString()));
                        }
                        this.txthy_field_fl3.Text = dt.Rows[0]["hy_sql_fl3"].ToString();
                        if (dt.Rows[0]["hy_fieldid_fl3"].ToString() != "")
                        {
                            this.flfield3.Items.Insert(0, new ListItem(dt.Rows[0]["hy_fieldname_fl3"].ToString(), dt.Rows[0]["hy_fieldid_fl3"].ToString()));
                        }
                    }
                    dt.Clear();
                    HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield();
                    DataTable dt5 = Hyoa_listsearchfield.Getlistsearchfieldsbylistid(this.txtdocid.Value);
                    if (dt5.Rows.Count > 0)
                    {
                        for (int m = 0; m < dt5.Rows.Count; m++)
                        {
                            this.searchselect.Items.Insert(m, new ListItem(dt5.Rows[m]["hy_field"].ToString(), dt5.Rows[m]["hy_fieldid"].ToString()));
                        }
                    }
                }
            }
            else
            {
                //自动获取最大排序号,然后+2
                DataTable dt_maxsort = Hyoa_listconfig.GetMaxlistconfigsort();
                if (dt_maxsort.Rows.Count > 0)
                    txtsort.Text = (int.Parse(dt_maxsort.Rows[0]["hy_sort"].ToString()) + 2).ToString();
                else
                    txtsort.Text = "1";
            }
        }
    }
Пример #17
0
    public string Gethy_field(string ls_num)
    {
        string ls_return = "";
        string ls_show = "";    //这个区域的内容
        string ls_temp = "";
        string lstitle = "";
        string ls_url = "";
        string ls_sql = "";
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //得到待办事宜
        if (ls_num == "1")
        {
            ls_show = "待办事宜";    //这个区域的内容
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            DataTable dt = Hyoa_dbsy.Getdbsys_dbanddy(this.Session["hyuid"].ToString());
            int i = 5;  //显示条数
            if (dt.Rows.Count < i)
                i = dt.Rows.Count;

            for (int j = 0; j < i; j++)
            {
                string ls_mudelid = dt.Rows[j]["hy_mudelid"].ToString();
                string ls_mudelname = "";
                DataTable dt_getmudel = Hyoa_mudel.Getmudel(ls_mudelid);
                if (dt_getmudel.Rows.Count > 0)
                    ls_mudelname = dt_getmudel.Rows[0]["hy_mudelname"].ToString();

                lstitle = "[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString();
                if (lstitle.Length > 20)
                    lstitle = lstitle.Substring(0, 20) + "...";

                ls_url = "ggdy/Hy_DbToYb.aspx?id=" + dt.Rows[j]["ID"].ToString() + "&pop=1&rnd=" + System.Guid.NewGuid().ToString();
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a title=\"" + "[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString() + "\" onclick=\"window.open('" + ls_url + "')\" href=\"javascript:\"><b>" + lstitle + "</b></a></td>";
                ls_temp += "<td width=\"28%\" align=\"right\">";
                ls_temp += "<font color=\"#056ea5\">" + System.DateTime.Parse(dt.Rows[j]["hy_createtime"].ToString()).ToShortDateString().ToString() + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_1\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_1_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            ls_return += "<a href=\"#\" onclick=\"window.open('system/list_dbsy.aspx')\"><font color=\"red\">";
            ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到电子邮件
        if (ls_num == "2")
        {
            ls_show = "最新客户";    //这个区域的内容
            ls_sql = "select * from hyc_Tablekhda  order by  hy_djsj  desc ";
            DataTable dt = Hyoa_global.GetDataTable(ls_sql);
            int i = 5;  //显示条数
            if (dt.Rows.Count < i)
                i = dt.Rows.Count;

            for (int j = 0; j < i; j++)
            {
                lstitle = dt.Rows[j]["hyc_dwmc"].ToString();
                if (lstitle.Length > 20)
                    lstitle = lstitle.Substring(0, 20) + "...";

                ls_url = "main_look.aspx?op=modify&mid=Mudelkhda&tableid=Tablekhda&pop=1&docid=" + dt.Rows[j]["DOCID"].ToString();
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a title=\"" + lstitle + "\" onclick=\"window.open('" + ls_url + "&rnd='+Math.random())\" href=\"javascript:\">·&nbsp;" + lstitle + "</a></td>";
                ls_temp += "<td width=\"28%\" align=\"right\"></td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_2\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_2_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            ls_return += "<a href=\"#\" onclick=\"window.open('list_flc.aspx?mid=Mudelkhda&tableid=Tablekhda&listid=d3044ced-8273-4e7a-83b2-870580dde7a1&rnd='+Math.random())\"><font color=\"red\">";
            ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到日程安排
        if (ls_num == "3")
        {
            ls_show = "最新客户故障";    //这个区域的内容
            ls_sql = "select * from hyc_Tablekhgzdj where hy_djrid='" + Session["hyuid"].ToString() + "' order by hy_djsj desc ";
            DataTable dt = Hyoa_global.GetDataTable(ls_sql);
            int i = 5;  //显示条数
            if (dt.Rows.Count < i)
                i = dt.Rows.Count;

            for (int j = 0; j < i; j++)
            {
                lstitle = dt.Rows[j]["hyc_dwmc"].ToString();
                if (lstitle.Length > 20)
                    lstitle = lstitle.Substring(0, 20) + "...";

                ls_url = "main_look.aspx?op=modify&mid=Mudelkhda&tableid=Tablekhgzdj&pop=1&docid=" + dt.Rows[j]["DOCID"].ToString();
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a title=\"" + dt.Rows[j]["hyc_dwmc"].ToString() + "\" onclick=\"window.open('" + ls_url + "&rnd='+Math.random())\" href=\"javascript:\">" + lstitle + "</a></td>";
                ls_temp += "<td width=\"28%\" align=\"right\">";
                ls_temp += "<font color=\"#056ea5\">" + System.DateTime.Parse(dt.Rows[j]["hy_djsj"].ToString()).ToShortDateString().ToString() + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_3\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_3_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            ls_return += "<a href=\"#\" onclick=\"window.open('list_flc.aspx?mid=Mudelkhda&tableid=Tablekhgzdj&listid=afbdf289-c511-4b91-a2c7-bdb4d510ca78&rnd='+Math.random())\"><font color=\"red\">";
            ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到通知公告
        if (ls_num == "4")
        {
            ls_show = "最新合同";    //这个区域的内容
            Dictionary<string, DateTime> dic = new Dictionary<string, DateTime>();
            string sqlSelect = "";
            //合同表单id
            string[] arryStr = new string[] { "Tablesyyhfwxy", "Tablejdhazfwht", "TableVODfwxy", "Tableffpdfwht", "TableDVBazfwdght", "Tablejwdsjsxy", "Tablejwdscsxy", "Tablekdjrht", "Tablesjcsfwht", "Tablesjgdcsfwht", "Tablesjtxyyhzxy", "Tablezdyht" };
            //将所有表单的登记时间和DOCID Tableid放入集合中
            for (int i = 0; i < arryStr.Length; i++)
            {
                sqlSelect = " select docid,hy_djsj from hyc_" + arryStr[i] + " order by hy_djsj desc ";
                DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
                //获取每个表单一个的表单id 表名  和登记时间
                if (dt.Rows.Count > 0)
                {
                    dic.Add(dt.Rows[0]["docid"].ToString() + "#" + arryStr[i], Convert.ToDateTime(dt.Rows[0]["hy_djsj"].ToString()));
                }
            }
            //开始对登记时间进行排序
            string[] arrayName = new string[dic.Count];
            DateTime[] arrayValue = new DateTime[dic.Count];
            dic.Keys.CopyTo(arrayName, 0);
            dic.Values.CopyTo(arrayValue, 0);
            //会根据arrayValue的值进行升序排序,arrayName对应的会进行位置调整
            Array.Sort(arrayValue, arrayName);
            //降序
            Array.Reverse(arrayValue);
            Array.Reverse(arrayName);
            //重新将值放到新的集合中
            IDictionary<string, DateTime> dicSorted = new Dictionary<string, DateTime>();
            for (int i = 0; i < arrayName.Length; i++)
            {
                dicSorted.Add(arrayName[i], dic[arrayName[i]]);
            }
            //定义一个数组 通过循环 将key放入数组中
            string[] Docid = new string[dicSorted.Count];
            int j = 0;
            foreach (string lsDocid in dicSorted.Keys)
            {
                Docid[j] = lsDocid;
                j++;
            }
            //取集合前六个的值  通过数组中存储的key对集合进行删除操作
            if (Docid.Length > 5)
            {
                for (int i = 5; i < Docid.Length; i++)
                {
                    dicSorted.Remove(Docid[i]);
                }
            }
            //对集合前六个合同进行数据加工 输出到前台
            foreach (string lsDocid in dicSorted.Keys)
            {
                string lsTitle = "";
                string[] lsData = lsDocid.Split('#');
                sqlSelect = " select * from hyc_" + lsData[1] + " where docid ='" + lsData[0] + "' ";
                DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
                sqlSelect = " select hy_name from hyt_tableconfig where id='" + lsData[1] + "' ";
                DataTable dt2 = Hyoa_global.GetDataTable_BASE(sqlSelect);
                if (dt.Rows.Count > 0 && dt2.Rows.Count > 0)
                {
                    lsTitle = "[" + dt2.Rows[0]["hy_name"].ToString() + "]-" + dt.Rows[0]["hyc_jfmc"].ToString();
                    if (lsTitle.Length > 20)
                        lsTitle = lsTitle.Substring(0, 20) + "...";

                    ls_temp += "<tr>";
                    ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                    ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                    ls_temp += "<tbody>";
                    ls_temp += "<tr>";
                    ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"#\" onclick=\" var path='main_look.aspx?op=modify&mid=" + dt.Rows[0]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[0]["hy_tableid"].ToString() + "&docid=" + dt.Rows[0]["docid"].ToString() + " ';window.open(path) \" >&middot;" + lsTitle + "</a></td>";
                    ls_temp += "<td width=\"28%\" align=\"right\">";
                    ls_temp += "<font color=\"#056ea5\">" + System.DateTime.Parse(dt.Rows[0]["hy_djsj"].ToString()).ToShortDateString().ToString() + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                    ls_temp += "</tr>";
                    ls_temp += "</tbody>";
                    ls_temp += "</table>";
                    ls_temp += "</td>";
                    ls_temp += "</tr>";
                }
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_4\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_4_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            //ls_return += "<a href=\"#\" onclick=\"window.open('list_fl.aspx?key=%u5DF2%u53D1%u5E03&mid=Mudeltzgg&tableid=Tabletzgg&listid=fe10af45-e302-4e56-911e-e73fae37cf5a&rnd=c70a7237-f92f-4d9d-8bd3-e343efba54e3&rnd='+Math.random())\"><font color=\"red\">";
            //ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到会议动态
        if (ls_num == "5")
        {
            ls_show = "即将过期合同";    //这个区域的内容
            int j = 0;
            string sqlSelect = "";
            //合同表单id
            string[] arryStr = new string[] { "Tablesyyhfwxy", "Tablejdhazfwht", "TableVODfwxy", "Tableffpdfwht", "TableDVBazfwdght", "Tablejwdsjsxy", "Tablejwdscsxy", "Tablekdjrht", "Tablesjcsfwht", "Tablesjgdcsfwht", "Tablesjtxyyhzxy" };
            for (int i = 0; i < arryStr.Length; i++)
            {
                sqlSelect = " select * from hyc_" + arryStr[i] + " ";
                DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
                string lsTitle = "";
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["hyc_htzzsj"].ToString() != "")
                    {
                        if ((Convert.ToDateTime(dt.Rows[0]["hyc_htzzsj"].ToString()).AddDays(-5) >= Convert.ToDateTime(DateTime.Now)))
                        {
                            sqlSelect = " select hy_name from hyt_tableconfig where id='" + arryStr[i] + "' ";
                            DataTable dt2 = Hyoa_global.GetDataTable_BASE(sqlSelect);
                            if (dt2.Rows.Count > 0)
                            {
                                lsTitle = "[" + dt2.Rows[0]["hy_name"].ToString() + "]-" + dt.Rows[0]["hyc_jfmc"].ToString();
                                if (lsTitle.Length > 20)
                                    lsTitle = lsTitle.Substring(0, 20) + "...";
                                ls_temp += "<tr>";
                                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                                ls_temp += "<tbody>";
                                ls_temp += "<tr>";
                                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"#\" onclick=\" var path='main_look.aspx?op=modify&mid=" + dt.Rows[0]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[0]["hy_tableid"].ToString() + "&docid=" + dt.Rows[0]["docid"].ToString() + " ';window.open(path) \" >&middot;" + lsTitle + "</a></td>";
                                ls_temp += "<td width=\"28%\" align=\"right\">";
                                ls_temp += "<font color=\"#056ea5\">" + System.DateTime.Parse(dt.Rows[0]["hy_djsj"].ToString()).ToShortDateString().ToString() + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                                ls_temp += "</tr>";
                                ls_temp += "</tbody>";
                                ls_temp += "</table>";
                                ls_temp += "</td>";
                                ls_temp += "</tr>";
                                j++;
                            }
                        }
                    }
                }
                if (j == 5)
                {
                    break;
                }
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_5\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_5_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            //ls_return += "<a href=\"#\" onclick=\"window.open('list.aspx?mid=Mudelhydt&tableid=Tablehydt&listid=72aeaf0e-5387-46c1-a329-654147c634f0&rnd='+Math.random())\"><font color=\"red\">";
            //ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到公文库
        if (ls_num == "6")
        {
            ls_show = "已过期合同";    //这个区域的内容
            string sqlSelect = "";
            int j = 0;
            //合同表单id
            string[] arryStr = new string[] { "Tablesyyhfwxy", "Tablejdhazfwht", "TableVODfwxy", "Tableffpdfwht", "TableDVBazfwdght", "Tablejwdsjsxy", "Tablejwdscsxy", "Tablekdjrht", "Tablesjcsfwht", "Tablesjgdcsfwht", "Tablesjtxyyhzxy" };
            for (int i = 0; i < arryStr.Length; i++)
            {
                sqlSelect = " select * from hyc_" + arryStr[i] + " order by hyc_htzzsj desc ";
                DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
                string lsTitle = "";
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["hyc_htzzsj"].ToString() != "")
                    {
                        if ((Convert.ToDateTime(dt.Rows[0]["hyc_htzzsj"].ToString()) < Convert.ToDateTime(DateTime.Now)))
                        {
                            sqlSelect = " select hy_name from hyt_tableconfig where id='" + arryStr[i] + "' ";
                            DataTable dt2 = Hyoa_global.GetDataTable_BASE(sqlSelect);
                            if (dt2.Rows.Count > 0)
                            {
                                lsTitle = "[" + dt2.Rows[0]["hy_name"].ToString() + "]-" + dt.Rows[0]["hyc_jfmc"].ToString();
                                if (lsTitle.Length > 20)
                                    lsTitle = lsTitle.Substring(0, 20) + "...";
                                ls_temp += "<tr>";
                                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                                ls_temp += "<tbody>";
                                ls_temp += "<tr>";
                                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"#\" onclick=\" var path='main_look.aspx?op=modify&mid=" + dt.Rows[0]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[0]["hy_tableid"].ToString() + "&docid=" + dt.Rows[0]["docid"].ToString() + " ';window.open(path) \" >&middot;" + lsTitle + "</a></td>";
                                ls_temp += "<td width=\"28%\" align=\"right\">";
                                ls_temp += "<font color=\"#056ea5\">" + Convert.ToDateTime(dt.Rows[0]["hy_djsj"].ToString()).ToString("yyyy/MM/dd") + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                                ls_temp += "</tr>";
                                ls_temp += "</tbody>";
                                ls_temp += "</table>";
                                ls_temp += "</td>";
                                ls_temp += "</tr>";
                                j++;
                            }
                        }
                    }
                }
                if (j == 5)
                {
                    break;
                }
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_6\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_6_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            //ls_return += "<a href=\"#\" onclick=\"window.open('gwk/index.aspx?rnd='+Math.random())\"><font color=\"red\">";
            //ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }

        return ls_return;
    }
Пример #18
0
    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();
    }
Пример #19
0
    private void DataPlay()
    {
        //是否流程文档
        this.ddlifflowdoc.Items.Insert(0, "否");
        this.ddlifflowdoc.Items.Insert(1, "是");
        //是否显示所有文档非流程
        this.ddlifdisplayall.Items.Insert(0, "否");
        this.ddlifdisplayall.Items.Insert(1, "是");
        //是否进行评论
        this.ddlifcomment.Items.Insert(0, "否");
        this.ddlifcomment.Items.Insert(1, "是");
        //主表单显示的列数
        this.ddldisplaycol.Items.Insert(0, "4");
        this.ddldisplaycol.Items.Insert(1, "6");
        this.ddldisplaycol.Items.Insert(2, "8");
        this.ddldisplaycol.Items.Insert(3, "10");
        //只对流程模块起作用,流程完成后是否公开,是表示大家都能看,否表示不公开
        this.ddlispuballByflowYB.Items.Insert(0, "否");
        this.ddlispuballByflowYB.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, "--请选择--");
            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_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
            if (this.Request.QueryString["op"] == "modify")
            {
                if (this.Request.QueryString["id"] != null)
                {
                    //根据id得到信息
                    this.txtdocid.Text = this.Request.QueryString["id"].ToString();
                    this.txtdocid.Enabled = false;
                    DataTable dt = Hyoa_tableconfig.GetTable(this.txtdocid.Text);
                    if (dt.Rows.Count > 0)
                    {
                        this.ddlmudelid.SelectedValue = dt.Rows[0]["hy_mudelid"].ToString();
                        this.txtname.Value = dt.Rows[0]["hy_name"].ToString();
                        this.txtsort.Value = dt.Rows[0]["hy_sort"].ToString();
                        this.ddlifflowdoc.SelectedValue = dt.Rows[0]["hy_ifflowdoc"].ToString();
                        this.ddlifdisplayall.SelectedValue = dt.Rows[0]["hy_ifdisplayall"].ToString();
                        this.ddlifcomment.SelectedValue = dt.Rows[0]["hy_ifcomment"].ToString();
                        this.ddlispuballByflowYB.SelectedValue = dt.Rows[0]["hy_ispuballByflowYB"].ToString();
                        this.txthy_onload.Text = dt.Rows[0]["hy_onload"].ToString();
                        this.ddltablerole.SelectedValue = dt.Rows[0]["hy_tablerole"].ToString();
                        this.ddldisplaycol.SelectedValue = dt.Rows[0]["hy_colnum"].ToString();
                    }
                }
            }
            else
            {
                this.txtdocid.Text = "Table";
                //自动获取最大排序号,然后+2
                DataTable dt_maxsort = Hyoa_tableconfig.GetMaxtableconfigsort();
                if (dt_maxsort.Rows.Count > 0)
                    txtsort.Value = (int.Parse(dt_maxsort.Rows[0]["hy_sort"].ToString()) + 2).ToString();
                else
                    txtsort.Value = "1";
            }
        }
    }
Пример #20
0
    private void DataPlay()
    {
        this.btn_submit.Visible = false; //保存
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole("Role9999", (this.Session["hyuid"].ToString())))
        {
            this.btn_submit.Visible = true; //保存
        }

        //加载模块信息
        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, "--请选择--");
            this.ddlmudelid.SelectedIndex = 0;
        }

        //获取排序号
        HyoaClass.Hyoa_role Hyoa_role = new HyoaClass.Hyoa_role();
        DataTable dt = Hyoa_role.GetMaxrolesort();
        if (dt.Rows.Count > 0)
            this.txtno.Value = (System.Int32.Parse(dt.Rows[0]["hy_sort"].ToString()) + 2).ToString();
        else
            this.txtno.Value = "1";
    }
Пример #21
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "复制成功!";

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

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

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

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

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

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

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

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

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

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

            }
            #endregion
        }
        catch
        {
            ls_tip = "复制失败!";
        }
        finally
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location.href='" + txturl.Text + "';</script>");
        }
    }
Пример #22
0
    private void DataPlay()
    {
        //是否启用
        this.ddlifsearch.Items.Insert(0, "是");
        this.ddlifsearch.Items.Insert(1, "否");
        //this.ddlifflowdoc.Items.Insert(0, "是");
        //this.ddlifflowdoc.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;
            //this.ddlmudelid.Items.Insert(0, new ListItem(lsmudel, lsmudelid));

        }
        //dtmudel.Clear();
        //加载列信息
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        DataTable dtflowfield;

        dtflowfield = Hyoa_flowfield.Getflowfields();
        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();

        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")
            {
                string ls_xszd="";
                string ls_xszdid="";
                if (this.Request.QueryString["id"] != null)
                {
                    //根据id得到信息

                    this.txtdocid.Value = this.Request.QueryString["id"].ToString();
                    HyoaClass.DAO db = new HyoaClass.DAO();
                    string sql = "select * from hyt_searchconfig where ID='" + this.txtdocid.Value + "'";
                    DataTable dt = db.GetDataTable(sql);
                    if (dt.Rows.Count > 0)
                    {
                        this.txtsort.Text = dt.Rows[0]["hy_sort"].ToString();
                        //this.txtwidth.Text = dt.Rows[0]["hy_width"].ToString();
                        if (dt.Rows[0]["hy_ifsearch"].ToString() == "是")
                            this.ddlifsearch.SelectedIndex = 0;
                        else
                            this.ddlifsearch.SelectedIndex = 1;

                        this.ddlmudelid.SelectedValue = dt.Rows[0]["hy_mudelid"].ToString();
                        this.hy_field41_1.Value = dt.Rows[0]["hy_kckry"].ToString();
                        this.hy_field43_1.Value = dt.Rows[0]["hy_kckryid"].ToString();
                        //将列都列出来
                        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++)
                        {
                            this.ddlcolumnshowselect.Items.Insert(j, new ListItem(lv_columnshowselect[j], lv_columnshowselectid[j]));
                        }

                        //根据模块信息得到对应的选择表单值
                        if (dt.Rows[0]["hy_tableid"] != "" && dt.Rows[0]["hy_tableid"] != null)
                        {
                            this.ddltableid.Items.Clear();
                            //根据模块ID得到表单ID
                            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                            DataTable dtgettableid = Hyoa_tableconfig.GetTablesbymudelid(dt.Rows[0]["hy_mudelid"].ToString());
                            if (dtgettableid.Rows.Count > 0)
                            {
                                for (var i = 0; i < dtgettableid.Rows.Count; i++)
                                {
                                    this.ddltableid.Items.Insert(i, new ListItem(dtgettableid.Rows[i]["hy_name"].ToString(), dtgettableid.Rows[i]["ID"].ToString()));
                                }
                                this.ddltableid.Items.Insert(0, new ListItem("--请选择--", ""));
                                this.ddltableid.Attributes.Add("onchange ", "mudelidonchang() ");
                                //定位
                                this.ddltableid.SelectedValue = dt.Rows[0]["hy_tableid"].ToString();
                            }
                        }

                        //排序的字段
                        //根据模块ID+表单ID+字段ID得到字段中文名
                        //DataTable dt_flowfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_sortfield"].ToString(), dt.Rows[0]["hy_tableid"].ToString());
                        //if(dt_flowfield.Rows.Count>0)
                        //    this.searchsort.Items.Insert(0, new ListItem(dt_flowfield.Rows[0]["hy_fieldname"].ToString(), dt.Rows[0]["hy_sortfield"].ToString()));

                        //this.ddlsorttype.SelectedValue = dt.Rows[0]["hy_sorttype"].ToString();

                        ls_xszd = dt.Rows[0]["hy_xszd"].ToString();
                        ls_xszdid = dt.Rows[0]["hy_xszdid"].ToString();

                    }
                    dt.Clear();
                    //HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield();
                    //DataTable dt5 = Hyoa_listsearchfield.Getlistsearchfieldsbylistid(this.txtdocid.Value);
                    //if (dt5.Rows.Count > 0)
                    //{
                    //    for (int m = 0; m < dt5.Rows.Count; m++)
                    //    {
                    //        this.searchselect.Items.Insert(m, new ListItem(dt5.Rows[m]["hy_field"].ToString(), dt5.Rows[m]["hy_fieldid"].ToString()));
                    //    }
                    //}
                    string[] lv_xszd = ls_xszd.Split(',');
                    string[] lv_xszdid = ls_xszdid.Split(',');
                    for (int jj = 0; jj < lv_xszd.Length; jj++)
                    {
                        this.searchselect.Items.Insert(jj, new ListItem(lv_xszd[jj], lv_xszdid[jj]));
                    }

                }
            }
        }
    }
Пример #23
0
    //判断是否有权限操作(ROLE中判断)
    //返回值:0(无权限)1(有权限)
    //如果模块未设置权限,则所有人有权限(个人通讯录等模块)
    private string Hy_IfHaveRole(string mudelid, string userid)
    {
        string ls_return = "0";

        //根据模块ID得到ROLEID
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dt_mudel = Hyoa_mudel.Getmudel(mudelid);
        string ls_roleid = "";
        if (dt_mudel.Rows.Count > 0)
        {
            if (dt_mudel.Rows[0]["hy_roleid"].ToString() == "")
            {
                //所有人开放权限
                ls_return = "1";
            }
            else
            {
                ls_roleid = dt_mudel.Rows[0]["hy_roleid"].ToString();
                HyoaClass.Hyoa_roleuser Hyoa_roleuser = new HyoaClass.Hyoa_roleuser();
                ls_return = Hyoa_roleuser.GetIfHaveRoleByroleidanduserid(ls_roleid, userid);
            }
        }
        return ls_return;
    }
Пример #24
0
    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 lssql = "";
        lssql = "select distinct a.DOCID,a.hy_mudelid,a.hy_tableid,a.hy_flowid,a.hy_flowname,a.hy_curtacheid,a.hy_curtachename,a.hy_curclrid,a.hy_curclrname,a.hy_djrid";
        lssql += ",a.hy_djrname,a.hy_djrbmid,a.hy_djrbmname,a.hy_djsj,a.hy_bt";
        lssql += ",a.hy_field1,a.hy_field2,a.hy_field3,a.hy_field4,a.hy_field5,a.hy_field6,a.hy_field7,a.hy_field8,a.hy_field9,a.hy_field10,a.hy_field11";
        lssql += ",a.hy_field12,a.hy_field13,a.hy_field14,a.hy_field15,a.hy_field16,a.hy_field17,a.hy_field18,a.hy_field19,a.hy_field20,a.hy_field21";
        lssql += ",a.hy_field22,a.hy_field23,a.hy_field24,a.hy_field25,a.hy_field26,a.hy_field27,a.hy_field28,a.hy_field29,a.hy_field30,a.hy_field31";
        lssql += ",a.hy_field32,a.hy_field33,a.hy_field34,a.hy_field35,a.hy_field36,a.hy_field37,a.hy_field38,a.hy_field39,a.hy_field40,a.hy_field41";
        lssql += ",a.hy_field42,a.hy_field43,a.hy_field44,a.hy_field45,a.hy_field46,a.hy_field47,a.hy_field48,a.hy_field49,a.hy_field50,a.hy_field51";
        lssql += ",a.hy_field52,a.hy_field53,a.hy_field54,a.hy_field55,a.hy_field56,a.hy_field57,a.hy_field58,a.hy_field59,a.hy_field60,a.hy_field61";
        lssql += ",a.hy_field62,a.hy_field63,a.hy_field64,a.hy_field65,a.hy_field66,a.hy_field67,a.hy_field68,a.hy_field69,a.hy_field70";
        lssql += ",a.hy_field71,a.hy_field72,a.hy_field73,a.hy_field74,a.hy_field75,a.hy_field76,a.hy_field77,a.hy_field78,a.hy_field79,a.hy_field80";
        lssql += ",a.hy_field81,a.hy_field82,a.hy_field83,a.hy_field84,a.hy_field85,a.hy_field86,a.hy_field87,a.hy_field88,a.hy_field89,a.hy_field90";
        lssql += ",a.hy_field91,a.hy_field92,a.hy_field93,a.hy_field94,a.hy_field95,a.hy_field96,a.hy_field97,a.hy_field98,a.hy_field99,a.hy_field100";
        lssql += ",a.hy_iftx,a.hy_zhtxsj,a.hy_readuserlist from hyp_flowmain a,hyp_flowhistoryinfo_cl b ";
        lssql += "where a.DOCID=b.DOCID  and (','+b.hy_clrid+',' like '%," + this.Session["hyuid"].ToString() + ",%' or ','+b.hy_cyrid+',' like '%," + this.Session["hyuid"].ToString() + ",%') and a.hy_curtacheid!='' and a.hy_djrid!='" + this.Session["hyuid"].ToString() + "' and a.hy_curtacheid!='**'";

        if (this.hy_bt_1.Value != "")
        {
            lssql += " and hy_bt like '%" + this.hy_bt_1.Value + "%'";
        }

        lssql += " order by hy_djsj desc ";
        //--根据查询条件得到返回数据集--s
        DataTable dt = db.GetDataTable(lssql);  //当前用户能够看到的未结束的文档
        //--根据查询条件得到返回数据集--e

        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();
    }
Пример #25
0
    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
        //{
        //    this.tddeldoc.Visible = true; //删除
        //}
        //else
        //{
        //    this.tddeldoc.Visible = false; //删除
        //}

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

        //DataTable dt;
        //dt = Hyoa_dbsy.Getdbsys_yb(Session["hyuid"].ToString());
        DataTable dt;
        string lssql22 = "Select * from hyt_dbsy where hy_ifyb=1 and hy_property='待办' and hy_dbrid='" + Session["hyuid"].ToString() + "' ";
        if (this.txtbt.Text != "")
        {
            lssql22 += " and hy_bt like '%" + this.txtbt.Text + "%'";
        }

        lssql22 += " order by hy_createtime desc";
        HyoaClass.DAO db = new HyoaClass.DAO();
        dt = db.GetDataTable(lssql22);

        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("mudelname", typeof(String));
        tempTable.Columns.Add(col);

        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];
            }
            //根据模块ID得到模块名称
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_mudelid"].ToString());
            if(dt_mudel.Rows.Count>0)
                dr["mudelname"] = dt_mudel.Rows[0]["hy_mudelname"].ToString();

            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();
    }
Пример #26
0
    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
        //{
        //    this.tddeldoc.Visible = true; //删除
        //}
        //else
        //{
        //    this.tddeldoc.Visible = false; //删除
        //}

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

        DataTable dt;
        dt = Hyoa_dbsy.Getdbsys_dy(Session["hyuid"].ToString());

        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("mudelname", typeof(String));
        tempTable.Columns.Add(col);

        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];
            }
            //根据模块ID得到模块名称
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_mudelid"].ToString());
            if(dt_mudel.Rows.Count>0)
                dr["mudelname"] = dt_mudel.Rows[0]["hy_mudelname"].ToString();

            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();
    }
Пример #27
0
    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 + "' ";
                            }
                        }
                        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 + " ";
                        }
                    }
                }
            }
        }
        //---查询条件---结束
        //---排序---开始
        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();
            }
        }
        if (dtlist.Rows[0]["hy_sortfield2"].ToString() != "")
        {
            if (cmdStr_SearchSort == "")
            {
                cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield2"].ToString() + " " + dtlist.Rows[0]["hy_sorttype2"].ToString();
            }
            else
            {
                cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield2"].ToString() + " " + dtlist.Rows[0]["hy_sorttype2"].ToString();
            }
        }
        if (dtlist.Rows[0]["hy_sortfield3"].ToString() != "")
        {
            if (cmdStr_SearchSort == "")
            {
                cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield3"].ToString() + " " + dtlist.Rows[0]["hy_sorttype3"].ToString();
            }
            else
            {
                cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield3"].ToString() + " " + dtlist.Rows[0]["hy_sorttype3"].ToString();
            }
        }
        if (this.txtfieldid.Value != "" && this.txtfieldsort.Value != "")
        {
            cmdStr_SearchSort = " order by hyc_" + this.txtfieldid.Value + " " + this.txtfieldsort.Value + " ";
        }
        if (cmdStr_SearchSort == "")
        {
            //没有配置,则默认按登记日期
            cmdStr_SearchSort = " order by hy_djsj desc ";
        }
        //---排序---结束

        //--根据查询条件得到返回数据集--s
        DataTable dt = new DataTable();         //单页数据集
        DataTable dt_total = new DataTable();   //数据总条数,返回总条数值
        DataTable dttable = Hyoa_tableconfig.GetTable(this.txttableid.Value);  //得到表配置信息查看当前表是否有流程 hy_ifflowdoc

        string cmdStr = "";
        string ls_from = "";
        if (Session["conntype"].ToString() == "SQL")
        {
            //edited by xf 20140625
            ls_from = " hyc_" + this.txttableid.Value + " a where (a.hy_clrylist like '%," + Session["hyuid"].ToString() + ",%' or a.hy_cyrylist like '%," + Session["hyuid"].ToString() + ",%') and a.hy_curtacheid<>'**' " + cmdStr_Search;
            cmdStr = "select distinct top " + PageSize.Text + " a.DOCID,a.hy_mudelid,a.hy_tableid,a.hy_flowid,a.hy_flowname,a.hy_curtacheid,a.hy_curtachename,a.hy_curclrid,a.hy_curclrname,a.hy_djrid,a.hy_djrname,a.hy_djrbmid,a.hy_djrbmname,a.hy_djsj,a.hy_bt,a.hy_iftx,a.hy_zhtxsj,a.hy_motherid,a.hy_ifconfirm" + ls_flowfield + " from " + ls_from;
            cmdStr += " and a.DOCID not in (select top " + ((PageNo - 1) * int.Parse(PageSize.Text)).ToString() + " a.DOCID from " + ls_from + cmdStr_SearchSort + ") " + cmdStr_SearchSort;
        }
        if (Session["conntype"].ToString() == "ORACLE")
        {
            cmdStr = " select * from ( ";
            cmdStr += " select my_table.*, rownum as my_rownum from ";
            cmdStr += " ( ";

            cmdStr += " select distinct a.DOCID,a.hy_mudelid,a.hy_tableid,a.hy_flowid,a.hy_flowname,a.hy_curtacheid,a.hy_curtachename,a.hy_curclrid";
            cmdStr += ",a.hy_curclrname,a.hy_djrid,a.hy_djrname,a.hy_djrbmid,a.hy_djrbmname,a.hy_djsj,a.hy_bt,a.hy_iftx,a.hy_zhtxsj";
            cmdStr += ",a.hy_motherid,a.hy_ifconfirm" + ls_flowfield + " from hyc_" + this.txttableid.Value + " a,hyp_flowhistoryinfo_cl b where a.DOCID=b.DOCID ";
            cmdStr += " and (CONCAT(CONCAT(',',b.hy_clrid),',') like '%," + Session["hyuid"].ToString() + ",%' or CONCAT(CONCAT(',',b.hy_cyrid),',') like '%," + Session["hyuid"].ToString();
            cmdStr += ",%') and a.hy_curtacheid<>'**' and (b.hy_ifth!='是' or b.hy_ifth is null) " + cmdStr_Search + cmdStr_SearchSort;

            cmdStr += " )  my_table ";
            cmdStr += " where rownum<= " + ((PageNo) * int.Parse(PageSize.Text)).ToString();
            cmdStr += " ) where my_rownum> " + ((PageNo - 1) * int.Parse(PageSize.Text)).ToString();
        }
        dt = Hyoa_global.GetDataTable(cmdStr);
        if (Session["conntype"].ToString() == "SQL")
        {
            cmdStr = "select count(*) from (select distinct a.DOCID,a.hy_mudelid,a.hy_tableid,a.hy_flowid,a.hy_flowname,a.hy_curtacheid,a.hy_curtachename,a.hy_curclrid,a.hy_curclrname,a.hy_djrid,a.hy_djrname,a.hy_djrbmid,a.hy_djrbmname,a.hy_djsj,a.hy_bt,a.hy_iftx,a.hy_zhtxsj,a.hy_motherid,a.hy_ifconfirm" + ls_flowfield + " from " + ls_from + " ) f";
        }
        if (Session["conntype"].ToString() == "ORACLE")
        {
            cmdStr = "select count(*) from (select distinct a.DOCID from hyc_" + this.txttableid.Value + " a,hyp_flowhistoryinfo_cl b where a.DOCID=b.DOCID ";
            cmdStr += " and (CONCAT(CONCAT(',',b.hy_clrid),',') like '%," + Session["hyuid"].ToString() + ",%' or CONCAT(CONCAT(',',b.hy_cyrid),',') like '%," + Session["hyuid"].ToString();
            cmdStr += ",%') and a.hy_curtacheid<>'**' and (b.hy_ifth!='是' or b.hy_ifth is null) " + cmdStr_Search;
            cmdStr += ")";
        }
        dt_total = Hyoa_global.GetDataTable(cmdStr);
        //--根据查询条件得到返回数据集--e

        //开始输出----整合成HTML为数据行
        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("displaycol", typeof(String)); //定义新的一列  add
        tempTable.Columns.Add(col);  //追加一列  add
        string lscolname = "";
        string lscolnameid = "";
        string lscolwidth = "";
        string ls_col = "";
        string[] lvcolname;
        string[] lvcolnameid;
        string[] lvcolwidth;
        string lscolwidthper;
        lscolname = dtlist.Rows[0]["hy_columnshow"].ToString();  //要显示的列名:附件,标题,收文来源
        lscolnameid = dtlist.Rows[0]["hy_columnshowid"].ToString();  //要显示的列名id:uploadfile1,Hy_bt,Hy_swly
        lscolwidth = dtlist.Rows[0]["hy_width"].ToString();  //要显示的列名id:10,20,30
        lvcolname = lscolname.Split(',');
        lvcolnameid = lscolnameid.Split(',');
        lvcolwidth = lscolwidth.Split(',');
        if (dt.Rows.Count <= 0)
        {
            //如果没有数据则输出表头
            for (int n = 0; n < lvcolname.Length; n++)
            {
                if (n >= lvcolwidth.Length)
                { lscolwidthper = ""; }//此判断是为了防止对应宽度没有输入时,会溢出报错。
                else
                { lscolwidthper = lvcolwidth[n]; }
                this.lbdisplaytitle.Text += "<td width=\"" + lscolwidthper + "%\" class=\"TdcellHead\"><p align=\"center\">" + lvcolname[n] + "</td>";
            }
        }
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow dr = tempTable.NewRow();
            //输出主表所有字段,start
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            //输出主表所有字段,end

            //////开始得到列的值
            DataTable dtgetsqlfield;
            for (int m = 0; m < lvcolname.Length; m++)
            {
                //如果有数据,则输出数据
                if (m >= lvcolwidth.Length)
                { lscolwidthper = ""; }//此判断是为了防止对应宽度没有输入时,会溢出报错。
                else
                { lscolwidthper = lvcolwidth[m]; }

                dtgetsqlfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.txtmudelid.Value, lvcolnameid[m], this.txttableid.Value);

                if (i % System.Int32.Parse(PageSize.Text) == 0)
                    this.lbdisplaytitle.Text += "<td width=\"" + lscolwidthper + "%\" class=\"TdcellHead\"><p align=\"center\"><a href=\"#\" title=\"点击可排序\" onclick=\"fun_sort('" + lvcolnameid[m] + "');\">" + lvcolname[m] + "</a></p></td>";

                //根据字段英文名,得到数据库中对应的字段
                string lsgetsqlfield = "hyc_" + dtgetsqlfield.Rows[0]["hy_fieldid"].ToString();
                //根据数据库中对应的字段,得到输出字段的值start (日期型根据格式进行了转换)
                string lsgetputfiled = "";
                if (dtgetsqlfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                {
                    if (dt.Rows[i][lsgetsqlfield].ToString() != "")
                        lsgetputfiled = System.DateTime.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToShortDateString();
                }
                else
                {
                    //解决Float小数点后面出现N位小数乱码的问题
                    if (dtgetsqlfield.Rows[0]["hy_fieldtype"].ToString() == "数值")
                    {
                        if (dt.Rows[i][lsgetsqlfield].ToString() != "")
                        {
                            //是否包含小数点,包含的话,取小数点后两位
                            if (dt.Rows[i][lsgetsqlfield].ToString().Contains(".") == true)
                            {
                                lsgetputfiled = float.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToString("F2");
                            }
                            else
                            {
                                lsgetputfiled = float.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToString();
                            }
                        }
                        else
                        {
                            lsgetputfiled = "0";
                        }
                        //lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString();
                    }
                    else
                    {
                        lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString();
                    }

                }
                if (lsgetputfiled == "")
                    lsgetputfiled = "&nbsp;";
                //根据得到的SQL字段,得到输出字段的值end
                if (dtgetsqlfield.Rows[0]["hy_ifdbsybt"].ToString() == "是")
                {
                    ls_col += "<td width=\"" + lscolwidthper + "%\" align=\"center\"><a href=\"#\" onclick=\"var ss='main.aspx?op=modify&mid=" + dt.Rows[i]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[i]["hy_tableid"].ToString() + "&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url='+window.location;window.location=ss;\">" + lsgetputfiled + "</a></td>";
                }
                else
                {
                    ls_col += "<td width=\"" + lscolwidthper + "%\" align=\"center\">" + lsgetputfiled + "</td>";
                }
            }
            //如果是流程表单,则最后追加两列(当前环节和当前处理人)
            //表头
            if (dt.Rows[i]["hy_flowid"].ToString() != "" && dt.Rows[i]["hy_flowid"].ToString() != null && i == 0)
            {
                this.lbdisplaytitle.Text += "<td width=\"10%\" class=\"TdcellHead\"><p align=\"center\">当前环节</td>";
                this.lbdisplaytitle.Text += "<td width=\"10%\" class=\"TdcellHead\"><p align=\"center\">当前处理人</td>";
            }
            //数据
            if (dt.Rows[i]["hy_flowid"].ToString() != "" && dt.Rows[i]["hy_flowid"].ToString() != null)
            {
                ls_col += "<td width=\"10%\" align=\"center\">" + dt.Rows[i]["hy_curtachename"].ToString() + "&nbsp;</td>";
                ls_col += "<td width=\"10%\" align=\"center\">" + dt.Rows[i]["hy_curclrname"].ToString() + "&nbsp;</td>";
            }

            dr["displaycol"] = ls_col;  //将新值赋给相应的列  add
            ls_col = "";
            tempTable.Rows.Add(dr);
        }

        int TotalRecord = int.Parse(dt_total.Rows[0][0].ToString());
        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();

        //列表中的一些特殊处理,都放在这个函数内
        DataPlay_Tscl();
    }
Пример #28
0
    public string hy_mudelname()
    {
        string mudelname = "";
        if (this.Request.QueryString["mid"] != null)
        {
            //得到模块中文名
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            string ls_mid = Request.QueryString["mid"].ToString();
            if (ls_mid.IndexOf(',') >= 0)
            {
                ls_mid = ls_mid.Substring(0, ls_mid.IndexOf(','));
            }

            DataTable dtmudel = Hyoa_mudel.Getmudel(ls_mid);
            mudelname = dtmudel.Rows[0]["hy_mudelname"].ToString();
            dtmudel.Clear();
        }
        return mudelname;
    }
Пример #29
0
    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_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (dttableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是")
        {
            //如果有流程的话,新建按钮就一直显示,不用作判断的,只要判断删除按钮就行。
            if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
            {
                this.isrole.Value = "1";
                this.delcontrol.Visible = true;
                this.newcontrol.Visible = true;
                //this.copycontrol.Visible = false;   //流程模块暂时都不能复制
            }
            else
            {
                this.isrole.Value = "0";
                this.newcontrol.Visible = true;
            }
        }
        else
        {
            //如果非流程(授权用户统一管理)
            if(dttableconfig.Rows[0]["hy_tablerole"].ToString() == "0")
            {
                if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
                {
                    this.isrole.Value = "1";
                    this.newcontrol.Visible = true;
                    this.delcontrol.Visible = true;
                    //this.copycontrol.Visible = true;
                }
                else
                {
                    this.isrole.Value = "0";
                }
            }
            //如果非流程(每个人管理自己的信息)
            if (dttableconfig.Rows[0]["hy_tablerole"].ToString() == "1")
            {
                this.isrole.Value = "1";
                this.newcontrol.Visible = true;
                this.delcontrol_my.Visible = true;
                //this.copycontrol.Visible = true;
            }
            //如果非流程(每个人操作自己的信息、授权用户可管理所有信息)
            if (dttableconfig.Rows[0]["hy_tablerole"].ToString() == "2")
            {
                if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
                {
                    this.isrole.Value = "1";
                    this.newcontrol.Visible = true;
                    this.delcontrol.Visible = true;
                    //this.copycontrol.Visible = true;
                }
                else
                {
                    this.isrole.Value = "0";
                    this.newcontrol.Visible = true;
                    this.delcontrol_my.Visible = true;
                    //this.copycontrol.Visible = true;
                }
            }
        }

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

        //---查询条件---开始
        HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
        Hyoa_flowmain.hy_mudelid = this.txtmudelid.Value;
        Hyoa_flowmain.hy_tableid = this.txttableid.Value;
        Hyoa_flowmain.hy_bt = this.hy_bt.Text;
        Hyoa_flowmain.hy_djrname = this.hy_djrname.Text;
        Hyoa_flowmain.hy_djrbmname = this.hy_djrbmname.Text;
        Hyoa_flowmain.hy_djsj_start = this.hy_djsj_start.Text;
        Hyoa_flowmain.hy_djsj_end = this.hy_djsj_end.Text;
        Hyoa_flowmain.hy_bt = this.hy_bt.Text;
        Hyoa_flowmain.hy_content1 = this.hy_content1.Text;
        Hyoa_flowmain.hy_content2 = this.hy_content2.Text;
        Hyoa_flowmain.hy_content3 = this.hy_content3.Text;
        Hyoa_flowmain.hy_content4 = this.hy_content4.Text;
        Hyoa_flowmain.hy_content5 = this.hy_content5.Text;
        Hyoa_flowmain.hy_field1 = this.hy_field1.Text;
        Hyoa_flowmain.hy_field2 = this.hy_field2.Text;
        Hyoa_flowmain.hy_field3 = this.hy_field3.Text;
        Hyoa_flowmain.hy_field4 = this.hy_field4.Text;
        Hyoa_flowmain.hy_field5 = this.hy_field5.Text;
        Hyoa_flowmain.hy_field6 = this.hy_field6.Text;
        Hyoa_flowmain.hy_field7 = this.hy_field7.Text;
        Hyoa_flowmain.hy_field8 = this.hy_field8.Text;
        Hyoa_flowmain.hy_field9 = this.hy_field9.Text;
        Hyoa_flowmain.hy_field10 = this.hy_field10.Text;
        Hyoa_flowmain.hy_field11 = this.hy_field11.Text;
        Hyoa_flowmain.hy_field12 = this.hy_field12.Text;
        Hyoa_flowmain.hy_field13 = this.hy_field13.Text;
        Hyoa_flowmain.hy_field14 = this.hy_field14.Text;
        Hyoa_flowmain.hy_field15 = this.hy_field15.Text;
        Hyoa_flowmain.hy_field16 = this.hy_field16.Text;
        Hyoa_flowmain.hy_field17 = this.hy_field17.Text;
        Hyoa_flowmain.hy_field18 = this.hy_field18.Text;
        Hyoa_flowmain.hy_field19 = this.hy_field19.Text;
        Hyoa_flowmain.hy_field20 = this.hy_field20.Text;
        Hyoa_flowmain.hy_field21 = this.hy_field21.Text;
        Hyoa_flowmain.hy_field22 = this.hy_field22.Text;
        Hyoa_flowmain.hy_field23 = this.hy_field23.Text;
        Hyoa_flowmain.hy_field24 = this.hy_field24.Text;
        Hyoa_flowmain.hy_field25 = this.hy_field25.Text;
        Hyoa_flowmain.hy_field26 = this.hy_field26.Text;
        Hyoa_flowmain.hy_field27 = this.hy_field27.Text;
        Hyoa_flowmain.hy_field28 = this.hy_field28.Text;
        Hyoa_flowmain.hy_field29 = this.hy_field29.Text;
        Hyoa_flowmain.hy_field30 = this.hy_field30.Text;
        Hyoa_flowmain.hy_field31_start = this.hy_field31_start.Text;
        Hyoa_flowmain.hy_field32_start = this.hy_field32_start.Text;
        Hyoa_flowmain.hy_field33_start = this.hy_field33_start.Text;
        Hyoa_flowmain.hy_field34_start = this.hy_field34_start.Text;
        Hyoa_flowmain.hy_field35_start = this.hy_field35_start.Text;
        Hyoa_flowmain.hy_field31_end = this.hy_field31_end.Text;
        Hyoa_flowmain.hy_field32_end = this.hy_field32_end.Text;
        Hyoa_flowmain.hy_field33_end = this.hy_field33_end.Text;
        Hyoa_flowmain.hy_field34_end = this.hy_field34_end.Text;
        Hyoa_flowmain.hy_field35_end = this.hy_field35_end.Text;
        if (this.hy_field36_start.Text == "")
        {
            this.hy_field36_start.Text = "0";
        }
        if (this.hy_field37_start.Text == "")
        {
            this.hy_field37_start.Text = "0";
        }
        if (this.hy_field38_start.Text == "")
        {
            this.hy_field38_start.Text = "0";
        }
        if (this.hy_field39_start.Text == "")
        {
            this.hy_field39_start.Text = "0";
        }
        if (this.hy_field40_start.Text == "")
        {
            this.hy_field40_start.Text = "0";
        }
        if (this.hy_field36_end.Text == "")
        {
            this.hy_field36_end.Text = "0";
        }
        if (this.hy_field37_end.Text == "")
        {
            this.hy_field37_end.Text = "0";
        }
        if (this.hy_field38_end.Text == "")
        {
            this.hy_field38_end.Text = "0";
        }
        if (this.hy_field39_end.Text == "")
        {
            this.hy_field39_end.Text = "0";
        }
        if (this.hy_field40_end.Text == "")
        {
            this.hy_field40_end.Text = "0";
        }
        Hyoa_flowmain.hy_field36_start = float.Parse(this.hy_field36_start.Text);
        Hyoa_flowmain.hy_field37_start = float.Parse(this.hy_field37_start.Text);
        Hyoa_flowmain.hy_field38_start = float.Parse(this.hy_field38_start.Text);
        Hyoa_flowmain.hy_field39_start = float.Parse(this.hy_field39_start.Text);
        Hyoa_flowmain.hy_field40_start = float.Parse(this.hy_field40_start.Text);
        Hyoa_flowmain.hy_field36_end = float.Parse(this.hy_field36_end.Text);
        Hyoa_flowmain.hy_field37_end = float.Parse(this.hy_field37_end.Text);
        Hyoa_flowmain.hy_field38_end = float.Parse(this.hy_field38_end.Text);
        Hyoa_flowmain.hy_field39_end = float.Parse(this.hy_field39_end.Text);
        Hyoa_flowmain.hy_field40_end = float.Parse(this.hy_field40_end.Text);
        Hyoa_flowmain.hy_field41 = this.hy_field41.Text;
        Hyoa_flowmain.hy_field42 = this.hy_field42.Text;
        Hyoa_flowmain.hy_field43 = this.hy_field43.Text;
        Hyoa_flowmain.hy_field44 = this.hy_field44.Text;
        Hyoa_flowmain.hy_field45 = this.hy_field45.Text;
        Hyoa_flowmain.hy_field46 = this.hy_field46.Text;
        Hyoa_flowmain.hy_field47 = this.hy_field47.Text;
        Hyoa_flowmain.hy_field48 = this.hy_field48.Text;
        Hyoa_flowmain.hy_field49 = this.hy_field49.Text;
        Hyoa_flowmain.hy_field50 = this.hy_field50.Text;
        Hyoa_flowmain.hy_field51 = this.hy_field51.Text;
        Hyoa_flowmain.hy_field52 = this.hy_field52.Text;
        Hyoa_flowmain.hy_field53 = this.hy_field53.Text;
        Hyoa_flowmain.hy_field54 = this.hy_field54.Text;
        Hyoa_flowmain.hy_field55 = this.hy_field55.Text;
        Hyoa_flowmain.hy_field56 = this.hy_field56.Text;
        Hyoa_flowmain.hy_field57 = this.hy_field57.Text;
        Hyoa_flowmain.hy_field58 = this.hy_field58.Text;
        Hyoa_flowmain.hy_field59 = this.hy_field59.Text;
        Hyoa_flowmain.hy_field60 = this.hy_field60.Text;

        Hyoa_flowmain.hy_field61_start = this.hy_field61_start.Text;
        Hyoa_flowmain.hy_field62_start = this.hy_field62_start.Text;
        Hyoa_flowmain.hy_field63_start = this.hy_field63_start.Text;
        Hyoa_flowmain.hy_field64_start = this.hy_field64_start.Text;
        Hyoa_flowmain.hy_field65_start = this.hy_field65_start.Text;
        Hyoa_flowmain.hy_field66_start = this.hy_field66_start.Text;
        Hyoa_flowmain.hy_field67_start = this.hy_field67_start.Text;
        Hyoa_flowmain.hy_field68_start = this.hy_field68_start.Text;
        Hyoa_flowmain.hy_field69_start = this.hy_field69_start.Text;
        Hyoa_flowmain.hy_field70_start = this.hy_field70_start.Text;
        Hyoa_flowmain.hy_field61_end = this.hy_field61_end.Text;
        Hyoa_flowmain.hy_field62_end = this.hy_field62_end.Text;
        Hyoa_flowmain.hy_field63_end = this.hy_field63_end.Text;
        Hyoa_flowmain.hy_field64_end = this.hy_field64_end.Text;
        Hyoa_flowmain.hy_field65_end = this.hy_field65_end.Text;
        Hyoa_flowmain.hy_field66_end = this.hy_field66_end.Text;
        Hyoa_flowmain.hy_field67_end = this.hy_field67_end.Text;
        Hyoa_flowmain.hy_field68_end = this.hy_field68_end.Text;
        Hyoa_flowmain.hy_field69_end = this.hy_field69_end.Text;
        Hyoa_flowmain.hy_field70_end = this.hy_field70_end.Text;

        if (this.hy_field71_start.Text == "")
        {
            this.hy_field71_start.Text = "0";
        }
        if (this.hy_field72_start.Text == "")
        {
            this.hy_field72_start.Text = "0";
        }
        if (this.hy_field73_start.Text == "")
        {
            this.hy_field73_start.Text = "0";
        }
        if (this.hy_field74_start.Text == "")
        {
            this.hy_field74_start.Text = "0";
        }
        if (this.hy_field75_start.Text == "")
        {
            this.hy_field75_start.Text = "0";
        }
        if (this.hy_field76_start.Text == "")
        {
            this.hy_field76_start.Text = "0";
        }
        if (this.hy_field77_start.Text == "")
        {
            this.hy_field77_start.Text = "0";
        }
        if (this.hy_field78_start.Text == "")
        {
            this.hy_field78_start.Text = "0";
        }
        if (this.hy_field79_start.Text == "")
        {
            this.hy_field79_start.Text = "0";
        }
        if (this.hy_field80_start.Text == "")
        {
            this.hy_field80_start.Text = "0";
        }
        if (this.hy_field71_end.Text == "")
        {
            this.hy_field71_end.Text = "0";
        }
        if (this.hy_field72_end.Text == "")
        {
            this.hy_field72_end.Text = "0";
        }
        if (this.hy_field73_end.Text == "")
        {
            this.hy_field73_end.Text = "0";
        }
        if (this.hy_field74_end.Text == "")
        {
            this.hy_field74_end.Text = "0";
        }
        if (this.hy_field75_end.Text == "")
        {
            this.hy_field75_end.Text = "0";
        }
        if (this.hy_field76_end.Text == "")
        {
            this.hy_field76_end.Text = "0";
        }
        if (this.hy_field77_end.Text == "")
        {
            this.hy_field77_end.Text = "0";
        }
        if (this.hy_field78_end.Text == "")
        {
            this.hy_field78_end.Text = "0";
        }
        if (this.hy_field79_end.Text == "")
        {
            this.hy_field79_end.Text = "0";
        }
        if (this.hy_field80_end.Text == "")
        {
            this.hy_field80_end.Text = "0";
        }

        if (this.hy_field81_start.Text == "")
        {
            this.hy_field81_start.Text = "0";
        }
        if (this.hy_field82_start.Text == "")
        {
            this.hy_field82_start.Text = "0";
        }
        if (this.hy_field83_start.Text == "")
        {
            this.hy_field83_start.Text = "0";
        }
        if (this.hy_field84_start.Text == "")
        {
            this.hy_field84_start.Text = "0";
        }
        if (this.hy_field85_start.Text == "")
        {
            this.hy_field85_start.Text = "0";
        }
        if (this.hy_field86_start.Text == "")
        {
            this.hy_field86_start.Text = "0";
        }
        if (this.hy_field87_start.Text == "")
        {
            this.hy_field87_start.Text = "0";
        }
        if (this.hy_field88_start.Text == "")
        {
            this.hy_field88_start.Text = "0";
        }
        if (this.hy_field89_start.Text == "")
        {
            this.hy_field89_start.Text = "0";
        }
        if (this.hy_field90_start.Text == "")
        {
            this.hy_field90_start.Text = "0";
        }
        if (this.hy_field81_end.Text == "")
        {
            this.hy_field81_end.Text = "0";
        }
        if (this.hy_field82_end.Text == "")
        {
            this.hy_field82_end.Text = "0";
        }
        if (this.hy_field83_end.Text == "")
        {
            this.hy_field83_end.Text = "0";
        }
        if (this.hy_field84_end.Text == "")
        {
            this.hy_field84_end.Text = "0";
        }
        if (this.hy_field85_end.Text == "")
        {
            this.hy_field85_end.Text = "0";
        }
        if (this.hy_field86_end.Text == "")
        {
            this.hy_field86_end.Text = "0";
        }
        if (this.hy_field87_end.Text == "")
        {
            this.hy_field87_end.Text = "0";
        }
        if (this.hy_field88_end.Text == "")
        {
            this.hy_field88_end.Text = "0";
        }
        if (this.hy_field89_end.Text == "")
        {
            this.hy_field89_end.Text = "0";
        }
        if (this.hy_field90_end.Text == "")
        {
            this.hy_field90_end.Text = "0";
        }
        //ztm
        if (this.hy_field91_start.Text == "")
        {
            this.hy_field91_start.Text = "0";
        }
        if (this.hy_field92_start.Text == "")
        {
            this.hy_field92_start.Text = "0";
        }
        if (this.hy_field93_start.Text == "")
        {
            this.hy_field93_start.Text = "0";
        }
        if (this.hy_field94_start.Text == "")
        {
            this.hy_field94_start.Text = "0";
        }
        if (this.hy_field95_start.Text == "")
        {
            this.hy_field95_start.Text = "0";
        }
        if (this.hy_field96_start.Text == "")
        {
            this.hy_field96_start.Text = "0";
        }
        if (this.hy_field97_start.Text == "")
        {
            this.hy_field97_start.Text = "0";
        }
        if (this.hy_field98_start.Text == "")
        {
            this.hy_field98_start.Text = "0";
        }
        if (this.hy_field99_start.Text == "")
        {
            this.hy_field99_start.Text = "0";
        }
        if (this.hy_field100_start.Text == "")
        {
            this.hy_field100_start.Text = "0";
        }
        if (this.hy_field91_end.Text == "")
        {
            this.hy_field91_end.Text = "0";
        }
        if (this.hy_field92_end.Text == "")
        {
            this.hy_field92_end.Text = "0";
        }
        if (this.hy_field93_end.Text == "")
        {
            this.hy_field93_end.Text = "0";
        }
        if (this.hy_field94_end.Text == "")
        {
            this.hy_field94_end.Text = "0";
        }
        if (this.hy_field95_end.Text == "")
        {
            this.hy_field95_end.Text = "0";
        }
        if (this.hy_field96_end.Text == "")
        {
            this.hy_field96_end.Text = "0";
        }
        if (this.hy_field97_end.Text == "")
        {
            this.hy_field97_end.Text = "0";
        }
        if (this.hy_field98_end.Text == "")
        {
            this.hy_field98_end.Text = "0";
        }
        if (this.hy_field99_end.Text == "")
        {
            this.hy_field99_end.Text = "0";
        }
        if (this.hy_field100_end.Text == "")
        {
            this.hy_field100_end.Text = "0";
        }
        Hyoa_flowmain.hy_field71_start = float.Parse(this.hy_field71_start.Text);
        Hyoa_flowmain.hy_field72_start = float.Parse(this.hy_field72_start.Text);
        Hyoa_flowmain.hy_field73_start = float.Parse(this.hy_field73_start.Text);
        Hyoa_flowmain.hy_field74_start = float.Parse(this.hy_field74_start.Text);
        Hyoa_flowmain.hy_field75_start = float.Parse(this.hy_field75_start.Text);
        Hyoa_flowmain.hy_field76_start = float.Parse(this.hy_field76_start.Text);
        Hyoa_flowmain.hy_field77_start = float.Parse(this.hy_field77_start.Text);
        Hyoa_flowmain.hy_field78_start = float.Parse(this.hy_field78_start.Text);
        Hyoa_flowmain.hy_field79_start = float.Parse(this.hy_field79_start.Text);
        Hyoa_flowmain.hy_field80_start = float.Parse(this.hy_field80_start.Text);

        Hyoa_flowmain.hy_field71_end = float.Parse(this.hy_field71_end.Text);
        Hyoa_flowmain.hy_field72_end = float.Parse(this.hy_field72_end.Text);
        Hyoa_flowmain.hy_field73_end = float.Parse(this.hy_field73_end.Text);
        Hyoa_flowmain.hy_field74_end = float.Parse(this.hy_field74_end.Text);
        Hyoa_flowmain.hy_field75_end = float.Parse(this.hy_field75_end.Text);
        Hyoa_flowmain.hy_field76_end = float.Parse(this.hy_field76_end.Text);
        Hyoa_flowmain.hy_field77_end = float.Parse(this.hy_field77_end.Text);
        Hyoa_flowmain.hy_field78_end = float.Parse(this.hy_field78_end.Text);
        Hyoa_flowmain.hy_field79_end = float.Parse(this.hy_field79_end.Text);
        Hyoa_flowmain.hy_field80_end = float.Parse(this.hy_field80_end.Text);

        Hyoa_flowmain.hy_field81_start = float.Parse(this.hy_field81_start.Text);
        Hyoa_flowmain.hy_field82_start = float.Parse(this.hy_field82_start.Text);
        Hyoa_flowmain.hy_field83_start = float.Parse(this.hy_field83_start.Text);
        Hyoa_flowmain.hy_field84_start = float.Parse(this.hy_field84_start.Text);
        Hyoa_flowmain.hy_field85_start = float.Parse(this.hy_field85_start.Text);
        Hyoa_flowmain.hy_field86_start = float.Parse(this.hy_field86_start.Text);
        Hyoa_flowmain.hy_field87_start = float.Parse(this.hy_field87_start.Text);
        Hyoa_flowmain.hy_field88_start = float.Parse(this.hy_field88_start.Text);
        Hyoa_flowmain.hy_field89_start = float.Parse(this.hy_field89_start.Text);
        Hyoa_flowmain.hy_field90_start = float.Parse(this.hy_field90_start.Text);

        Hyoa_flowmain.hy_field81_end = float.Parse(this.hy_field81_end.Text);
        Hyoa_flowmain.hy_field82_end = float.Parse(this.hy_field82_end.Text);
        Hyoa_flowmain.hy_field83_end = float.Parse(this.hy_field83_end.Text);
        Hyoa_flowmain.hy_field84_end = float.Parse(this.hy_field84_end.Text);
        Hyoa_flowmain.hy_field85_end = float.Parse(this.hy_field85_end.Text);
        Hyoa_flowmain.hy_field86_end = float.Parse(this.hy_field86_end.Text);
        Hyoa_flowmain.hy_field87_end = float.Parse(this.hy_field87_end.Text);
        Hyoa_flowmain.hy_field88_end = float.Parse(this.hy_field88_end.Text);
        Hyoa_flowmain.hy_field89_end = float.Parse(this.hy_field89_end.Text);
        Hyoa_flowmain.hy_field90_end = float.Parse(this.hy_field90_end.Text);

        Hyoa_flowmain.hy_field91_start = float.Parse(this.hy_field91_start.Text);
        Hyoa_flowmain.hy_field92_start = float.Parse(this.hy_field92_start.Text);
        Hyoa_flowmain.hy_field93_start = float.Parse(this.hy_field93_start.Text);
        Hyoa_flowmain.hy_field94_start = float.Parse(this.hy_field94_start.Text);
        Hyoa_flowmain.hy_field95_start = float.Parse(this.hy_field95_start.Text);
        Hyoa_flowmain.hy_field96_start = float.Parse(this.hy_field96_start.Text);
        Hyoa_flowmain.hy_field97_start = float.Parse(this.hy_field97_start.Text);
        Hyoa_flowmain.hy_field98_start = float.Parse(this.hy_field98_start.Text);
        Hyoa_flowmain.hy_field99_start = float.Parse(this.hy_field99_start.Text);
        Hyoa_flowmain.hy_field100_start = float.Parse(this.hy_field100_start.Text);

        Hyoa_flowmain.hy_field91_end = float.Parse(this.hy_field91_end.Text);
        Hyoa_flowmain.hy_field92_end = float.Parse(this.hy_field92_end.Text);
        Hyoa_flowmain.hy_field93_end = float.Parse(this.hy_field93_end.Text);
        Hyoa_flowmain.hy_field94_end = float.Parse(this.hy_field94_end.Text);
        Hyoa_flowmain.hy_field95_end = float.Parse(this.hy_field95_end.Text);
        Hyoa_flowmain.hy_field96_end = float.Parse(this.hy_field96_end.Text);
        Hyoa_flowmain.hy_field97_end = float.Parse(this.hy_field97_end.Text);
        Hyoa_flowmain.hy_field98_end = float.Parse(this.hy_field98_end.Text);
        Hyoa_flowmain.hy_field99_end = float.Parse(this.hy_field99_end.Text);
        Hyoa_flowmain.hy_field100_end = float.Parse(this.hy_field100_end.Text);

        Hyoa_flowmain.hy_curclrid = this.Session["hyuid"].ToString();
        Hyoa_flowmain.hy_curuserid = this.Session["hyuid"].ToString();
        //排序
        HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
        DataTable dt_listconfig = Hyoa_listconfig.GetlistconfigByTableid(this.txttableid.Value);
        if (dt_listconfig.Rows.Count > 0)
        {
            Hyoa_flowmain.hy_sorttype = dt_listconfig.Rows[0]["hy_sortfield"].ToString() + " " + dt_listconfig.Rows[0]["hy_sorttype"].ToString();
        }

        //---查询条件---结束

        //--根据查询条件得到返回数据集--s
        DataTable dt;
        DataTable dttable = Hyoa_tableconfig.GetTable(this.txttableid.Value);  //得到表配置信息查看当前表是否有流程 hy_ifflowdoc
        dt = Hyoa_flowmain.GetflowmainsByIf_db();  //输出当前处理人是自己的dt
        //if (dttable.Rows[0]["hy_ifflowdoc"].ToString()=="是")
        //{
        //    //this.Response.Write("<script>alert('" + dttable.Rows[0]["hy_ispuballByflowYB"].ToString() + "')</script>");
        //     //dt = Hyoa_flowmain.GetflowmainsByIf();  //输出流程的dt
        //    if (dttable.Rows[0]["hy_ispuballByflowYB"].ToString() == "是")
        //    {
        //        dt = Hyoa_flowmain.GetflowmainsByIf_jsDisplayAll();  //输出流程的dt
        //    }
        //    else
        //    {
        //        dt = Hyoa_flowmain.GetflowmainsByIf();  //输出流程的dt
        //    }
        //}
        //else
        //{
        //    if (dttable.Rows[0]["hy_ifdisplayall"].ToString() == "是")
        //    {
        //        dt = Hyoa_flowmain.GetAllflowmainsByNoFlows();//输出所有的dt
        //    }
        //    else
        //    {
        //        dt = Hyoa_flowmain.GetPersonerflowmainsByNoFlows();//输出自己的dt
        //    }
        //}
        //--根据查询条件得到返回数据集--e

        //开始输出----整合成HTML为数据行
        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("displaycol", typeof(String)); //定义新的一列  add
        tempTable.Columns.Add(col);  //追加一列  add
        string lscolname = "";
        string lscolnameid = "";
        string lscolwidth = "";
        string ls_col = "";
        string[] lvcolname;
        string[] lvcolnameid;
        string[] lvcolwidth;
        string lscolwidthper;

        //HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
        DataTable dtlist = Hyoa_listconfig.GetlistconfigsbyMudelidAndTableid(this.txtmudelid.Value,this.txttableid.Value);
        lscolname = dtlist.Rows[0]["hy_columnshow"].ToString();  //要显示的列名:附件,标题,收文来源
        lscolnameid = dtlist.Rows[0]["hy_columnshowid"].ToString();  //要显示的列名id:uploadfile1,Hy_bt,Hy_swly
        lscolwidth = dtlist.Rows[0]["hy_width"].ToString();  //要显示的列名id:10,20,30
        lvcolname = lscolname.Split(',');
        lvcolnameid = lscolnameid.Split(',');
        lvcolwidth = lscolwidth.Split(',');
        if (dt.Rows.Count <= 0)
        {
            //如果没有数据则输出表头
            for (int n = 0; n < lvcolname.Length; n++)
            {
                if (n >= lvcolwidth.Length)
                { lscolwidthper = ""; }//此判断是为了防止对应宽度没有输入时,会溢出报错。
                else
                { lscolwidthper = lvcolwidth[n]; }
                this.lbdisplaytitle.Text += "<td width=\"" + lscolwidthper + "%\" class=\"TdcellHead\"><p align=\"center\">" + lvcolname[n] + "</td>";
            }
        }
        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();
            //输出主表所有字段,start
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            //输出主表所有字段,end

            //////开始得到列的值
            HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
            DataTable dtgetsqlfield;
            for (int m = 0; m < lvcolname.Length; m++)
            {
                //如果有数据,则输出数据
                if (m >= lvcolwidth.Length)
                { lscolwidthper = ""; }//此判断是为了防止对应宽度没有输入时,会溢出报错。
                else
                { lscolwidthper = lvcolwidth[m]; }

                dtgetsqlfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.txtmudelid.Value, lvcolnameid[m],this.txttableid.Value);
                //ztm
                if (i % System.Int32.Parse(PageSize.Text) == 0)
                    this.lbdisplaytitle.Text += "<td width=\"" + lscolwidthper + "%\" class=\"TdcellHead\"><p align=\"center\">" + lvcolname[m] + "</td>";

                //根据字段英文名,得到数据库中对应的字段
                string lsgetsqlfield = dtgetsqlfield.Rows[0]["hy_sqlfield"].ToString();
                //根据数据库中对应的字段,得到输出字段的值start (日期型根据格式进行了转换)
                string lsgetputfiled="";
                if (dtgetsqlfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                {
                    lsgetputfiled = System.DateTime.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToShortDateString();
                }
                else
                {
                    //解决Float小数点后面出现N位小数乱码的问题
                    if (dtgetsqlfield.Rows[0]["hy_fieldtype"].ToString() == "数值")
                    {
                        //是否包含小数点,包含的话,取小数点后两位
                        if (dt.Rows[i][lsgetsqlfield].ToString().Contains(".") == true)
                        {
                            lsgetputfiled = float.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToString("F2");
                        }
                        else
                        {
                            lsgetputfiled = float.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToString();
                        }

                        //lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString();
                    }else
                    {
                        lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString();
                    }

                }
                if (lsgetputfiled == "")
                    lsgetputfiled = "&nbsp;";
                //根据得到的SQL字段,得到输出字段的值end
                if (lsgetputfiled == "1900-1-1")
                    lsgetputfiled = "";
                ls_col += "<td width=\"" + lscolwidthper + "%\" align=\"center\">" + lsgetputfiled + "</td>";
            }
            //如果是流程表单,则最后追加两列(当前环节和当前处理人)
            //表头
            if (dt.Rows[i]["hy_flowid"].ToString() != "" && dt.Rows[i]["hy_flowid"].ToString() != null && i == (PageNo - 1) * System.Int32.Parse(PageSize.Text))
            {
                this.lbdisplaytitle.Text += "<td width=\"10%\" class=\"TdcellHead\"><p align=\"center\">当前环节</td>";
                this.lbdisplaytitle.Text += "<td width=\"10%\" class=\"TdcellHead\"><p align=\"center\">当前处理人</td>";
            }
            //数据
            if (dt.Rows[i]["hy_flowid"].ToString() != "" && dt.Rows[i]["hy_flowid"].ToString() != null)
            {
                ls_col += "<td width=\"10%\" align=\"center\">" + dt.Rows[i]["hy_curtachename"].ToString() + "&nbsp;</td>";
                ls_col += "<td width=\"10%\" align=\"center\">" + dt.Rows[i]["hy_curclrname"].ToString() + "&nbsp;</td>";
            }

            dr["displaycol"] = ls_col;  //将新值赋给相应的列  add
            ls_col = "";
            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();
    }
Пример #30
0
    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.tdnewdoc.Visible = true;
            this.tddeldoc.Visible = true;
        }
        else
        {
            this.isrole.Value = "0";
            this.tdnewdoc.Visible = false;
            this.tddeldoc.Visible = false;
        }

        //如果id等于空,则返回按钮隐藏
        if (this.txtid.Value== "")
        {
            this.btnreturnback.Visible = false;
        }

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

        DataTable dt;
        if (this.txtid.Value == "")
        {
            dt = Hyoa_gwk_class.GetFirstlevClasss_type(this.txttype.Value);
        }
        else
        {
            dt = Hyoa_gwk_class.GetSubClasss_type(this.txtid.Value,this.txttype.Value);
        }

        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();
    }