BLL/Base/ProductModels.cs
(开头部分) 26KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Text;
namespace BLL.Models
{
public class ProductModels
{
public string[] files = { "ID", "ProductName", "ClassId", "Price", "State", "Stock", "Brand", "Img_Logo", "Img_Big", "Intro", "Content", "AddDate", "ClickCount", "BuyCount", "UserName", "Point", "IsHtml", "Url", "IntroMore" };
/// <summary>
/// 查询商品,单个
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public MODEL.MProduct GetProductById(string id) {
MODEL.MProduct ret = new MODEL.MProduct();
Library.SqlProvider.SqlServer db = new Library.SqlProvider.SqlServer();
string str_sql = "select * from tb_mc_product where id="+id;
DataTable dt = new DataTable();
try {
dt = db.ExecuteDataset(COMM.PucConfig.ConnectionStringA, CommandType.Text, str_sql).Tables[0];
}
catch (Exception ex) { }
if(dt.Rows.Count>0){
string logourl = string.Empty;
GetLogoInfo(dt.Rows[0] ,ref logourl);
ret.AddDate =Convert.IsDBNull(dt.Rows[0]["adddate"]) ==true ? DateTime.MinValue:Convert.ToDateTime( dt.Rows[0]["adddate"].ToString());
ret.Brand = Convert.IsDBNull(dt.Rows[0]["brand"]) == true ? 0 :Convert.ToInt32(dt.Rows[0]["brand"].ToString());
ret.BuyCount = Convert.IsDBNull(dt.Rows[0]["buycount"]) == true ? 0 : Convert.ToInt32(dt.Rows[0]["buycount"].ToString());
ret.Classid = Convert.IsDBNull(dt.Rows[0]["classid"]) == true ? 0 : Convert.ToInt32(dt.Rows[0]["classid"].ToString());
ret.ClickCount = Convert.IsDBNull(dt.Rows[0]["clickcount"]) == true ? 0 : Convert.ToInt32(dt.Rows[0]["clickcount"].ToString());
ret.Content = Convert.IsDBNull(dt.Rows[0]["content"]) == true ? "" : dt.Rows[0]["content"].ToString();
ret.Id = Convert.IsDBNull(dt.Rows[0]["id"]) == true ? 0 :Convert.ToInt32( dt.Rows[0]["id"].ToString());
ret.Img_Big = Convert.IsDBNull(dt.Rows[0]["img_big"]) == true ? "" : dt.Rows[0]["img_big"].ToString();
ret.Img_Logo = Convert.IsDBNull(dt.Rows[0]["img_logo"]) == true ? "" : dt.Rows[0]["img_logo"].ToString();
ret.Intro = Convert.IsDBNull(dt.Rows[0]["intro"]) == true ? "" : dt.Rows[0]["intro"].ToString();
ret.IsHtml = Convert.IsDBNull(dt.Rows[0]["ishtml"]) == true ? false :dt.Rows[0]["ishtml"].ToString()=="1"?true:false;
ret.Point = Convert.IsDBNull(dt.Rows[0]["point"]) == true ? 0 : Convert.ToDecimal(dt.Rows[0]["point"].ToString());
ret.Price = Convert.IsDBNull(dt.Rows[0]["price"]) == true ? 0 : Convert.ToDecimal(dt.Rows[0]["price"].ToString());
ret.ProductName = Convert.IsDBNull(dt.Rows[0]["productname"]) == true ? "" : dt.Rows[0]["productname"].ToString();
ret.State = Convert.IsDBNull(dt.Rows[0]["state"]) == true ? 0 :Convert.ToInt32( dt.Rows[0]["state"].ToString());
ret.Stock = Convert.IsDBNull(dt.Rows[0]["stock"]) == true ? 0 : Convert.ToInt32(dt.Rows[0]["stock"].ToString());
ret.Url=Convert.IsDBNull(dt.Rows[0]["url"])==true?"":dt.Rows[0]["url"].ToString();
ret.UserName = Convert.IsDBNull(dt.Rows[0]["username"]) == true ? 0:Convert.ToInt32( dt.Rows[0]["username"].ToString());
ret.IntroMore = Convert.IsDBNull(dt.Rows[0]["IntroMore"]) == true ? "" : dt.Rows[0]["IntroMore"].ToString();
ret.Img_Logo = logourl;
}
return ret;
}
/// <summary>
/// 查询商品分页
/// </summary>
后面还有 585 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。