コード例 #1
0
 private DataSet createDataSet()//返回数据库表
 {
     Tunnel.BLL.Tunnel_bum tb = new Tunnel.BLL.Tunnel_bum();
     ds = new DataSet();
     ds = tb.GetList("");
     return(ds);
 }
コード例 #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
ファイル: ProjectList.aspx.cs プロジェクト: 262734254/OA
    private void Bind()
    {
        DataSet ds = new DataSet();
        List <Tunnel.Model.Tunnel_bum> ListTbModel = new List <Tunnel.Model.Tunnel_bum>();

        Tunnel.BLL.Tunnel_bum tbBll = new Tunnel.BLL.Tunnel_bum();
        ListTbModel = tbBll.GetModelList("");
        foreach (Tunnel.Model.Tunnel_bum tbModel in ListTbModel)
        {
            if (tbModel.b_projectid != 0)
            {
                Tunnel.Data.AllProJectDataBase allData = new Tunnel.Data.AllProJectDataBase("001");//Convert.ToInt32(tbModel.b_id));
                DataTable dt = new DataTable();
                dt = allData.GetAllTableList("Violation_Menber", "1=1", "order by Vio_Date Desc");
                ds.Tables.Add(dt.Copy());
            }
        }
        PagedDataSource pds = new PagedDataSource();

        pds.DataSource  = ds.Tables[0].DefaultView;//设置数据源(DataTable类型)
        pds.AllowPaging = true;
        //每页显示的行数
        //pds.PageSize = 12;
        AspNetPager1.RecordCount = pds.Count;
        pds.CurrentPageIndex     = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize             = AspNetPager1.PageSize;
        Repeater1.DataSource     = pds;
        Repeater1.DataBind();
    }
コード例 #4
0
ファイル: Tunnel_DutyUpd.aspx.cs プロジェクト: 262734254/OA
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DropBind();
         if (string.IsNullOrEmpty(Request.QueryString["updid"]))
         {
             Tunnel.Common.Message.Show("非法访问!", "tunnel_dutylist.aspx");
         }
         else
         {
             did = Request.QueryString["updid"].ToString();
             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(did));
             txtName.Text  = tdd.d_name;
             txtName2.Text = tdd.d_depict;
             Tunnel.BLL.Tunnel_bum tb = new Tunnel.BLL.Tunnel_bum();
             if (tb.GetModelList("b_id=" + tdd.d_flag + "").Count > 0)
             {
                 DropDownList1.Items.FindByValue(tdd.d_flag).Selected = true;
             }
         }
     }
 }
コード例 #5
0
ファイル: Project_Manage.aspx.cs プロジェクト: 262734254/OA
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.Params["DeleteId"]))
         {
             Tunnel.BLL.Tunnel_ProJectMent TPBll = new Tunnel.BLL.Tunnel_ProJectMent();
             TPBll.Delete(int.Parse(Request.Params["DeleteId"]));
             //Tunnel.Data.DbHelperSQL.ExecuteSql("Update Tunnel_ProJectMent Set Pro_Status=-1 Where Pro_id=" + int.Parse(Request.Params["DeleteId"]));
             Tunnel.BLL.Tunnel_bum TbBll = new Tunnel.BLL.Tunnel_bum();
             Tunnel.Common.Message.Show("删除成功!");
         }
         if (!string.IsNullOrEmpty(Request.Params["PauseId"]))
         {
             Tunnel.Data.DbHelperSQL.ExecuteSql("Update Tunnel_ProJectMent Set Pro_Status=1 Where Pro_id=" + int.Parse(Request.Params["PauseId"]));
             Tunnel.Common.Message.Show("操作成功!");
         }
         if (!string.IsNullOrEmpty(Request.Params["CloseId"]))
         {
             Tunnel.Data.DbHelperSQL.ExecuteSql("Update Tunnel_ProJectMent Set Pro_Status=2 Where Pro_id=" + int.Parse(Request.Params["CloseId"]));
             Tunnel.Common.Message.Show("操作成功!");
         }
         if (!string.IsNullOrEmpty(Request.Params["OpenId"]))
         {
             Tunnel.Data.DbHelperSQL.ExecuteSql("Update Tunnel_ProJectMent Set Pro_Status=0 Where Pro_id=" + int.Parse(Request.Params["OpenId"]));
             Tunnel.Common.Message.Show("操作成功!");
         }
         this.Bind();
     }
 }
コード例 #6
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>";
         }
     }
 }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                did = Request.QueryString["id"].ToString();
                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(did));
                Label1.Text = tdd.d_name;
                Label2.Text = tdd.d_depict;

                Tunnel.BLL.Tunnel_bum          tb     = new Tunnel.BLL.Tunnel_bum();
                Tunnel.Model.Tunnel_bum        tbb    = new Tunnel.Model.Tunnel_bum();
                List <Tunnel.Model.Tunnel_bum> tbList = new List <Tunnel.Model.Tunnel_bum>();
                tbList = tb.GetModelList("b_id=" + tdd.d_flag + "");
                if (tbList.Count > 0)
                {
                    tbb         = tbList[0];
                    Label3.Text = tbb.b_name;
                }
            }
        }
    }
コード例 #8
0
ファイル: SelectUser.aspx.cs プロジェクト: 262734254/OA
    public void BuMenBind()
    {
        Tunnel.BLL.Tunnel_bum          bbll      = new Tunnel.BLL.Tunnel_bum();
        List <Tunnel.Model.Tunnel_bum> modelList = new List <Tunnel_bum>();

        modelList            = bbll.GetModelList("");
        Repeater2.DataSource = modelList;
        Repeater2.DataBind();
    }
コード例 #9
0
ファイル: Tunnel_DutyUpd.aspx.cs プロジェクト: 262734254/OA
    public void DropBind()
    {
        Tunnel.BLL.Tunnel_bum          td     = new Tunnel.BLL.Tunnel_bum();
        List <Tunnel.Model.Tunnel_bum> tdlist = new List <Tunnel.Model.Tunnel_bum>();

        tdlist = td.GetModelList("1=1");
        for (int i = 0; i < tdlist.Count; i++)
        {
            DropDownList1.Items.Add(new ListItem(tdlist[i].b_name, tdlist[i].b_id.ToString()));
        }
        DropDownList1.Items.Insert(0, new ListItem("请选择", "0"));
    }
コード例 #10
0
    ///// <summary>
    ///// 翻页
    ///// </summary>
    ///// <param name="sender"></param>
    ///// <param name="e"></param>
    //protected void MTCPager1_PageIndexChanged(object sender, EventArgs e)
    //{
    //    cuttentPage = MTCPager1.PageIndex;
    //    PageBind();
    //}

    ///// <summary>
    ///// 页面数据绑定
    ///// </summary>
    //public void PageBind()
    //{
    //    PageBase pb = new PageBase();
    //    pb.TblName = "Tunnel_menber";
    //    pb.FldName = "m_id";
    //    pb.ProcedureName = "pagination";
    //    pb.PageSize = pageSize;
    //    if (cuttentPage == 0)
    //        cuttentPage = pb.PageIndex;
    //    pb.PageIndex = cuttentPage;
    //    int count = 0;
    //    List<Tunnel.Model.Tunnel_menber> modelList = new List<Tunnel.Model.Tunnel_menber>();
    //    modelList = tbll.GetList(pb, ref count);//获取分页结果
    //    pb.DoCount = 1;
    //    tbll.GetList(pb, ref count); //获取总条数


    //    //数据绑定
    //    Repeater1.DataSource = modelList;
    //    Repeater1.DataBind();

    //    //数据分页
    //    MTCPager1.PageSize = pageSize;
    //    MTCPager1.RecordCount = count;
    //    MTCPager1.PageIndex = cuttentPage;
    //    if (count <= pb.PageSize)
    //        MTCPager1.Visible = false;
    //    else
    //        MTCPager1.Visible = true;
    //}
    #endregion

    public void BuMenBind()
    {
        Tunnel.BLL.Tunnel_bum          bbll      = new Tunnel.BLL.Tunnel_bum();
        List <Tunnel.Model.Tunnel_bum> modelList = new List <Tunnel_bum>();

        modelList = bbll.GetModelList("");
        Tunnel.Model.Tunnel_bum model = new Tunnel_bum();
        model.b_id   = 0;
        model.b_name = "未分组";
        modelList.Add(model);
        Repeater2.DataSource = modelList;
        Repeater2.DataBind();
    }
コード例 #11
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;
     }
 }
コード例 #12
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;
        }
    }
コード例 #13
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);
    }
コード例 #14
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 = "";

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

        case 0:
            temp          = "公司新闻";
            model.BumName = "";
            break;

        case -1:
            temp          = "公司公告";
            model.BumName = "";
            typeId        = -1;
            break;
        }
        div.InnerHtml = "<font class='titlfontson'><span><a title='首页' href='/Index.aspx'>首页</a></span>"
                        + "<span> &gt; </span>"
                        + "<span><a title='" + temp + "' href='/N_Index/DataTypeList.aspx?typeid=" + typeId + "'>" + temp + "</a></span>"
                        + "<span> &gt; </span>"
                        + "<span>详细信息</span>"
                        + "</font>";
    }
コード例 #15
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Tunnel_ProJectMent TPModel = new Tunnel_ProJectMent();

        TPModel.Pro_Title     = tb_Title.Text.Trim();
        TPModel.Pro_Name      = tb_Title0.Text.Trim();
        TPModel.Pro_Manager   = 0;
        TPModel.Pro_StartDate = Convert.ToDateTime(tb_Title1.Text.Trim());

        //人员需求计划
        TPModel.Pro_ManDate = Convert.ToDateTime(tb_Title2.Text.Trim());
        //合同签订计划
        TPModel.Pro_ContractDate = Convert.ToDateTime(tb_Title3.Text.Trim());
        //设备需求计划
        TPModel.Pro_EquipmentDate = Convert.ToDateTime(tb_Title4.Text.Trim());
        //材料进场计划
        TPModel.Pro_MaterialDate = Convert.ToDateTime(tb_Title5.Text.Trim());
        //施工方案编制计划
        TPModel.Pro_PlanDate = Convert.ToDateTime(tb_Title6.Text.Trim());
        //安全申报计划
        TPModel.Pro_SecurityDate = Convert.ToDateTime(tb_Title7.Text.Trim());

        Tunnel.BLL.Tunnel_ProJectMent TPBll = new Tunnel.BLL.Tunnel_ProJectMent();
        int ReSult = TPBll.Add(TPModel);

        if (ReSult > 0)
        {
            Tunnel_bum TbModel = new Tunnel_bum();
            TbModel.b_name      = tb_Title0.Text.Trim();
            TbModel.b_depict    = tb_Title.Text.Trim();
            TbModel.b_hid       = 0;
            TbModel.b_projectid = ReSult;
            Tunnel.BLL.Tunnel_bum TbBll = new Tunnel.BLL.Tunnel_bum();
            if (TbBll.Add(TbModel) > 0)
            {
                Tunnel.Common.Message.Show("项目新建成功!");
            }
        }
    }
コード例 #16
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Tunnel.BLL.Tunnel_bum        bt  = new Tunnel.BLL.Tunnel_bum();
        Tunnel.BLL.Tunnel_form       tf  = new Tunnel.BLL.Tunnel_form();
        Tunnel.Model.Tunnel_form     mf  = new Tunnel.Model.Tunnel_form();
        Tunnel.BLL.Tunnel_formtype   btf = new Tunnel.BLL.Tunnel_formtype();
        Tunnel.Model.Tunnel_formtype bmf = new Tunnel.Model.Tunnel_formtype();
        mf.f_name = TextBox1.Text.Trim();
        mf.f_lcid = int.Parse(DropDownList2.SelectedValue);
        mf.f_bum  = 0;
        mf.f_user = 1;
        mf.f_date = DateTime.Now;
        int i = tf.Name_Add(mf);

        if (i > 0)
        {
            bmf.Form_id   = i;
            bmf.Form_name = TextBox1.Text.Trim();
            bmf.Item_max  = 0;
            btf.Add(bmf);
            Tunnel.Common.Message.Show("保存成功!");
        }
    }
コード例 #17
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;
    }
コード例 #18
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;
                 }
             }
         }
     }
 }
コード例 #19
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;
            }
        }
    }
コード例 #20
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>";
        }
    }