コード例 #1
0
 /// <summary>
 /// 文章列表 文章浏览 公告栏 新闻栏
 /// </summary>
 /// <param name="num"></param>
 public void WriteSiteMap()
 {
     if (!string.IsNullOrEmpty(Request.QueryString["bum_id"]))
     {
         Master.FindControl("Panel1").Visible = false;
         System.Web.UI.HtmlControls.HtmlGenericControl div = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Panel2");
         string str = div.InnerHtml;
         div.Visible = true;
         Style sty = new Style();
         div.Style.Add(HtmlTextWriterStyle.Display, "''");
         Tunnel.Model.Tunnel_SelType model = new Tunnel.Model.Tunnel_SelType();
         Tunnel.BLL.SelType          stBll;
         Tunnel.BLL.Tunnel_bum       tbBll = new Tunnel.BLL.Tunnel_bum();
         string temp = "项目经理部";
         div.InnerHtml = "<font class='titlfontson'><span><a title='首页' href='/Index.aspx'>首页</a></span>"
                         + "<span> &gt; </span>"
                         + "<span><a title='" + temp + "-" + tbBll.GetModel(Convert.ToInt32(Request.QueryString["bum_id"])).b_name + "' href='/N_Index/xjb2.aspx?bum_id=" + Request.QueryString["bum_id"] + "'>" + temp + "-" + tbBll.GetModel(Convert.ToInt32(Request.QueryString["bum_id"])).b_name + "</a></span>"
                         + "</font>";
         string  strsql = "select * from tunnel_newstype where TypeID=" + Request.QueryString["typeid"];
         DataSet das    = Tunnel.Data.DbHelperSQL.Query(strsql);
         if (das.Tables[0].Rows.Count > 0)
         {
             div.InnerHtml += "<span> &gt; </span>"
                              + "<font class='titlefontson'><span>" + das.Tables[0].Rows[0]["TypeName"] + "</span></font>";
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// 文章列表 文章浏览 公告栏 新闻栏
 /// </summary>
 /// <param name="num"></param>
 public void WriteSiteMap()
 {
     if (!string.IsNullOrEmpty(Request.QueryString["bum_id"]))
     {
         Master.FindControl("Panel1").Visible = false;
         System.Web.UI.HtmlControls.HtmlGenericControl div = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Panel2");
         string str = div.InnerHtml;
         div.Visible = true;
         Style sty = new Style();
         div.Style.Add(HtmlTextWriterStyle.Display, "''");
         Tunnel.Model.Tunnel_SelType model = new Tunnel.Model.Tunnel_SelType();
         Tunnel.BLL.SelType          stBll;
         Tunnel.BLL.Tunnel_bum       tbBll = new Tunnel.BLL.Tunnel_bum();
         string temp = "项目经理部";
         div.InnerHtml = "<font class='titlfontson'><span><a title='首页' href='/Index.aspx'>首页</a></span>"
                         + "<span> &gt; </span>"
                         + "<span onmouseover='showxjb();'>" + temp + "-" + tbBll.GetModel(Convert.ToInt32(Request.QueryString["bum_id"])).b_name + "</span>"
                         + "</font>";
         string        strsql  = "select a.typename,a.typeid from tunnel_newstype a,tunnel_xjbtype b where a.bumname='项目经理部' and b.typeid in (a.typeid)  group by a.typeid,a.typename";
         DataSet       das     = Tunnel.Data.DbHelperSQL.Query(strsql);
         StringBuilder strhtml = new StringBuilder();
         if (das.Tables[0].Rows.Count > 0)
         {
             foreach (DataRow rows in das.Tables[0].Rows)
             {
                 string strtemp = "&nbsp;&nbsp<font class='titlfontson'><a href='/N_Index/xjbmenu.aspx?bum_id=" + Request.QueryString["bum_id"] + "&typeid=" + rows["typeid"].ToString() + "'>" + rows["typename"].ToString() + "</a></font>&nbsp;&nbsp;|";
                 strhtml.Append(strtemp);
             }
         }
         Panel3.InnerHtml = strhtml.ToString();
     }
 }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        List <CacheItems> cList = new List <CacheItems>();

        cList.Clear();
        IDictionaryEnumerator dic = Cache.GetEnumerator();

        while (dic.MoveNext())
        {
            if (dic.Value.GetType().ToString() == "Tunnel.Model.Tunnel_menber")
            {
                cList.Add(new CacheItems(dic.Key.ToString(), dic.Value.GetType().ToString()));
            }
        }
        onLineUser = cList.Count;
        //string aaa=Cache["TunnelLogin-CacheKey-409"].ToString();
        //string strsql = "select count(m_id) as onlineuser from tunnel_menber where m_online = 1";
        //DataSet das = Tunnel.Data.DbHelperSQL.Query(strsql);
        //onLineUser = Convert.ToInt32(das.Tables[0].Rows[0]["onlineuser"]);
        if (!IsPostBack)
        {
            PageBind();
            uid = ul.LoginID.ToString();
            if (ul.LoginID > 0)
            {
                Tunnel.Model.Tunnel_menber model = ul.GetUserBean(ul.LoginID);
                Tunnel.BLL.Tunnel_bum      bm    = new Tunnel.BLL.Tunnel_bum();
                if (model != null)
                {
                    userbum = model.m_login + " | ";
                }
                if (model != null && model.m_bum > 0)
                {
                    if (bm.GetModel(model.m_bum) != null)
                    {
                        userbum += bm.GetModel(model.m_bum).b_name;
                    }
                }
                else
                {
                    userbum += "部门未分组";
                }
            }
            Label1.ToolTip = userbum;
        }
    }
コード例 #4
0
ファイル: Tunnel_DutyList.aspx.cs プロジェクト: 262734254/OA
    public string retBum(object obj)
    {
        string a = "";

        if (tb.GetModelList("b_id=" + obj.ToString() + "").Count != 0)
        {
            a = tb.GetModel(Convert.ToInt64(obj)).b_name;
        }
        return(a);
    }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         this.InitTree(TreeView1.Nodes, "0");
         BindDrop();
         if (!string.IsNullOrEmpty(Request.QueryString["act"]))
         {
             state = Request.QueryString["act"].ToString();
             if (!string.IsNullOrEmpty(Request.QueryString["id"]))
             {
                 bid = Request.QueryString["id"].ToString();
                 DropDownList1.Items.FindByValue(bm.GetModel(Convert.ToInt32(bid)).b_hid.ToString()).Selected = true;
                 txtname.Text  = bm.GetModel(Convert.ToInt32(bid)).b_name;
                 txtname2.Text = bm.GetModel(Convert.ToInt32(bid)).b_depict;
             }
             else
             {
                 bid = "0";
             }
             if (state == "upd")
             {
                 DropDownList1.Enabled = false;
             }
             else if (state == "del")
             {
                 if (DelBum())
                 {
                     Tunnel.Common.Message.Show("删除成功", "Tunnel_Bum.aspx");
                 }
                 else
                 {
                     Tunnel.Common.Message.Show("存在下级机构", "Tunnel_Bum.aspx");
                 }
             }
             else
             {
                 Tunnel.Common.Message.Show("非法访问", "../../default.aspx");
             }
         }
         else
         {
             state = string.Empty;
             DropDownList1.Enabled = true;
         }
     }
 }
コード例 #6
0
    public void bind()
    {
        txtIdKard.Text = tmm.m_idcard;

        if (tj.GetModelList("j_id=" + tmm.m_jiao + "").Count != 0)
        {
            txtjuese.Text = tj.GetModel(Convert.ToInt64(tmm.m_jiao)).j_name;
        }
        if (tb.GetModelList("b_id=" + tmm.m_bum + "").Count != 0)
        {
            txtbumen.Text = tb.GetModel(Convert.ToInt64(tmm.m_bum)).b_name;
        }
        if (td.GetModelList("d_id=" + tmm.m_duty + "").Count != 0)
        {
            txtZhiwu.Text = td.GetModel(Convert.ToInt64(tmm.m_duty)).d_name;
        }
        if (tmm.m_xjb.ToString().Trim() != "")
        {
            List <Tunnel_xjbType> xjbList = xjbB.GetModelList(string.Format("id in ({0})", tmm.m_xjb.Replace("|", ",")));
            foreach (Tunnel.Model.Tunnel_xjbType item in xjbList)
            {
                txtXJB.Text += item.Typename + ",";
            }
            if (txtXJB.Text.Trim() != "")
            {
                txtXJB.Text = txtXJB.Text.Trim().Substring(0, txtXJB.Text.Trim().Length - 1);
            }
        }
        if (tmm.m_KSID.ToString().Trim() != "")
        {
            List <Tunnel_SelType> ksList = st.GetModelList(string.Format("KSID in ({0})", tmm.m_KSID));
            string ks = "";
            foreach (Tunnel_SelType item in ksList)
            {
                if (ks == item.KSID.ToString())
                {
                    continue;
                }
                else
                {
                    lblKS.Text += item.TypeName + ",";
                    ks          = item.KSID.ToString();
                }
            }
        }
        txtMail.Text     = tmm.m_mail;
        txtName.Text     = tmm.m_name;
        txtState.Text    = tmm.m_state == 1 ? "锁定" : "开启";
        txtTel.Text      = tmm.m_mobile;
        txtUserName.Text = tmm.m_login;
        txtBirth.Text    = tmm.m_birth.ToShortDateString() == "1800-1-1" ? "" : tmm.m_birth.ToShortDateString();
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            titleId = 0;
            //this.Label1.Visible = false;
            //根据登录者ID判断是否存在于某部门

            //如果是管理员登陆,则可查看所有列表信息

            if (ul.LoginID == 1 || "系统管理员" == ul.JiaoSe(ul.LoginID))
            {
                //mostList = st.GetModelList("1=1 and bumname not in ('党工团','项目经理部') order by bumname desc");
                mostList = st.GetModelList("1=1 order by bumname desc");
                //若系统管理员也属于某部门
            }
            else
            {
                //若此用户不在任何部门里,则无操作
                if (tm.GetModel(ul.LoginID).m_bum == 0)
                {
                    //this.Label1.Visible = true;
                }
                else
                {
                    //若是用户登录,则根据其所属部门得出相应列表信息

                    // 根据登陆ID 找到 member表里对应的m_bum部门ID,然后再找出部门名称

                    most.BumID   = tm.GetModel(ul.LoginID).m_bum.ToString().Trim();
                    most.BumName = tb.GetModel(long.Parse(most.BumID.ToString())).b_name;
                    // st.GetModelList("BumName=" + most.BumName);
                    mostList = st.GetModelList("BumName='" + most.BumName + "' or bumname in ('科室信息','总工室')");
                }
            }

            if (!string.IsNullOrEmpty(Request.QueryString["pagetitle"]))
            {
                titleId = Convert.ToInt32(Request.QueryString["pagetitle"]);
                if (titleId == 1)
                {
                    pagetitlestr = "科室信息修改";
                }
                indexId = 0;
                indexId = Convert.ToInt32(Request.QueryString["indexId"]);
                PageBind(indexId);
            }
        }
    }
コード例 #8
0
    /// <summary>
    /// 判断是否属于打分部门并提取所有工作类型ID
    /// </summary>
    public void CheckBumAndWork()
    {
        if (Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "考核打分", "统计报表", false))
        {
            if (tm.GetModel(Convert.ToInt64(ul.LoginID.ToString())).m_bum != 0)
            {
                BumID   = tm.GetModel(Convert.ToInt64(ul.LoginID.ToString())).m_bum;
                BumName = tb.GetModel(Convert.ToInt64(BumID.ToString())).b_name;
                twList  = tw.GetModelList("1=1");
                if (twList.Count > 0)
                {
                    foreach (Tunnel.Model.Tunnel_work item in twList)
                    {
                        tkBumList += item.w_bumName + "|";
                    }
                }
                else
                {
                    Response.Redirect("error.aspx?id=无工作类型");
                }
                if (tkBumList.IndexOf(BumName) > -1)
                {
                    twList = tw.GetModelList("w_bumname='" + BumName + "'");

                    foreach (Tunnel.Model.Tunnel_work item in twList)
                    {
                        tkWorkList += item.w_id.ToString() + "," + item.w_maxCent.ToString() + "|";
                    }
                    if (tkWorkList.Length > 1)
                    {
                        tkWorkList = tkWorkList.Substring(0, tkWorkList.Length - 1);
                    }
                }
                else
                {
                    Response.Redirect("error.aspx?id=所在部门不在评分部门范围");
                }
            }
            else
            {
                Response.Redirect("error.aspx?id=您现在不属于任何部门");
            }
        }
        else
        {
            Response.Redirect("error.aspx?id=无评分权限");
        }
    }
コード例 #9
0
 /// <summary>
 /// 得到 类型ID 和 ID
 /// </summary>
 public void getIdtypeId(ref int tmpId, ref int typeId)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["uid"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["uid"].ToString());
         tempName = "用户管理";
         Tunnel.BLL.Tunnel_menber   menberBLL   = new Tunnel.BLL.Tunnel_menber();
         Tunnel.Model.Tunnel_menber menberModel = menberBLL.GetModel(tmpId);
         tempName_TypeName = menberModel.m_name;
         typeId            = 1;
         if (!string.IsNullOrEmpty(Request.QueryString["uid"]))
         {
             GetUserAllPermission(int.Parse(Request.QueryString["uid"]));
         }
     }
     if (!string.IsNullOrEmpty(Request.QueryString["jid"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["jid"].ToString());
         tempName = "角色管理";
         Tunnel.BLL.Tunnel_jiaose   jiaoseBLL   = new Tunnel.BLL.Tunnel_jiaose();
         Tunnel.Model.Tunnel_jiaose jiaoseModel = jiaoseBLL.GetModel(tmpId);
         tempName_TypeName   = jiaoseModel.j_name;
         this.tmpSet.Visible = false;
         typeId = 2;
     }
     if (!string.IsNullOrEmpty(Request.QueryString["did"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["did"].ToString());
         tempName = "职位管理";
         Tunnel.BLL.Tunnel_duty   dutyBLL   = new Tunnel.BLL.Tunnel_duty();
         Tunnel.Model.Tunnel_duty dutyModel = dutyBLL.GetModel(tmpId);
         tempName_TypeName   = dutyModel.d_name;
         this.tmpSet.Visible = false;
         typeId = 3;
     }
     if (!string.IsNullOrEmpty(Request.QueryString["bid"]))
     {
         tmpId = Convert.ToInt32(Request.QueryString["bid"].ToString());
         Tunnel.BLL.Tunnel_bum   bumBLL    = new Tunnel.BLL.Tunnel_bum();
         Tunnel.Model.Tunnel_bum bumModels = bumBLL.GetModel(tmpId);
         tempName_TypeName   = bumModels.b_name;
         tempName            = "部门管理";
         this.tmpSet.Visible = false;
         typeId = 4;
     }
 }
コード例 #10
0
    public string GetBum(object o)
    {
        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel_menber();
        tmm = tm.GetModel(Convert.ToInt64(o.ToString()));
        string strTemp = string.Empty;

        if (tmm != null)
        {
            Tunnel_bum            tbb = new Tunnel_bum();
            Tunnel.BLL.Tunnel_bum tb  = new Tunnel.BLL.Tunnel_bum();
            tbb = tb.GetModel(Convert.ToInt64(tmm.m_bum.ToString()));
            if (tbb != null)
            {
                strTemp = tbb.b_name;
            }
        }
        return(strTemp);
    }
コード例 #11
0
 public void ListBind()
 {
     if (ul.JiaoSe(ul.LoginID).Equals("系统管理员"))
     {
         where = "";
         PageBind2();
     }
     else
     {
         Tunnel.BLL.Tunnel_bum tb  = new Tunnel.BLL.Tunnel_bum();
         Tunnel_bum            tbb = new Tunnel_bum();
         tmm = tm.GetModel(Convert.ToInt64(ul.LoginID.ToString()));
         if (tmm != null)
         {
             if (!string.IsNullOrEmpty(tmm.m_bum.ToString()))
             {
                 tbb = tb.GetModel(Convert.ToInt64(tmm.m_bum.ToString()));
                 if (tbb != null)
                 {
                     List <Tunnel.Model.Tunnel_SelType> tsList = new List <Tunnel_SelType>();
                     Tunnel.BLL.SelType tst = new Tunnel.BLL.SelType();
                     tsList = tst.GetModelList("");
                     // bumname='" + tbb.b_name + "'
                     if (tsList.Count > 0)
                     {
                         for (int i = 0; i < tsList.Count; i++)
                         {
                             bhtype += tsList[i].TypeID.ToString() + "|";
                         }
                         if (bhtype.Length > 0)
                         {
                             bhtype = bhtype.Substring(0, bhtype.Length - 1);
                         }
                     }
                     where = "";
                     for (int i = 0; i < bhtype.Split('|').Length; i++)
                     {
                         if (where.Length > 0)
                         {
                             if (i == bhtype.Split('|').Length - 1)
                             {
                                 where += "  or typeid=" + bhtype.Split('|')[i] + ")";
                             }
                             else
                             {
                                 where += "  or typeid=" + bhtype.Split('|')[i] + "";
                             }
                         }
                         else
                         {
                             where += "   (typeid=" + bhtype.Split('|')[i] + "";
                         }
                     }
                     PageBind2();
                 }
                 else
                 {
                     MTCPager1.RecordCount = 0;
                 }
             }
         }
     }
 }
コード例 #12
0
ファイル: N_KeshiAdd.aspx.cs プロジェクト: 262734254/OA
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            titleId             = 0;
            this.Label1.Visible = false;
            //根据登录者ID判断是否存在于某部门

            //如果是管理员登陆,则可查看所有列表信息

            if (ul.LoginID == 1 || "系统管理员" == ul.JiaoSe(ul.LoginID))
            {
                //mostList = st.GetModelList("1=1 and bumname not in ('党工团','项目经理部') order by bumname desc");
                mostList = st.GetModelList("1=1 order by bumname desc");
                //若系统管理员也属于某部门

                for (int t = 0; t < mostList.Count; t++)
                {
                    DropDownList1.Items.Add(new ListItem(mostList[t].TypeName + "(" + mostList[t].BumName + ")", mostList[t].TypeID.ToString()));
                }
                DropDownList1.Items.Insert(0, new ListItem("-请选择-", "0"));
            }
            else
            {
                //若此用户不在任何部门里,则无操作
                if (tm.GetModel(ul.LoginID).m_bum == 0)
                {
                    this.Label1.Visible = true;
                }
                else
                {
                    //若是用户登录,则根据其所属部门得出相应列表信息

                    // 根据登陆ID 找到 member表里对应的m_bum部门ID,然后再找出部门名称

                    most.BumID   = tm.GetModel(ul.LoginID).m_bum.ToString().Trim();
                    most.BumName = tb.GetModel(long.Parse(most.BumID.ToString())).b_name;
                    // st.GetModelList("BumName=" + most.BumName);
                    mostList = st.GetModelList("BumName='" + most.BumName + "' or bumname in ('科室信息','总工室')");

                    for (int j = 0; j < mostList.Count; j++)
                    {
                        DropDownList1.Items.Add(new ListItem(mostList[j].TypeName + "(" + mostList[j].BumName + ")", mostList[j].TypeID.ToString()));
                    }
                    DropDownList1.Items.Insert(0, new ListItem("-请选择-", "0"));
                    //if (!Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "党建", "党工团", false))
                    //{
                    //    ListItem li = DropDownList1.Items.FindByText("党建动态(党工团)");
                    //    ListItem li1 = DropDownList1.Items.FindByText("党务资料(党工团)");
                    //    DropDownList1.Items.Remove(li);
                    //    DropDownList1.Items.Remove(li1);
                    //}
                    //if (!Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "工会", "党工团", false))
                    //{
                    //    ListItem li = DropDownList1.Items.FindByText("工会动态(党工团)");
                    //    ListItem li1 = DropDownList1.Items.FindByText("工会资料(党工团)");
                    //    DropDownList1.Items.Remove(li);
                    //    DropDownList1.Items.Remove(li1);
                    //}
                    //if (!Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "团务", "党工团", false))
                    //{
                    //    ListItem li = DropDownList1.Items.FindByText("团务动态(党工团)");
                    //    ListItem li1 = DropDownList1.Items.FindByText("团务资料(党工团)");
                    //    DropDownList1.Items.Remove(li);
                    //    DropDownList1.Items.Remove(li1);
                    //}
                    if (!Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "工程警示", "科室信息", false))
                    {
                        ListItem li = DropDownList1.Items.FindByText("工程警示(科室信息)");
                        DropDownList1.Items.Remove(li);
                    }
                    if (!Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "先锋视野", "科室信息", false))
                    {
                        ListItem li = DropDownList1.Items.FindByText("先锋视野(科室信息)");
                        DropDownList1.Items.Remove(li);
                    }
                    if (!Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "总工室", "科室信息", false))
                    {
                        ListItem li  = DropDownList1.Items.FindByText("技术动态(总工室)");
                        ListItem li1 = DropDownList1.Items.FindByText("技术资料(总工室)");
                        ListItem li2 = DropDownList1.Items.FindByText("技术管理(总工室)");
                        DropDownList1.Items.Remove(li);
                        DropDownList1.Items.Remove(li1);
                        DropDownList1.Items.Remove(li2);
                    }
                }
            }

            if (!string.IsNullOrEmpty(Request.QueryString["pagetitle"]))
            {
                titleId = Convert.ToInt32(Request.QueryString["pagetitle"]);
                if (titleId == 1)
                {
                    pagetitlestr = "科室信息修改";
                }
                indexId = 0;
                indexId = Convert.ToInt32(Request.QueryString["indexId"]);
                PageBind(indexId);
            }

            BindDownList();
        }
    }
コード例 #13
0
    public void showHtml(int d)
    {
        Tunnel.BLL.Tunnel_MingXing          tmx      = new Tunnel.BLL.Tunnel_MingXing();
        Tunnel.Model.Tunnel_MingXing        tmxx     = new Tunnel.Model.Tunnel_MingXing();
        List <Tunnel.Model.Tunnel_MingXing> tmxxList = new List <Tunnel.Model.Tunnel_MingXing>();

        if (d == -1)
        {
            tmxxList = tmx.GetModelList(" 1=1 order by Convert(datetime,str(m_year)+'-'+str(M_moon)+'-'+'01') desc");
            if (tmxxList.Count > 0)
            {
                d = tmxxList[0].m_id;
            }
        }

        tmxxList = tmx.GetModelList("m_id = " + d + "");

        for (int i = 0; i < tmxxList.Count; i++)
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
            tmm = tm.GetModel(Convert.ToInt64(tmxxList[i].m_uid));
            if (tmm != null)
            {
                name = tmm.m_name;
                Tunnel.BLL.Tunnel_bum   tb  = new Tunnel.BLL.Tunnel_bum();
                Tunnel.Model.Tunnel_bum tbb = new Tunnel.Model.Tunnel_bum();
                tbb = tb.GetModel(Convert.ToInt64(tmm.m_bum));
                if (tbb != null)
                {
                    bum = tbb.b_name;
                }
            }
            title   = tmxxList[i].Title.ToString();
            year    = tmxxList[i].m_year.ToString();
            moon    = tmxxList[i].m_moon.ToString();
            img     = "../N_MyWork/N_Star/" + tmxxList[i].m_img;
            content = tmxxList[i].m_content;
        }

        lblcontent.Text = content;


        string dateStr = string.Empty;

        string  tempYear = year;
        string  tempMoon = moon;
        string  tempSql  = @"
select * from (select top 4 * from (select top 4 * from tunnel_mingxing where  
Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01') 
<substring(Convert(varchar,'" + year + "-" + (moon.Length == 1 ? "0" + moon : moon) + "-01" + @"',20),0,8)+'-01'  
order by Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01') 
desc) as bb order by 
Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01')) 
 as tunnel_mingxing 
union all  
select * from (select top 1 * from tunnel_mingxing where  
Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01') 
=substring(Convert(varchar,'" + year + "-" + (moon.Length == 1 ? "0" + moon : moon) + "-01" + @"',20),0,8)+'-01' ) as tunnel_mingxing 
union all 
select * from (select top 4 * from tunnel_mingxing where  
Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01') 
>substring(Convert(varchar,'" + year + "-" + (moon.Length == 1 ? "0" + moon : moon) + "-01" + @"',20),0,8)+'-01' ) as tunnel_mingxing 
 ";
        DataSet ds       = Tunnel.Data.DbHelperSQL.Query(tempSql);

        tmxxList = tmx.DataTableToList(ds.Tables[0]);

        foreach (Tunnel.Model.Tunnel_MingXing item in tmxxList)
        {
            if (item.m_year == Convert.ToInt32(year) && Convert.ToInt32(item.m_moon) == Convert.ToInt32(moon))
            {
                dateStr += "<a href=?id=" + item.m_id + "><font color=\"red\" style=\"14px\" >" + item.m_year + "-" + item.m_moon + "</font></a>  ";
            }
            else
            {
                dateStr += "<a href=?id=" + item.m_id + "><font color=\"black\" style=\"12px\" >" + item.m_year + "-" + item.m_moon + "</font></a>  ";
            }
        }

        //Label1.Text = dateStr;
    }
コード例 #14
0
    /// <summary>
    /// 明星员工
    /// </summary>
    /// <param name="d"></param>
    public void showHtml(int d)
    {
        Tunnel.BLL.Tunnel_MingXing          tmx      = new Tunnel.BLL.Tunnel_MingXing();
        Tunnel.Model.Tunnel_MingXing        tmxx     = new Tunnel.Model.Tunnel_MingXing();
        List <Tunnel.Model.Tunnel_MingXing> tmxxList = new List <Tunnel.Model.Tunnel_MingXing>();

        if (d == -1)
        {
            tmxxList = tmx.GetModelList(" 1=1 order by Convert(datetime,str(m_year)+'-'+str(M_moon)+'-'+'01') desc");
            if (tmxxList.Count > 0)
            {
                d = tmxxList[0].m_id;
            }
        }

        tmxxList = tmx.GetModelList("m_id = " + d + "");

        for (int i = 0; i < tmxxList.Count; i++)
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
            tmm = tm.GetModel(Convert.ToInt64(tmxxList[i].m_uid));
            if (tmm != null)
            {
                name = tmm.m_name;
                Tunnel.BLL.Tunnel_bum   tb  = new Tunnel.BLL.Tunnel_bum();
                Tunnel.Model.Tunnel_bum tbb = new Tunnel.Model.Tunnel_bum();
                tbb = tb.GetModel(Convert.ToInt64(tmm.m_bum));
                if (tbb != null)
                {
                    bum = tbb.b_name;
                    if (!string.IsNullOrEmpty(bum))
                    {
                        if (bum.Length > 8)
                        {
                            bum = bum.Substring(0, 8);
                        }
                    }
                }

                Tunnel.BLL.Tunnel_duty   td  = new Tunnel.BLL.Tunnel_duty();
                Tunnel.Model.Tunnel_duty tdd = new Tunnel.Model.Tunnel_duty();
                tdd = td.GetModel(Convert.ToInt64(tmm.m_duty));
                if (tdd != null)
                {
                    duty = tdd.d_name;
                }
            }
            year = tmxxList[i].m_year.ToString();
            moon = tmxxList[i].m_moon.ToString();
            img  = "N_MyWork/N_Star/" + tmxxList[i].m_img;
            mxId = tmxxList[i].m_id.ToString();
        }

        string tempYear = DateTime.Now.AddMonths(-12).Year.ToString();
        string tempMoon = DateTime.Now.AddMonths(-12).Month.ToString();

        tmxxList = tmx.GetModelList("m_year >= " + tempYear + "  order by Convert(datetime,str(m_year)+'-'+str(M_moon)+'-'+'01') asc");

        int count = 0;

        foreach (Tunnel.Model.Tunnel_MingXing item in tmxxList)
        {
            if (item.m_moon >= Convert.ToInt32(tempMoon) || item.m_year != DateTime.Now.Year)
            {
                content += "<a href=?id=" + item.m_id + ">" + item.m_year + "-" + item.m_moon + "</a>  ";
                count++;
            }
            if (count > 1)
            {
                break;
            }
        }
    }
コード例 #15
0
    /// <summary>
    /// 文章列表 文章浏览 公告栏 新闻栏
    /// </summary>
    /// <param name="num"></param>
    public void WriteSiteMap(int num)
    {
        Master.FindControl("Panel1").Visible = false;
        System.Web.UI.HtmlControls.HtmlGenericControl div = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Panel2");
        string str = div.InnerHtml;

        div.Visible = true;
        Style sty = new Style();

        div.Style.Add(HtmlTextWriterStyle.Display, "''");
        Tunnel.Model.Tunnel_SelType model = new Tunnel_SelType();
        Tunnel.BLL.SelType          stBll;
        Tunnel.BLL.Tunnel_bum       tbBll = new Tunnel.BLL.Tunnel_bum();
        string temp = "";

        if (typeId < 1)
        {
            switch (typeId)
            {
            case -1:
                temp          = "公告栏";
                model.BumName = "";
                break;

            case 0:
                temp          = "公司新闻";
                model.BumName = "";
                break;
            }
        }
        else
        {
            stBll = new Tunnel.BLL.SelType();
            model = stBll.GetModel(typeId);
            if (model != null)
            {
                temp = model.TypeName;
            }
        }
        if (bum_id != 0)
        {
            div.InnerHtml = "<font class='titlfontson'><span><a title='首页' href='/Index.aspx'>首页</a></span>"
                            + "<span> &gt; </span>"
                            + "<span><a title='" + model.BumName + "-" + tbBll.GetModel(bum_id).b_name + "' href='/" + model.Url + "?bum_id=" + bum_id + "'>" + model.BumName + "-" + tbBll.GetModel(bum_id).b_name + "</a></span>"
                            + "<span> &gt; </span>"
                            + "<span><a title='" + temp + "' href='/N_Index/DataTypeListXJB.aspx?typeid=" + model.TypeID + "&lanmuId=0&bum_id=" + bum_id + "'>" + temp + "</a></span>"
                            + "<span> &gt; </span>"
                            + "<span>详细信息</span>"
                            + "</font>";
        }
        else
        {
            div.InnerHtml = "<font class='titlfontson'><span><a title='首页' href='/Index.aspx'>首页</a></span>"
                            + "<span> &gt; </span>"
                            + "<span><a title='" + model.BumName + "' href='/" + model.Url + "'>" + model.BumName + "</a></span>"
                            + "<span> &gt; </span>"
                            + "<span><a title='" + temp + "' href='/N_Index/DataTypeList.aspx?typeid=" + model.TypeID + "&lanmuId=0'>" + temp + "</a></span>"
                            + "<span> &gt; </span>"
                            + "<span>详细信息</span>"
                            + "</font>";
        }
    }