Exemplo n.º 1
0
        /// <summary>
        ///  增加一条数据

        /// </summary>
        public int Add(Tunnel.Model.Tunnel_SelType model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@TypeID",   SqlDbType.Int,      4),
                new SqlParameter("@TypeName", SqlDbType.VarChar, 50),
                new SqlParameter("@BumID",    SqlDbType.VarChar, 50),
                new SqlParameter("@BumName",  SqlDbType.VarChar, 50),
                new SqlParameter("@BumUrl",   SqlDbType.VarChar, 50),
                new SqlParameter("@ParentID", SqlDbType.Int,      4),
                new SqlParameter("@IsDel",    SqlDbType.Int, 4)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.TypeName;
            parameters[2].Value     = model.BumID;
            parameters[3].Value     = model.BumName;
            parameters[4].Value     = model.Url;
            parameters[5].Value     = model.ParentID;
            parameters[6].Value     = model.IsDel;

            DbHelperSQL.RunProcedure("Tunnel_SelType_ADD", parameters, out rowsAffected);
            return((int)parameters[0].Value);
        }
Exemplo n.º 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><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>";
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Tunnel.Model.Tunnel_SelType GetModel(int TypeID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@TypeID", SqlDbType.Int)
            };
            parameters[0].Value = TypeID;

            Tunnel.Model.Tunnel_SelType model = new Tunnel.Model.Tunnel_SelType();
            DataSet ds = DbHelperSQL.RunProcedure("Tunnel_SelType_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["TypeID"].ToString() != "")
                {
                    model.TypeID = int.Parse(ds.Tables[0].Rows[0]["TypeID"].ToString());
                }
                model.TypeName = ds.Tables[0].Rows[0]["TypeName"].ToString();
                model.BumID    = ds.Tables[0].Rows[0]["BumID"].ToString();
                model.BumName  = ds.Tables[0].Rows[0]["BumName"].ToString();
                model.Url      = ds.Tables[0].Rows[0]["BumUrl"].ToString();
                if (ds.Tables[0].Rows[0]["ParentID"].ToString() != "")
                {
                    model.ParentID = int.Parse(ds.Tables[0].Rows[0]["ParentID"].ToString().Trim());
                }
                model.KSID = int.Parse(ds.Tables[0].Rows[0]["KSID"].ToString().Trim());
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 4
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();
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Tunnel.Model.Tunnel_SelType> DataTableToList(DataTable dt)
        {
            List <Tunnel.Model.Tunnel_SelType> modelList = new List <Tunnel.Model.Tunnel_SelType>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Tunnel.Model.Tunnel_SelType model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new Tunnel.Model.Tunnel_SelType();
                    model.TypeID   = Convert.ToInt32(dt.Rows[n]["TypeID"].ToString());
                    model.TypeName = dt.Rows[n]["TypeName"].ToString();
                    model.BumID    = dt.Rows[n]["BumID"].ToString();
                    model.BumName  = dt.Rows[n]["BumName"].ToString();
                    model.ParentID = Convert.ToInt32(dt.Rows[n]["ParentID"].ToString().Trim());
                    model.KSID     = Convert.ToInt32(dt.Rows[n]["KSID"].ToString().Trim());
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        /// <param name="pb">分页基本信息</param>
        /// <param name="count">返回总数</param>
        /// <returns></returns>
        public List <Tunnel.Model.Tunnel_SelType> GetList(PageBase pb, ref int count)
        {
            DataTable dt = dal.GetList(pb, ref count).Tables[0];
            List <Tunnel.Model.Tunnel_SelType> modelList = new List <Tunnel.Model.Tunnel_SelType>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0 && pb.DoCount == 0)
            {
                Tunnel.Model.Tunnel_SelType model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new Tunnel.Model.Tunnel_SelType();
                    model.TypeID   = Convert.ToInt32(dt.Rows[n]["TypeID"].ToString().Trim());
                    model.TypeName = dt.Rows[n]["TypeName"].ToString().Trim();
                    model.BumID    = dt.Rows[n]["BumID"].ToString().Trim();
                    model.BumName  = dt.Rows[n]["BumName"].ToString().Trim();
                    model.ParentID = Convert.ToInt32(dt.Rows[n]["ParentID"].ToString().Trim());
                    model.KSID     = Convert.ToInt32(dt.Rows[n]["KSID"].ToString().Trim());
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 7
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(Tunnel.Model.Tunnel_SelType model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 8
0
 public int Add(Tunnel.Model.Tunnel_SelType model)
 {
     return(dal.Add(model));
 }