コード例 #1
0
ファイル: websitetype.cs プロジェクト: lamjar/shop
        //得到网站内容列表
        public static List <websitetypeinfo> getwebsite(pageinfo pdata)
        {
            List <websitetypeinfo> list = new List <websitetypeinfo>();

            try
            {
                DataTable dt = pagehelper.getpagedt(pdata);
                if (dt != null)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        websitetypeinfo item = new websitetypeinfo();
                        item.wsid           = TypeParse.DbObjToInt(dr["wsid"].ToString(), 0);
                        item.wtid           = TypeParse.DbObjToInt(dr["wtid"].ToString(), 0);
                        item.websitetype    = TypeParse.DbObjToString(dr["websitetype"].ToString(), "");
                        item.websitecontent = TypeParse.DbObjToString(dr["websitecontent"].ToString(), "");
                        list.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
            return(list);
        }
コード例 #2
0
ファイル: EditWebSite.aspx.cs プロジェクト: lamjar/shop
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["wsid"] != null)
            {
                int             id   = TypeParse.DbObjToInt(Request.QueryString["wsid"].ToString(), 0);
                websitetypeinfo data = websitetype.getwebsiteinfo(id);
                websiteinfoDATA = data;

                if (!Page.IsPostBack)
                {
                    StringBuilder          sb     = new StringBuilder();
                    List <websitetypeinfo> itlist = websitetype.getwebsitetype();
                    sb.Append("<select id=\"wtid\" name=\"wtid\" style=\"width:120px; border:solid 1px #cacaca; height:20px;\">");
                    foreach (websitetypeinfo item in itlist)
                    {
                        string template;
                        if (item.wtid == data.wtid)
                        {
                            template = "<option value=\"{0}\" selected=\"selected\">{1}</option>";
                        }
                        else
                        {
                            template = "<option value=\"{0}\">{1}</option>";
                        }
                        sb.AppendFormat(template, item.wtid, item.websitetype);
                    }
                    sb.Append("</select>");
                    websitetypeHTML = sb.ToString();
                }
            }
            else
            {
                Response.Redirect("/Manager/WebSite.aspx");
            }
        }
コード例 #3
0
ファイル: websitetype.cs プロジェクト: lamjar/shop
        //得到网站内容信息通过信息类别
        public static websitetypeinfo getwebsiteinfobytype(string type)
        {
            SqlParameter[] parms = new SqlParameter[1];
            parms[0]       = new SqlParameter("@type", SqlDbType.VarChar, 50);
            parms[0].Value = type;

            websitetypeinfo item = new websitetypeinfo();
            string          sql  = "select website.wsid,website.websitecontent, websitetype.websitetype from website,websitetype where website.wtid=websitetype.wtid AND websitetype.websitetype like'%" + type + "%'";

            try
            {
                SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.connectionstring, CommandType.Text, sql, parms);
                if (dr.Read())
                {
                    item.wsid           = TypeParse.DbObjToInt(dr["wsid"].ToString(), 0);
                    item.websitecontent = TypeParse.DbObjToString(dr["websitecontent"].ToString(), "");
                    item.websitetype    = TypeParse.DbObjToString(dr["websitetype"].ToString(), "");
                    dr.Close();
                    dr.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
            return(item);
        }
コード例 #4
0
ファイル: EditWebSite.aspx.cs プロジェクト: uwitec/shop
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["wsid"] != null)
            {
                int id = TypeParse.DbObjToInt(Request.QueryString["wsid"].ToString(), 0);
                websitetypeinfo data = websitetype.getwebsiteinfo(id);
                websiteinfoDATA = data;

                if (!Page.IsPostBack)
                {
                    StringBuilder sb = new StringBuilder();
                    List<websitetypeinfo> itlist = websitetype.getwebsitetype();
                    sb.Append("<select id=\"wtid\" name=\"wtid\" style=\"width:120px; border:solid 1px #cacaca; height:20px;\">");
                    foreach (websitetypeinfo item in itlist)
                    {
                        string template;
                        if (item.wtid == data.wtid)
                        {
                            template = "<option value=\"{0}\" selected=\"selected\">{1}</option>";
                        }
                        else
                        {
                            template = "<option value=\"{0}\">{1}</option>";
                        }
                        sb.AppendFormat(template, item.wtid, item.websitetype);
                    }
                    sb.Append("</select>");
                    websitetypeHTML = sb.ToString();
                }
            }
            else
            {
                Response.Redirect("/Manager/WebSite.aspx");
            }
        }
コード例 #5
0
ファイル: websitetype.cs プロジェクト: lamjar/shop
        //得到网站内容类别列表
        public static List <websitetypeinfo> getwebsitetype()
        {
            string sql = "select wtid,websitetype from websitetype";
            List <websitetypeinfo> itlist = new List <websitetypeinfo>();

            try
            {
                DataSet ds = SqlHelper.ExecuteDataset(SqlHelper.connectionstring, CommandType.Text, sql);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    websitetypeinfo item = new websitetypeinfo();
                    item.wtid        = TypeParse.DbObjToInt(dr["wtid"].ToString(), 0);
                    item.websitetype = TypeParse.DbObjToString(dr["websitetype"].ToString(), "");
                    itlist.Add(item);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
            return(itlist);
        }
コード例 #6
0
ファイル: Index.aspx.cs プロジェクト: lamjar/shop
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //网站内容目录
                List <websitetypeinfo> itlist = websitetype.getwebsitetype();
                StringBuilder          itsb   = new StringBuilder();
                foreach (websitetypeinfo item in itlist)
                {
                    string template = "<li><span class=\"newslipoint\"></span><a href=\"/WS/{0}\">{1}</a></li>";
                    itsb.AppendFormat(template, item.wtid, item.websitetype);
                }
                categorylistHTML = itsb.ToString();

                if (RouteData.Values["contenttype"] != null && RouteData.Values["contenttype"].ToString() != "")
                {
                    string k      = RouteData.Values["contenttype"].ToString();
                    string wstype = "关于我们";
                    switch (k)
                    {
                    case "1":
                        wstype = "关于我们";
                        break;

                    case "3":
                        wstype = "联系我们";
                        break;

                    case "4":
                        wstype = "人才招聘";
                        break;

                    default:
                        wstype = "关于我们";
                        break;
                    }

                    websitetypeinfo item = websitetype.getwebsiteinfobytype(wstype);
                    ctitleHTML  = item.websitetype;
                    contentHTML = item.websitecontent;
                }
                else
                {
                    string          wstype = "关于我们";
                    websitetypeinfo item   = websitetype.getwebsiteinfobytype(wstype);
                    ctitleHTML  = item.websitetype;
                    contentHTML = item.websitecontent;
                }
            }
        }
コード例 #7
0
        public string editwebsitetype(string wtid, string swebsitetype)
        {
            websitetypeinfo data = new websitetypeinfo();

            data.websitetype = HttpUtility.UrlDecode(TypeParse.DbObjToString(swebsitetype, ""));
            data.wtid        = TypeParse.DbObjToInt(wtid, 0);
            bool result = websitetype.editwebsitetype(data);

            if (result)
            {
                return("t");
            }
            else
            {
                return("f");
            }
        }
コード例 #8
0
        public string addwebsitetype(string swebsitetype)
        {
            string          strit = HttpUtility.UrlDecode(TypeParse.DbObjToString(swebsitetype, ""));
            websitetypeinfo data  = new websitetypeinfo();

            data.websitetype = strit;
            bool result = websitetype.addwebsitetype(data);

            if (result)
            {
                return("t");
            }
            else
            {
                return("f");
            }
        }
コード例 #9
0
        public string editwebsite(string s_website, string wsid)
        {
            string          strit = HttpUtility.UrlDecode(TypeParse.DbObjToString(s_website, ""));
            websitetypeinfo data  = new websitetypeinfo();

            data.websitecontent = strit;
            data.wsid           = TypeParse.DbObjToInt(wsid, 0);
            bool result = websitetype.editwebsite(data);

            if (result)
            {
                return("t");
            }
            else
            {
                return("f");
            }
        }
コード例 #10
0
ファイル: websitetype.cs プロジェクト: uwitec/shop
 //添加网站内容类别
 public static bool addwebsitetype(websitetypeinfo data)
 {
     SqlParameter[] parms = new SqlParameter[1];
     parms[0] = new SqlParameter("@websitetype", SqlDbType.VarChar);
     parms[0].Value = data.websitetype;
     string sql = "insert into websitetype (websitetype) values(@websitetype)";
     int result = 0;
     try
     {
         result = SqlHelper.ExecuteNonQuery(SqlHelper.connectionstring, CommandType.Text, sql, parms);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
     }
     return result > 0;
 }
コード例 #11
0
ファイル: websitetype.cs プロジェクト: lamjar/shop
        //添加网站内容类别
        public static bool addwebsitetype(websitetypeinfo data)
        {
            SqlParameter[] parms = new SqlParameter[1];
            parms[0]       = new SqlParameter("@websitetype", SqlDbType.VarChar);
            parms[0].Value = data.websitetype;
            string sql    = "insert into websitetype (websitetype) values(@websitetype)";
            int    result = 0;

            try
            {
                result = SqlHelper.ExecuteNonQuery(SqlHelper.connectionstring, CommandType.Text, sql, parms);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
            return(result > 0);
        }
コード例 #12
0
ファイル: websitetype.cs プロジェクト: lamjar/shop
        //编辑网站内容类别
        public static bool editwebsitetype(websitetypeinfo data)
        {
            SqlParameter[] parms = new SqlParameter[2];
            parms[0]       = new SqlParameter("@websitetype", SqlDbType.VarChar, 20);
            parms[0].Value = data.websitetype;
            parms[1]       = new SqlParameter("@wtid", SqlDbType.Int);
            parms[1].Value = data.wtid;
            string sql    = "update websitetype set websitetype=@websitetype where wtid=@wtid";
            int    result = 0;

            try
            {
                result = SqlHelper.ExecuteNonQuery(SqlHelper.connectionstring, CommandType.Text, sql, parms);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
            }
            return(result > 0);
        }
コード例 #13
0
ファイル: websitetype.cs プロジェクト: lamjar/shop
        //编辑网站内容
        public static bool editwebsite(websitetypeinfo data)
        {
            SqlParameter[] parms = new SqlParameter[2];
            parms[0]       = new SqlParameter("@websitecontent", SqlDbType.Text);
            parms[0].Value = data.websitecontent;
            parms[1]       = new SqlParameter("@wsid", SqlDbType.Int);
            parms[1].Value = data.wsid;

            string sql    = "update website set websitecontent=@websitecontent where wsid=@wsid";
            int    result = 0;

            try
            {
                result = SqlHelper.ExecuteNonQuery(SqlHelper.connectionstring, CommandType.Text, sql, parms);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
            return(result > 0);
        }
コード例 #14
0
ファイル: websitetype.cs プロジェクト: uwitec/shop
        //编辑网站内容
        public static bool editwebsite(websitetypeinfo data)
        {
            SqlParameter[] parms = new SqlParameter[2];
            parms[0] = new SqlParameter("@websitecontent", SqlDbType.Text);
            parms[0].Value = data.websitecontent;
            parms[1] = new SqlParameter("@wsid",SqlDbType.Int);
            parms[1].Value = data.wsid;

            string sql = "update website set websitecontent=@websitecontent where wsid=@wsid";
            int result = 0;
            try
            {
                result = SqlHelper.ExecuteNonQuery(SqlHelper.connectionstring, CommandType.Text, sql, parms);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
            return result > 0;
        }
コード例 #15
0
ファイル: websitetype.cs プロジェクト: uwitec/shop
 //得到网站内容列表
 public static List<websitetypeinfo> getwebsite(pageinfo pdata)
 {
     List<websitetypeinfo> list = new List<websitetypeinfo>();
     try
     {
         DataTable dt = pagehelper.getpagedt(pdata);
         if (dt != null)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 websitetypeinfo item = new websitetypeinfo();
                 item.wsid = TypeParse.DbObjToInt(dr["wsid"].ToString(), 0);
                 item.wtid = TypeParse.DbObjToInt(dr["wtid"].ToString(), 0);
                 item.websitetype = TypeParse.DbObjToString(dr["websitetype"].ToString(), "");
                 item.websitecontent = TypeParse.DbObjToString(dr["websitecontent"].ToString(), "");
                 list.Add(item);
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
     }
     return list;
 }
コード例 #16
0
ファイル: websitetype.cs プロジェクト: uwitec/shop
        //得到网站内容信息通过信息类别
        public static websitetypeinfo getwebsiteinfobytype(string type)
        {
            SqlParameter[] parms = new SqlParameter[1];
            parms[0] = new SqlParameter("@type", SqlDbType.VarChar, 50);
            parms[0].Value = type;

            websitetypeinfo item = new websitetypeinfo();
            string sql = "select website.wsid,website.websitecontent, websitetype.websitetype from website,websitetype where website.wtid=websitetype.wtid AND websitetype.websitetype like'%" + type + "%'";

            try
            {
                SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.connectionstring, CommandType.Text, sql, parms);
                if (dr.Read())
                {

                    item.wsid = TypeParse.DbObjToInt(dr["wsid"].ToString(), 0);
                    item.websitecontent = TypeParse.DbObjToString(dr["websitecontent"].ToString(), "");
                    item.websitetype = TypeParse.DbObjToString(dr["websitetype"].ToString(), "");
                    dr.Close();
                    dr.Dispose();
                }

            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
            return item;
        }
コード例 #17
0
ファイル: websitetype.cs プロジェクト: uwitec/shop
 //得到网站内容类别列表
 public static List<websitetypeinfo> getwebsitetype()
 {
     string sql = "select wtid,websitetype from websitetype";
     List<websitetypeinfo> itlist = new List<websitetypeinfo>();
     try
     {
         DataSet ds = SqlHelper.ExecuteDataset(SqlHelper.connectionstring, CommandType.Text, sql);
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             websitetypeinfo item = new websitetypeinfo();
             item.wtid = TypeParse.DbObjToInt(dr["wtid"].ToString(), 0);
             item.websitetype = TypeParse.DbObjToString(dr["websitetype"].ToString(), "");
             itlist.Add(item);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
     }
     return itlist;
 }
コード例 #18
0
ファイル: websitetype.cs プロジェクト: uwitec/shop
 //编辑网站内容类别
 public static bool editwebsitetype(websitetypeinfo data)
 {
     SqlParameter[] parms = new SqlParameter[2];
     parms[0] = new SqlParameter("@websitetype", SqlDbType.VarChar, 20);
     parms[0].Value = data.websitetype;
     parms[1] = new SqlParameter("@wtid",SqlDbType.Int);
     parms[1].Value = data.wtid;
     string sql = "update websitetype set websitetype=@websitetype where wtid=@wtid";
     int result = 0;
     try
     {
         result = SqlHelper.ExecuteNonQuery(SqlHelper.connectionstring, CommandType.Text, sql, parms);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
     finally
     {
     }
     return result > 0;
 }