private void detach_module_product(module_product entity)
		{
			this.SendPropertyChanging();
			entity.normal_class = null;
		}
 partial void Deletemodule_product(module_product instance);
		private void attach_module_product(module_product entity)
		{
			this.SendPropertyChanging();
			entity.normal_channel = this;
		}
 partial void Updatemodule_product(module_product instance);
 partial void Insertmodule_product(module_product instance);
Ejemplo n.º 6
0
        /// <summary>
        /// 解析单条产品标签
        /// </summary>
        /// <param name="_pagestr"></param>
        /// <param name="_contentid"></param>
        /// <returns></returns>
        private void executeTag_Product(ref string _pagestr, module_product pro)
        {
            _pagestr = _pagestr.Replace("{$_title}", pro.Title);
            _pagestr = _pagestr.Replace("{$_img}", pro.Img);
            _pagestr = _pagestr.Replace("{$_adddate}", DateTime.Parse(pro.AddDate.ToString()).ToString("yyyy-MM-dd"));
            _pagestr = _pagestr.Replace("{$_viewnum}", pro.ViewNum.ToString());
            _pagestr = _pagestr.Replace("{$_author}", pro.Author);
            _pagestr = _pagestr.Replace("{$_summary}", pro.Summary);
            _pagestr = _pagestr.Replace("{$Points}", decimal.Parse(pro.Points.ToString()).ToString("C"));
            _pagestr = _pagestr.Replace("{$Price0}", decimal.Parse(pro.Price0.ToString()).ToString("C"));

            _pagestr = _pagestr.Replace("{$Content}", pro.Content);
            _pagestr = _pagestr.Replace("{$ChannelId}", pro.ChannelId.ToString());
        }
 /// <summary>
 /// 修改商品
 /// </summary>
 /// <param name="Product"></param>
 /// <returns></returns>
 public int UpdateProduct(module_product a)
 {
     string sql = string.Format(@"update module_product set ClassId={0},Title='{1}',TColor='{2}',Summary='{3}',Editor='{4}',Author='{5}',Tags='{6}',Img='{7}',IsImg={8},SourceFrom='{9}',Content='{10}',Price0={12},Points={13} where Id={11}", a.ClassId, a.Title, a.TColor, a.Summary, a.Editor, a.Author, a.Tags, a.Img, a.IsImg, a.SourceFrom, a.Content, a.Id, a.Price0, a.Points);
     return SqlHelper.ExecuteNonQuery(CommandType.Text, sql);
 }
 /// <summary>
 /// 添加商品
 /// </summary>
 /// <param name="Product"></param>
 /// <returns></returns>
 public int InsertProduct(module_product Product)
 {
     db.module_product.InsertOnSubmit(Product);
     db.SubmitChanges();
     return Product.Id;
 }