/microsoft/szzgc/source/Szzgc2.0/Web.Service/App_Code/Public_Web.cs
C# | 293 lines | 206 code | 40 blank | 47 comment | 15 complexity | aa5b725fe8e05ef9c0780d132313fd13 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-3.0, LGPL-2.1, GPL-2.0
- using System;
- using System.Data;
- using System.Configuration;
- using System.Linq;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Xml.Linq;
- using System.Text;
- using CommDBLib;
- using System.Data.SqlClient;
- /// <summary>
- ///Public_Web ?????
- /// </summary>
- public class Public_Web : BasePage
- {
- public Public_Web()
- {
- //
- //TODO: ???????????
- //
- }
-
- //????
- #region web_url:????url
- //public string news_url = "http://localhost";
- public string web_url = "http://service.szzgc.com";
- #endregion
- public string img_url = "http://images.szzgc.com";
- #region web_Toptitle:??title
- public string web_Toptitle = "???????";
- #endregion
- #region web_title:??title
- public string web_title = "?????IT??";
- #endregion
- #region web_KeyWord:?????
- public string web_KeyWord = "?????,????,??,??,??,??,??,??,??,??,??,??,??,???,??,??,??,????,?????,DC,DV,MP3,MP4,??,????";
- #endregion
-
- #region web_Description:????
- public string web_Description = "?????IT??????????? ??? ???????????????????? ??, ??, ?????????????????????????IT?????, ???, IT??, ?????????";
- #endregion
-
- #region ????????
- /// <summary>
- /// ????????
- /// </summary>
- /// <param name="proId">????</param>
- /// <returns></returns>
- public string GetParams1(string proId)
- {
- {
- var sb = new StringBuilder();
- var parameters = new SqlParameter[] { new SqlParameter("@pro_Id", proId), new SqlParameter("@topnum", 5) };
- var dt = dpt.Getdataview("Pro_Get_Param", "tb", CommandType.StoredProcedure, parameters).Table;
-
- if (dt != null)
- {
- foreach (DataRow dr in dt.Rows)
- {
- sb.AppendFormat("{0}?{1} ", dr["PARAM_NAME"].ToString(), dr["PARAM_VALUE"].ToString());
- }
- }
- return JsHelper.Cut(sb.ToString(),80);
- }
- }
- #endregion
-
- #region ??????
- /// <summary>
- /// ??????
- /// </summary>
- /// <param name="param1"></param>
- /// <returns></returns>
- public SqlParameter[] GetSpm(string param1)
- {
- SqlParameter[] spm = new SqlParameter[] {
- new SqlParameter("@param1", param1)
- };
- return spm;
-
- }
- #endregion
-
- #region ????
-
- /// <summary>
- /// ????????
- /// </summary>
- public string GetLoginNav()
- {
- StringBuilder sb=new StringBuilder();
- if (Session["Susername"] != null)
- {
- sb.AppendFormat("???? <font color=\"red\">{0}</font> <a href=\"UserCenter/Mainindex.aspx\"> ????</a>", Session["Susername"].ToString());
- }
- else
- {
- sb.AppendFormat("????? <a style='color:#ba502f' href=\"UserLogin.aspx\">??</a> <a style='color:#ba502f' href=\"ServiceRegister.aspx\">??</a>");
- }
- return sb.ToString();
- }
- #endregion
-
- #region ??2???
- public SqlParameter[] GetSpm(string param1, string param2)
- {
- SqlParameter[] spm = new SqlParameter[] {
- new SqlParameter("@param1", param1) ,
- new SqlParameter("@param2", param2)
- };
- return spm;
-
- }
- #endregion
-
- #region ??tab??
- /// <summary>
- /// ??tab??
- /// </summary>
- /// <param name="uid">??id</param>
- /// <returns>????</returns>
- public string GetTabNav(int uid)
- {
-
- StringBuilder sb = new StringBuilder();
- sb.AppendFormat("<table width=\"980\" id=\"TabNav\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"title\">");
- sb.AppendFormat(" <tr>");
- sb.AppendFormat("<td width=\"10\" align=\"left\"><img src=\"/images/daohang11.jpg\" width=\"10\" height=\"32\" /></td>");
- sb.AppendFormat("<td width=\"126\" title=\"Products\" align=\"center\" valign=\"middle\" ><span class=\"text_14px_lanb\"><a href=\"Products.aspx?uid={0}\">????</a></span></td>", uid);
- sb.AppendFormat("<td width=\"126\" title=\"CompanyInfo\" align=\"center\" valign=\"middle\" ><span class=\"text_14px_lanb\"><a href=\"CompanyInfo.aspx?uid={0}\"\">????</a></span></td>", uid);
- sb.AppendFormat("<td width=\"126\" title=\"CompanyPic\" align=\"center\" valign=\"middle\" ><span class=\"text_14px_heib\"><a href=\"CompanyPic.aspx?uid={0}\">????</a></span></td>", uid);
- sb.AppendFormat("<td width=\"126\" title=\"BusinessAddress\" align=\"center\" valign=\"middle\" ><span class=\"text_14px_lanb\"><a href=\"BusinessAddress.aspx?uid={0}\">????</a></span></td>", uid);
- sb.AppendFormat("<td width=\"126\" title=\"AfterService\" align=\"center\" valign=\"middle\" ><span class=\"text_14px_lanb\"><a href=\"AfterService.aspx?uid={0}\">????</a></span></td>", uid);
- sb.AppendFormat("<td width=\"127\" title=\"CorpAppraise\" align=\"center\" valign=\"middle\" ><span class=\"text_14px_hong\"><a href=\"CorpAppraise.aspx?uid={0}\">????</a></span></td>", uid);
- sb.AppendFormat("<td align=\"left\"><img src=\"/images/daohang5.jpg\" width=\"85\" height=\"32\" /></td>");
- sb.AppendFormat("</tr>");
- sb.AppendFormat("<tr>");
- sb.AppendFormat("<td height=\"10\" colspan=\"9\"></td>");
- sb.AppendFormat("</tr>");
- sb.AppendFormat("</table>");
-
- return sb.ToString();
- }
- #endregion
-
- #region ???????????
- /// <summary>
- /// ???????????
- /// </summary>
- /// <returns></returns>
- public DataTable GetProName(string proId)
- {
-
- DataTable dt = dpt.Getdataview("Pro_Get_PRODUCTION_F", "tb", CommandType.StoredProcedure, GetSpm(proId)).Table;
- return dt;
- }
- #endregion
-
- #region ??????
- /// <summary>
- /// ??????
- /// </summary>
- /// <param name="ClassID"></param>
- /// <returns></returns>
- public string GetCurrentClass(string Classid)
- {
- StringBuilder buffer = new StringBuilder();
- if (Classid != "")
- {
- DataTable dt = dpt.Getdataview(conn, "select * from CLASS_M where ClASS_ID='" + Classid + "'", "tb").Table;
- buffer.AppendFormat("{0}", dt.Rows[0]["CLASS_NAME"].ToString());
- return buffer.ToString();
- }
- else
- {
-
- return "";
- }
- }
- #endregion
-
- #region ????
- /// <summary>
- /// ????
- /// </summary>
- public string GetSupClass()
- {
-
- StringBuilder sb = new StringBuilder();
- string sql = "select * from SUPERCLASS_M";
- DataTable dt = dpt.Getdataview(conn, sql, "tb").Table;
- if (dt.Rows.Count > 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
-
- sb.AppendFormat("<li class=\"marklist\"><a href=\"CorpList.aspx?classid={0}\">{1}</a></li>", dt.Rows[i]["SUP_ClASS_ID"].ToString(), dt.Rows[i]["SUP_CLASS_NAME"].ToString());
- }
- }
- return sb.ToString();
- }
- #endregion
-
- #region ????
- /// <summary>
- /// ????
- /// </summary>
- /// <returns></returns>
- public string slipMenu()
- {
- StringBuilder sb = new StringBuilder();
- DataTable dt = dpt.Getdataview("Pro_Get_SUPERCLASS_M", "tb", CommandType.StoredProcedure, GetSpm("")).Table;
- if (dt.Rows.Count > 0)
- {
-
- sb.Append("<li style='display:none'><a href=#></a></li>");
- for (int i = 0; i < dt.Rows.Count; i++)
- {
-
- sb.AppendFormat("<li><a href=\"#\"><span>{0}</span></a></li>\r\n", dt.Rows[i]["SUP_CLASS_NAME"].ToString());
- sb.Append("<ul>");
- sb.Append("<li>");
-
- DataTable dt2 = dpt.Getdataview("Pro_Get_CLASS_M", "tb", CommandType.StoredProcedure, GetSpm("",dt.Rows[i]["SUP_CLASS_ID"].ToString())).Table;
-
-
- if (dt2.Rows.Count > 0)
- {
- for (int j = 0; j < dt2.Rows.Count; j++)
- {
- sb.AppendFormat("<a href=\"ProductList.aspx?scatid={0}\">{1}</a> ", dt2.Rows[j]["CLASS_ID"].ToString(), dt2.Rows[j]["CLASS_NAME"].ToString());
- }
- }
-
- sb.Append("</li>");
- sb.Append("</ul>");
- }
-
- }
- return sb.ToString();
- }
- #endregion
-
- #region ????
- public string GetLinkTitle(string Classid)
- {
- StringBuilder buffer = new StringBuilder();
-
- buffer.AppendFormat("<div class=\"navtitle2\">");
- buffer.AppendFormat("<ul style=\"margin-top:5px; margin-left:20px\"> ?????<a style=\"color:White\" href=\"http://www.szzgc.com\">??</a> >><span class=\"text_12px_bannerziti\">????</span>");
-
- if (Classid != "")
- {
- DataTable dt = dpt.Getdataview(conn, "select SUP_CLASS_NAME from SUPERCLASS_M where SUP_ClASS_ID='" + Classid + "'", "tb").Table;
- if (dt.Rows.Count > 0)
- {
- buffer.AppendFormat(">><a href=\"#\" ><span class=\"navTitle_bai\">{0}</span></a>", dt.Rows[0]["SUP_CLASS_NAME"].ToString());
- }
-
- }
- buffer.AppendFormat(" </ul>");
- buffer.AppendFormat("<ul class=\"login\" style=\"float:right\"> "+GetLoginNav()+"</ul>");
-
- buffer.AppendFormat("</div>");
-
- return buffer.ToString();
-
- }
- #endregion
-
- #region ??logo
- /// <summary>
- /// ??logo
- /// </summary>
- /// <param name="userId"></param>
- /// <returns></returns>
- public string GetLogo(int userId)
- {
- StringBuilder sb = new StringBuilder();
- string strSrc = dpt.Getfirstrow(conn, "select logo from Z_ServiceUser where id=" + userId);
- sb.AppendFormat("<img src=\"{0}\" border=\"0\" width=\"50\" height=\"50\" />", strSrc);
- return sb.ToString();
- }
- #endregion
-
-
- }//--
-
-