PageRenderTime 1969ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 1ms

/microsoft/szzgc/source/Szzgc2.0/Web.Service/App_Code/Public_Web.cs

http://jqbird.googlecode.com/
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
  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.HtmlControls;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.WebControls.WebParts;
  11. using System.Xml.Linq;
  12. using System.Text;
  13. using CommDBLib;
  14. using System.Data.SqlClient;
  15. /// <summary>
  16. ///Public_Web ?????
  17. /// </summary>
  18. public class Public_Web : BasePage
  19. {
  20. public Public_Web()
  21. {
  22. //
  23. //TODO: ???????????
  24. //
  25. }
  26. //????
  27. #region web_url:????url
  28. //public string news_url = "http://localhost";
  29. public string web_url = "http://service.szzgc.com";
  30. #endregion
  31. public string img_url = "http://images.szzgc.com";
  32. #region web_Toptitle:??title
  33. public string web_Toptitle = "???????";
  34. #endregion
  35. #region web_title:??title
  36. public string web_title = "?????IT??";
  37. #endregion
  38. #region web_KeyWord:?????
  39. public string web_KeyWord = "?????,????,??,??,??,??,??,??,??,??,??,??,??,???,??,??,??,????,?????,DC,DV,MP3,MP4,??,????";
  40. #endregion
  41. #region web_Description:????
  42. public string web_Description = "?????IT??????????? ??? ???????????????????? ??, ??, ?????????????????????????IT?????, ???, IT??, ?????????";
  43. #endregion
  44. #region ????????
  45. /// <summary>
  46. /// ????????
  47. /// </summary>
  48. /// <param name="proId">????</param>
  49. /// <returns></returns>
  50. public string GetParams1(string proId)
  51. {
  52. {
  53. var sb = new StringBuilder();
  54. var parameters = new SqlParameter[] { new SqlParameter("@pro_Id", proId), new SqlParameter("@topnum", 5) };
  55. var dt = dpt.Getdataview("Pro_Get_Param", "tb", CommandType.StoredProcedure, parameters).Table;
  56. if (dt != null)
  57. {
  58. foreach (DataRow dr in dt.Rows)
  59. {
  60. sb.AppendFormat("{0}?{1} ", dr["PARAM_NAME"].ToString(), dr["PARAM_VALUE"].ToString());
  61. }
  62. }
  63. return JsHelper.Cut(sb.ToString(),80);
  64. }
  65. }
  66. #endregion
  67. #region ??????
  68. /// <summary>
  69. /// ??????
  70. /// </summary>
  71. /// <param name="param1"></param>
  72. /// <returns></returns>
  73. public SqlParameter[] GetSpm(string param1)
  74. {
  75. SqlParameter[] spm = new SqlParameter[] {
  76. new SqlParameter("@param1", param1)
  77. };
  78. return spm;
  79. }
  80. #endregion
  81. #region ????
  82. /// <summary>
  83. /// ????????
  84. /// </summary>
  85. public string GetLoginNav()
  86. {
  87. StringBuilder sb=new StringBuilder();
  88. if (Session["Susername"] != null)
  89. {
  90. sb.AppendFormat("????&nbsp;<font color=\"red\">{0}</font> &nbsp;<a href=\"UserCenter/Mainindex.aspx\"> ????</a>", Session["Susername"].ToString());
  91. }
  92. else
  93. {
  94. sb.AppendFormat("????? &nbsp;<a style='color:#ba502f' href=\"UserLogin.aspx\">??</a> &nbsp; <a style='color:#ba502f' href=\"ServiceRegister.aspx\">??</a>");
  95. }
  96. return sb.ToString();
  97. }
  98. #endregion
  99. #region ??2???
  100. public SqlParameter[] GetSpm(string param1, string param2)
  101. {
  102. SqlParameter[] spm = new SqlParameter[] {
  103. new SqlParameter("@param1", param1) ,
  104. new SqlParameter("@param2", param2)
  105. };
  106. return spm;
  107. }
  108. #endregion
  109. #region ??tab??
  110. /// <summary>
  111. /// ??tab??
  112. /// </summary>
  113. /// <param name="uid">??id</param>
  114. /// <returns>????</returns>
  115. public string GetTabNav(int uid)
  116. {
  117. StringBuilder sb = new StringBuilder();
  118. sb.AppendFormat("<table width=\"980\" id=\"TabNav\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"title\">");
  119. sb.AppendFormat(" <tr>");
  120. sb.AppendFormat("<td width=\"10\" align=\"left\"><img src=\"/images/daohang11.jpg\" width=\"10\" height=\"32\" /></td>");
  121. 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);
  122. 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);
  123. 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);
  124. 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);
  125. 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);
  126. 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);
  127. sb.AppendFormat("<td align=\"left\"><img src=\"/images/daohang5.jpg\" width=\"85\" height=\"32\" /></td>");
  128. sb.AppendFormat("</tr>");
  129. sb.AppendFormat("<tr>");
  130. sb.AppendFormat("<td height=\"10\" colspan=\"9\"></td>");
  131. sb.AppendFormat("</tr>");
  132. sb.AppendFormat("</table>");
  133. return sb.ToString();
  134. }
  135. #endregion
  136. #region ???????????
  137. /// <summary>
  138. /// ???????????
  139. /// </summary>
  140. /// <returns></returns>
  141. public DataTable GetProName(string proId)
  142. {
  143. DataTable dt = dpt.Getdataview("Pro_Get_PRODUCTION_F", "tb", CommandType.StoredProcedure, GetSpm(proId)).Table;
  144. return dt;
  145. }
  146. #endregion
  147. #region ??????
  148. /// <summary>
  149. /// ??????
  150. /// </summary>
  151. /// <param name="ClassID"></param>
  152. /// <returns></returns>
  153. public string GetCurrentClass(string Classid)
  154. {
  155. StringBuilder buffer = new StringBuilder();
  156. if (Classid != "")
  157. {
  158. DataTable dt = dpt.Getdataview(conn, "select * from CLASS_M where ClASS_ID='" + Classid + "'", "tb").Table;
  159. buffer.AppendFormat("{0}", dt.Rows[0]["CLASS_NAME"].ToString());
  160. return buffer.ToString();
  161. }
  162. else
  163. {
  164. return "";
  165. }
  166. }
  167. #endregion
  168. #region ????
  169. /// <summary>
  170. /// ????
  171. /// </summary>
  172. public string GetSupClass()
  173. {
  174. StringBuilder sb = new StringBuilder();
  175. string sql = "select * from SUPERCLASS_M";
  176. DataTable dt = dpt.Getdataview(conn, sql, "tb").Table;
  177. if (dt.Rows.Count > 0)
  178. {
  179. for (int i = 0; i < dt.Rows.Count; i++)
  180. {
  181. 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());
  182. }
  183. }
  184. return sb.ToString();
  185. }
  186. #endregion
  187. #region ????
  188. /// <summary>
  189. /// ????
  190. /// </summary>
  191. /// <returns></returns>
  192. public string slipMenu()
  193. {
  194. StringBuilder sb = new StringBuilder();
  195. DataTable dt = dpt.Getdataview("Pro_Get_SUPERCLASS_M", "tb", CommandType.StoredProcedure, GetSpm("")).Table;
  196. if (dt.Rows.Count > 0)
  197. {
  198. sb.Append("<li style='display:none'><a href=#></a></li>");
  199. for (int i = 0; i < dt.Rows.Count; i++)
  200. {
  201. sb.AppendFormat("<li><a href=\"#\"><span>{0}</span></a></li>\r\n", dt.Rows[i]["SUP_CLASS_NAME"].ToString());
  202. sb.Append("<ul>");
  203. sb.Append("<li>");
  204. DataTable dt2 = dpt.Getdataview("Pro_Get_CLASS_M", "tb", CommandType.StoredProcedure, GetSpm("",dt.Rows[i]["SUP_CLASS_ID"].ToString())).Table;
  205. if (dt2.Rows.Count > 0)
  206. {
  207. for (int j = 0; j < dt2.Rows.Count; j++)
  208. {
  209. sb.AppendFormat("<a href=\"ProductList.aspx?scatid={0}\">{1}</a> ", dt2.Rows[j]["CLASS_ID"].ToString(), dt2.Rows[j]["CLASS_NAME"].ToString());
  210. }
  211. }
  212. sb.Append("</li>");
  213. sb.Append("</ul>");
  214. }
  215. }
  216. return sb.ToString();
  217. }
  218. #endregion
  219. #region ????
  220. public string GetLinkTitle(string Classid)
  221. {
  222. StringBuilder buffer = new StringBuilder();
  223. buffer.AppendFormat("<div class=\"navtitle2\">");
  224. buffer.AppendFormat("<ul style=\"margin-top:5px; margin-left:20px\"> ?????<a style=\"color:White\" href=\"http://www.szzgc.com\">??</a> &gt;&gt;<span class=\"text_12px_bannerziti\">????</span>");
  225. if (Classid != "")
  226. {
  227. DataTable dt = dpt.Getdataview(conn, "select SUP_CLASS_NAME from SUPERCLASS_M where SUP_ClASS_ID='" + Classid + "'", "tb").Table;
  228. if (dt.Rows.Count > 0)
  229. {
  230. buffer.AppendFormat("&gt;&gt;<a href=\"#\" ><span class=\"navTitle_bai\">{0}</span></a>", dt.Rows[0]["SUP_CLASS_NAME"].ToString());
  231. }
  232. }
  233. buffer.AppendFormat(" </ul>");
  234. buffer.AppendFormat("<ul class=\"login\" style=\"float:right\"> "+GetLoginNav()+"</ul>");
  235. buffer.AppendFormat("</div>");
  236. return buffer.ToString();
  237. }
  238. #endregion
  239. #region ??logo
  240. /// <summary>
  241. /// ??logo
  242. /// </summary>
  243. /// <param name="userId"></param>
  244. /// <returns></returns>
  245. public string GetLogo(int userId)
  246. {
  247. StringBuilder sb = new StringBuilder();
  248. string strSrc = dpt.Getfirstrow(conn, "select logo from Z_ServiceUser where id=" + userId);
  249. sb.AppendFormat("<img src=\"{0}\" border=\"0\" width=\"50\" height=\"50\" />", strSrc);
  250. return sb.ToString();
  251. }
  252. #endregion
  253. }//--