private void showinfo(int id) { switch (UserState.lng) { case "cn": pageVal = 1; break; case "kr": pageVal = 2; break; case "en": pageVal = 3; break; } light.Model.product model = new light.BLL.product().GetModel(id); StringBuilder sb = new StringBuilder(); string title = string.Empty; string list = string.Empty; if (pageVal == 1) { title = model.pname; description = model.pinfo; } else if (pageVal == 2) { title = model.krpname; description = model.krinfo; } else { title = model.enpname; description = model.eninfo; } list = base.procategoryList(pageVal); sb.AppendLine(@" <table style=""z-index: 100"" border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"); sb.AppendLine(@" <tbody>"); sb.AppendLine(@" <tr>"); sb.AppendLine(@" <td style=""padding-left: 45px; color: #ffffff; font-size: 14px; font-weight: bold"""); sb.AppendLine(@" height=""39"" background=""/images/title.jpg"">" + title); sb.AppendLine(@" </td>"); sb.AppendLine(@" </tr>"); sb.AppendLine(@" <tr>"); sb.AppendLine(@" <td style=""padding-bottom: 2px; padding-left: 5px; padding-right: 5px; padding-top: 2px"""); sb.AppendLine(@" valign=""top"">"); sb.AppendLine(@" " + list); sb.AppendLine(@" </td>"); sb.AppendLine(@" </tr>"); sb.AppendLine(@" </tbody>"); sb.AppendLine(@" </table>"); leftString = sb.ToString(); }
protected void Page_Load(object sender, EventArgs e) { int pid = light.Common.DNTRequest.GetQueryInt("pid", 0); if (pid > 0) { light.BLL.product bll = new light.BLL.product(); bll.Delete(pid); light.Common.WebMessageBox.ShowMessageBoxRedirect("删除成功","showlist.aspx", this); } }
protected void doPost() { light.BLL.product bll = new light.BLL.product(); light.Model.product model = bll.GetModel(int.Parse(ViewState["pid"].ToString())); model.addtime = DateTime.Now; model.isopen = 0; model.pcateid = int.Parse(this.pcateid1.Value); model.pinfo = Request["pinfo"]; //model.plogo = Request["plogo"]; if (Request["btnmodify"] == "1") { model.plogo = UploadHelper.UploadImg(this.newplogo); } else { model.plogo = Request["oldplogo"].ToString(); } model.pname = Request["pname"]; model.enpname = Request["enpname"]; model.krpname = Request["krpname"]; model.eninfo = Request["eninfo"]; model.krinfo = Request["krinfo"]; if (model.plogo.Length > 1) { bll.Update(model); Response.Redirect("edit.aspx?pid=" + ViewState["pid"].ToString()); } else { if (model.plogo == "1") { light.Common.WebMessageBox.ShowMessageBox("图片格式错误!", this); } else { light.Common.WebMessageBox.ShowMessageBox("图片超过300K!", this); } } }
public string prodouctList(int type, int categoryid) { StringBuilder myStringBuilder = new StringBuilder(); DataTable dt = new light.BLL.product().GetList(" pcateid= " + categoryid.ToString()).Tables[0]; myStringBuilder.AppendLine(" <table width=\"100%\" class=\"Board_Tab\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\">"); int td = 1; int closespan = dt.Rows.Count % 4; myStringBuilder.AppendLine(" <tr>"); foreach (DataRow dr in dt.Rows) { if (type == 1) { myStringBuilder.AppendLine(" <td align='center' bgcolor='' background='#' >"); myStringBuilder.AppendLine(" <div>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?id=" + dr["pkid"].ToString() + "\" >"); myStringBuilder.AppendLine(" <img src=\"" + dr["plogo"].ToString() + "\" width=\"100\" height=\"100\" border=\"0\">"); myStringBuilder.AppendLine(" </a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" <div style='line-height: 200%'>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?id=" + dr["pkid"].ToString() + "\" >" + dr["pname"].ToString() + "</a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" </td>"); } else if (type == 2) { myStringBuilder.AppendLine(" <td align='center' bgcolor='' background='#' >"); myStringBuilder.AppendLine(" <div>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?id=" + dr["pkid"].ToString() + "\" >"); myStringBuilder.AppendLine(" <img src=\"" + dr["plogo"].ToString() + "\" width=\"100\" height=\"100\" border=\"0\">"); myStringBuilder.AppendLine(" </a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" <div style='line-height: 200%'>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?id=" + dr["pkid"].ToString() + "\" >" + dr["krpname"].ToString() + "</a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" </td>"); } else { myStringBuilder.AppendLine(" <td align='center' bgcolor='' background='#' >"); myStringBuilder.AppendLine(" <div>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?id=" + dr["pkid"].ToString() + "\" >"); myStringBuilder.AppendLine(" <img src=\"" + dr["plogo"].ToString() + "\" width=\"100\" height=\"100\" border=\"0\">"); myStringBuilder.AppendLine(" </a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" <div style='line-height: 200%'>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?id=" + dr["pkid"].ToString() + "\" >" + dr["enpname"].ToString() + "</a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" </td>"); } if ((td % 4) == 0) { myStringBuilder.AppendLine(" </tr>"); if (td != dt.Rows.Count) myStringBuilder.AppendLine(" <tr>"); } td++; } myStringBuilder.AppendLine("</table>"); return myStringBuilder.ToString(); }
public string getproducts(int type) { StringBuilder myStringBuilder = new StringBuilder(); DataTable dt = new light.BLL.product().GetList(" 1=1 ").Tables[0]; foreach (DataRow dr in dt.Rows) { if (type == 1) { myStringBuilder.AppendLine(" <td align='center' bgcolor='' background='#' >"); myStringBuilder.AppendLine(" <div>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?lng=cn&id=" + dr["pkid"].ToString() + "\" >"); myStringBuilder.AppendLine(" <img src=\"" + dr["plogo"].ToString() + "\" width=\"100\" height=\"100\" border=\"0\">"); myStringBuilder.AppendLine(" </a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" <div style='line-height: 200%'>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?lng=cn&id=" + dr["pkid"].ToString() + "\" >" + dr["pname"].ToString() + "</a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" </td>"); } else if (type == 2) { myStringBuilder.AppendLine(" <td align='center' bgcolor='' background='#' >"); myStringBuilder.AppendLine(" <div>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?lng=kr&id=" + dr["pkid"].ToString() + "\" >"); myStringBuilder.AppendLine(" <img src=\"" + dr["plogo"].ToString() + "\" width=\"100\" height=\"100\" border=\"0\">"); myStringBuilder.AppendLine(" </a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" <div style='line-height: 200%'>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?lng=kr&id=" + dr["pkid"].ToString() + "\" >" + dr["krpname"].ToString() + "</a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" </td>"); } else { myStringBuilder.AppendLine(" <td align='center' bgcolor='' background='#' >"); myStringBuilder.AppendLine(" <div>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?lng=en&id=" + dr["pkid"].ToString() + "\" >"); myStringBuilder.AppendLine(" <img src=\"" + dr["plogo"].ToString() + "\" width=\"100\" height=\"100\" border=\"0\">"); myStringBuilder.AppendLine(" </a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" <div style='line-height: 200%'>"); myStringBuilder.AppendLine(" <a href=\"product.aspx?lng=en&id=" + dr["pkid"].ToString() + "\" >" + dr["enpname"].ToString() + "</a>"); myStringBuilder.AppendLine(" </div>"); myStringBuilder.AppendLine(" </td>"); } } return myStringBuilder.ToString(); }