public void AddPackage() { int Package_ID = tools.CheckInt(Request.Form["Package_ID"]); string Package_Name = tools.CheckStr(Request.Form["Package_Name"]); int Package_IsInsale = tools.CheckInt(Request.Form["Package_IsInsale"]); int Package_StockAmount = tools.CheckInt(Request.Form["Package_StockAmount"]); int Package_Weight = tools.CheckInt(Request.Form["Package_Weight"]); double Package_Price = tools.CheckFloat(Request.Form["Package_Price"]); int Package_Sort = tools.CheckInt(Request.Form["Package_Sort"]); PackageInfo entity = new PackageInfo(); entity.Package_ID = Package_ID; entity.Package_Name = Package_Name; entity.Package_IsInsale = Package_IsInsale; entity.Package_StockAmount = Package_StockAmount; entity.Package_Weight = Package_Weight; entity.Package_Price = Package_Price; entity.Package_Sort = Package_Sort; entity.Package_Addtime = DateTime.Now; entity.Package_Site = pub.GetCurrentSite(); entity.PackageProductInfos = ReadPackageProduct(); entity.Package_SupplierID = tools.NullInt(Session["supplier_id"]); if (MyBLL.AddPackage(entity, pub.CreateUserPrivilege("573393a4-573e-4872-ad7b-b77d75e0f611"))) { pub.Msg("positive", "操作成功", "操作成功", true, "Package_add.aspx"); } else { pub.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
public void AddProductTag() { int Product_Tag_ID = tools.CheckInt(Request.Form["Product_Tag_ID"]); string Product_Tag_Name = tools.CheckStr(Request.Form["Product_Tag_Name"]); int Product_Tag_IsSupplier = tools.CheckInt(Request.Form["Product_Tag_IsSupplier"]); int Product_Tag_IsActive = tools.CheckInt(Request.Form["Product_Tag_IsActive"]); int Product_Tag_Sort = tools.CheckInt(Request.Form["Product_Tag_Sort"]); string Product_Tag_Site = pub.GetCurrentSite(); ProductTagInfo entity = new ProductTagInfo(); entity.Product_Tag_ID = Product_Tag_ID; entity.Product_Tag_Name = Product_Tag_Name; entity.Product_Tag_IsSupplier = 1; entity.Product_Tag_IsActive = Product_Tag_IsActive; entity.Product_Tag_Sort = Product_Tag_Sort; entity.Product_Tag_Site = Product_Tag_Site; entity.Product_Tag_SupplierID = tools.NullInt(Session["supplier_id"]); if (MyBLL.AddProductTag(entity, pub.CreateUserPrivilege("2f1d706e-3356-494d-821c-c4173a923328"))) { pub.Msg("positive", "操作成功", "操作成功", true, "tag.aspx"); } else { pub.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
/// <summary> /// 推送消息通知 /// </summary> /// <param name="Message_Type">消息类型</param> /// <param name="Message_UserType">用户类型</param> /// <param name="Message_ReceiveID">消息接收人ID</param> /// <param name="Message_SendID">消息发送人ID</param> /// <param name="Message_Content">消息内容</param> public void SendMessage(int Message_Type, int Message_UserType, int Message_ReceiveID, int Message_SendID, string Message_Content) { SysMessageInfo entity = new SysMessageInfo(); entity.Message_ID = 0; entity.Message_Type = Message_Type; entity.Message_UserType = Message_UserType; entity.Message_ReceiveID = Message_ReceiveID; entity.Message_SendID = Message_SendID; entity.Message_Content = Message_Content; entity.Message_Addtime = DateTime.Now; entity.Message_Status = 0; entity.Message_Site = pub.GetCurrentSite(); MyBLL.AddSysMessage(entity); }
/// <summary> /// 搜索店铺 /// </summary> /// <returns></returns> public void SearchShops() { string page_url = "action=list"; StringBuilder strHTML = new StringBuilder(); QueryInfo Query = new QueryInfo(); Query.PageSize = 6; Query.CurrentPage = tools.CheckInt(Request["page"]); if (Query.CurrentPage <= 0) { Query.CurrentPage = 1; } Query.ParamInfos.Add(new ParamInfo("AND", "str", "SupplierShopInfo.Shop_Site", "=", pub.GetCurrentSite())); Query.ParamInfos.Add(new ParamInfo("AND", "int", "SupplierShopInfo.Shop_Status", "=", "1")); string keyword = tools.CheckStr(Request["keyword"]); if (keyword.Length > 0) { Query.ParamInfos.Add(new ParamInfo("AND", "str", "SupplierShopInfo.Shop_Name", "like", keyword)); page_url += "&keyword=" + Server.UrlEncode(keyword); } Query.OrderInfos.Add(new OrderInfo("SupplierShopInfo.Shop_ID", "ASC")); PageInfo pageinfo = myshop.GetPageInfo(Query); IList <SupplierShopInfo> entitys; strHTML.Append("<h2 class=\"title10\">共找到<strong>" + pageinfo.RecordCount + "</strong>条信息</h2>"); if (pageinfo.RecordCount >= 1) { string targetURL = string.Empty; SupplierInfo supplierInfo; entitys = myshop.GetSupplierShops(Query); if (entitys != null) { foreach (SupplierShopInfo entity in entitys) { #region 循环体 supplierInfo = supplier.GetSupplierByID(entity.Shop_SupplierID); if (supplierInfo == null) { supplierInfo = new SupplierInfo(); } targetURL = supplier.GetShopURL(entity.Shop_Domain); strHTML.Append("<div class=\"blk61\">"); strHTML.Append(" <div class=\"b61_left\">"); strHTML.Append(" <h2><a href=\""+ targetURL + "\" target=\"_blank\">" + entity.Shop_Name + "</a><span onclick=\"NTKF.im_openInPageChat('sz_" + (entity.Shop_SupplierID + 1000) + "_9999');\"><img style=\"display:inline-block; vertical-align:middle; margin-left:15px;width:74px;margin-right:10px;\" src=\"/images/icon04.png\"></span><span><a href=\"javascript:void(0);\">推广</a></span></h2>"); strHTML.Append(" <div class=\"b61_left_main\">"); strHTML.Append(" <ul>"); strHTML.Append(" <li><span>主营产品:</span>"+ entity.Shop_MainProduct + "</li>"); strHTML.Append(" <li><span>经营年限:</span>"+ supplierInfo.Supplier_OperateYear + "</li>"); strHTML.Append(" <li><span>所在地:</span>"+ addr.DisplayAddress(supplierInfo.Supplier_State, supplierInfo.Supplier_City, supplierInfo.Supplier_County) + "</li>"); strHTML.Append(" <li><span>注册资金:</span>"+ (supplierInfo.Supplier_RegisterFunds == 0 ? "无需验证" : supplierInfo.Supplier_RegisterFunds + "万") + "</li>"); strHTML.Append(" </ul>"); strHTML.Append(" <div class=\"clear\"></div>"); strHTML.Append("<p>"); IList <SupplierCertInfo> certs = supplier.GetSupplierCertByType(0); if (certs != null) { int icert = 0; foreach (SupplierCertInfo cert in certs) { if (supplier.Get_Supplier_Cert(cert.Supplier_Cert_ID, supplierInfo.SupplierRelateCertInfos).Length > 0) { icert++; if (icert >= 2) { strHTML.Append(" > "); } strHTML.Append(cert.Supplier_Cert_Name); } } } strHTML.Append("</p>"); strHTML.Append(" </div>"); strHTML.Append(" </div>"); strHTML.Append(" <div class=\"b61_right\">"); strHTML.Append(" <h2><a href=\""+ targetURL + "\" target=\"_blank\">进入本店铺 ></a></h2>"); strHTML.Append(" <div class=\"b61_right_main\">"); strHTML.Append(" <ul>"); strHTML.Append(ShopProducts(entity.Shop_SupplierID)); strHTML.Append(" </ul>"); strHTML.Append(" <div class=\"clear\"></div>"); strHTML.Append(" </div>"); strHTML.Append(" </div>"); strHTML.Append(" <div class=\"clear\"></div>"); strHTML.Append(" <em><img src=\"/images/div_bg.jpg\"></em>"); strHTML.Append("</div>"); #endregion } } } Response.Write(strHTML.ToString()); page_url = Request.Path + "?" + page_url.TrimStart('&'); pub.Page(pageinfo.PageCount, pageinfo.CurrentPage, page_url, pageinfo.PageSize, pageinfo.RecordCount); }
public void Member_Favorites_Add(string action, int targetid) { if (targetid == 0) { Response.Write("请选择要添加到收藏夹的内容"); Response.End(); } if (tools.NullInt(Session["member_id"]) == 0) { Response.Write("收藏失败,请稍后再试!"); Response.End(); } int supplier_id = tools.NullInt(Session["member_id"]); if (action == "product") { ProductInfo product = MyProduct.GetProductByID(targetid, pub.CreateUserPrivilege("ae7f5215-a21a-4af2-8d47-3cda2e1e2de8")); if (product != null) { if (product.Product_IsInsale == 1 && product.Product_IsAudit == 1) { MemberFavoritesInfo favorcheck = MyFavor.GetMemberFavoritesByProductID(supplier_id, 0, targetid); if (favorcheck != null) { //pub.Msg("info", "信息提示", "该商品已在您的收藏夹中!", true, "/member/member_favorites.aspx"); Response.Write("该商品已在您的收藏夹中"); Response.End(); } MemberFavoritesInfo favor = new MemberFavoritesInfo(); favor.Member_Favorites_ID = 0; favor.Member_Favorites_MemberID = supplier_id; favor.Member_Favorites_Type = 0; favor.Member_Favorites_TargetID = targetid; favor.Member_Favorites_Addtime = DateTime.Now; favor.Member_Favorites_Site = pub.GetCurrentSite(); if (MyFavor.AddMemberFavorites(favor)) { //pub.Msg("positive", "信息提示", "信息收藏成功!", true, "/member/member_favorites.aspx"); Response.Write("success"); Response.End(); } else { //pub.Msg("info", "信息提示", "收藏失败,请稍后再试!", false, "{back}"); Response.Write("收藏失败,请稍后再试!"); Response.End(); } } else { //pub.Msg("info", "信息提示", "收藏失败,请稍后再试!", false, "{back}"); Response.Write("收藏失败,请稍后再试!"); Response.End(); } } else { //pub.Msg("info", "信息提示", "收藏失败,请稍后再试!", false, "{back}"); Response.Write("收藏失败,请稍后再试!"); Response.End(); } } else { SupplierShopInfo shopinfo = MyShop.GetSupplierShopByID(targetid); if (shopinfo != null) { if (shopinfo.Shop_Status == 1) { MemberFavoritesInfo favorcheck = MyFavor.GetMemberFavoritesByProductID(supplier_id, 1, targetid); if (favorcheck != null) { //pub.Msg("info", "信息提示", "该店铺已在您的收藏夹中!", true, "/member/member_shop_favorites.aspx"); Response.Write("该店铺已在您的收藏夹中!"); Response.End(); } MemberFavoritesInfo favor = new MemberFavoritesInfo(); favor.Member_Favorites_ID = 0; favor.Member_Favorites_MemberID = supplier_id; favor.Member_Favorites_Type = 1; favor.Member_Favorites_TargetID = targetid; favor.Member_Favorites_Addtime = DateTime.Now; favor.Member_Favorites_Site = pub.GetCurrentSite(); if (MyFavor.AddMemberFavorites(favor)) { //pub.Msg("positive", "信息提示", "信息收藏成功!", true, "/member/member_shop_favorites.aspx"); Response.Write("success"); Response.End(); } else { Response.Write("收藏失败,请稍后再试!"); Response.End(); } } else { Response.Write("收藏失败,请稍后再试!"); Response.End(); } } else { Response.Write("收藏失败,请稍后再试!"); Response.End(); } } }