protected void SubmitButton_Click(object sender, EventArgs e) { int id = RequestHelper.GetQueryString <int>("Id"); var adImage = AdImageBLL.Read(id); adImage.Title = Title.Text; adImage.SubTitle = SubTitle.Text; adImage.MobileLinkUrl = LinkUrl.Text; adImage.MobileImageUrl = ImageUrl.Text; adImage.OrderId = int.Parse(OrderId.Text); adImage.Tm = DateTime.Now; string alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); if (adImage.Id > 0) { CheckAdminPower("UpdateAdImage", PowerCheckType.Single); AdImageBLL.Update(adImage); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("AdImage"), adImage.Id); } else { CheckAdminPower("AddAdImage", PowerCheckType.Single); adImage.AdType = RequestHelper.GetQueryString <int>("ad_type"); adImage.ClassId = RequestHelper.GetQueryString <int>("class_id"); id = AdImageBLL.Add(adImage); AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("AdImage"), id); alertMessage = ShopLanguage.ReadLanguage("AddOK"); } ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl); }
protected void SubmitButton_Click(object sender, EventArgs e) { int id = RequestHelper.GetQueryString <int>("Id"); var adImage = AdImageBLL.Read(id); adImage.Title = Title.Text; adImage.SubTitle = SubTitle.Text; adImage.LinkUrl = StringHelper.Substring(LinkUrl.Text.Trim(), 192, false); adImage.ImageUrl = ImageUrl.Text; adImage.OrderId = int.Parse(OrderId.Text); adImage.MobileLinkUrl = BgColor.Text.Trim(); int _classId = 0; int.TryParse(ProductClass.Text, out _classId); adImage.ClassId = _classId; string alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); if (adImage.Id > 0) { CheckAdminPower("UpdateAdImage", PowerCheckType.Single); AdImageBLL.Update(adImage); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("AdImage"), adImage.Id); } else { CheckAdminPower("AddAdImage", PowerCheckType.Single); adImage.AdType = RequestHelper.GetQueryString <int>("fp_type"); adImage.Tm = DateTime.Now; id = AdImageBLL.Add(adImage); AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("AdImage"), id); alertMessage = ShopLanguage.ReadLanguage("AddOK"); } ScriptHelper.Alert(alertMessage, "FpImage.aspx?fp_type=" + adImage.AdType + ""); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { return; } CheckAdminPower("ReadAdImage", PowerCheckType.Single); string action = RequestHelper.GetQueryString <string>("Action"); if (action == "Delete") { CheckAdminPower("DeleteAdImage", PowerCheckType.Single); int id = RequestHelper.GetQueryString <int>("Id"); if (id > 0) { AdImageBLL.Delete(id); AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("FlashPhoto"), id); } } classId = RequestHelper.GetQueryString <int>("class_id"); adType = RequestHelper.GetQueryString <int>("fp_type"); if (adType > 0) { theFlash = FlashBLL.Read(adType); } var images = AdImageBLL.ReadList(adType); BindControl(images, RecordList); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } int id = RequestHelper.GetQueryString <int>("Id"); if (id > 0) { CheckAdminPower("ReadAdImage", PowerCheckType.Single); var adImage = AdImageBLL.Read(id); Title.Text = adImage.Title; SubTitle.Text = adImage.SubTitle; LinkUrl.Text = adImage.MobileLinkUrl; ImageUrl.Text = adImage.MobileImageUrl; OrderId.Text = adImage.OrderId.ToString(); _adType = adImage.AdType; } else { OrderId.Text = AdImageBLL.MaxOrderId(AdImageInfo.TABLENAME).ToString(); _adType = RequestHelper.GetQueryString <int>("ad_type"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //CheckAdminPower("ReadFlash", PowerCheckType.Single); string action = RequestHelper.GetQueryString <string>("Action"); type = RequestHelper.GetQueryString <int>("type") <= 0?1:RequestHelper.GetQueryString <int>("type"); if (action == "Delete") { CheckAdminPower("DeleteFlash", PowerCheckType.Single); int id = RequestHelper.GetQueryString <int>("Id"); if (id > 0) { FlashBLL.Delete(id); AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("Flash"), id); foreach (var adImage in AdImageBLL.ReadList(id)) { AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("FlashPhoto"), adImage.Id); } AdImageBLL.DeleteByAdType(id); //ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl); } } LotteryActivitySearchInfo activitySearch = new LotteryActivitySearchInfo(); activitySearch.ActivityType = (int)LotteryActivityType.Wheel; BindControl(LotteryActivityBLL.SearchList(CurrentPage, PageSize, activitySearch, ref Count), RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ProductClass.DataSource = ProductClassBLL.ReadRootList(); ProductClass.DataTextField = "Name"; ProductClass.DataValueField = "ID"; ProductClass.DataBind(); int id = RequestHelper.GetQueryString <int>("Id"); if (id > 0) { CheckAdminPower("ReadAdImage", PowerCheckType.Single); var adImage = AdImageBLL.Read(id); Title.Text = adImage.Title; SubTitle.Text = adImage.SubTitle; LinkUrl.Text = adImage.LinkUrl; ImageUrl.Text = adImage.ImageUrl; OrderId.Text = adImage.OrderId.ToString(); BgColor.Text = adImage.MobileLinkUrl; ProductClass.Text = adImage.ClassId.ToString(); _adType = adImage.AdType; } else { OrderId.Text = AdImageBLL.MaxOrderId(AdImageInfo.TABLENAME).ToString(); _adType = RequestHelper.GetQueryString <int>("fp_type"); } } }
protected override void PageLoad() { base.PageLoad(); //flashId 默认 11,店铺首页Banner flashId = RequestHelper.GetQueryString <int>("flashId") <= 0 ? 11 : RequestHelper.GetQueryString <int>("flashId"); bannerList = AdImageBLL.ReadList(flashId); topNav = 2; }
protected override void PageLoad() { ProductClassList = ProductClassBLL.ReadList(); TopBanner = AdImageBLL.ReadList((int)AdImageType.TopBanner).FirstOrDefault() ?? new AdImageInfo(); hotKeyword = ShopConfig.ReadConfigInfo().HotKeyword; //productClassList = ProductClassBLL.ReadRootList(); helpClassList = ArticleClassBLL.ReadChilds(ArticleClass.Help); bottomList = ArticleBLL.ReadBottomList(); topNavMenuList = NavMenuBLL.ReadList(true); }
protected override void PageLoad() { base.PageLoad(); imageList = AdImageBLL.ReadList(); int count = 0; likeProductList = ProductBLL.SearchList(1, 5, new ProductSearchInfo { ProductOrderType = "LikeNum", IsSale = (int)BoolType.True }, ref count); }
protected override void PageLoad() { base.PageLoad(); //flashId 默认 11,店铺首页Banner flashId = RequestHelper.GetQueryString <int>("flashId") <= 0?11: RequestHelper.GetQueryString <int>("flashId"); int id = RequestHelper.GetQueryString <int>("id"); adImage = AdImageBLL.Read(id); topNav = 2; if (RequestHelper.GetQueryString <string>("Action") == "UploadPhoto") { UploadPhoto(); } }
protected override void PageLoad() { base.PageLoad(); MobileAdList = AdImageBLL.ReadList(8, 7); topNav = 110; int count = 0; topylzcList = ArticleBLL.SearchList(1, 4, new ArticleSearchInfo { ClassId = "|47|", IsTop = (int)BoolType.True }, ref count); //hotProductList = ProductBLL.SearchList(1, 4, new ProductSearchInfo { IsSale = (int)BoolType.True, IsTop = (int)BoolType.True, IsHot = (int)BoolType.True }, ref count); }
protected override void PageLoad() { base.PageLoad(); topNav = 1; IPHostEntry ipHost = System.Net.Dns.GetHostEntry(Dns.GetHostName());// Dns.Resolve(Dns.GetHostName()); ; foreach (IPAddress ipa in ipHost.AddressList) { if (ipa.AddressFamily.ToString() == "InterNetwork") { localIP = ipa.ToString(); } } //IPAddress ipaddress = ipHost.AddressList[0]; //localIP = ipaddress.ToString(); //imageList = AdImageBLL.ReadList(); //ProductBrandBLL.ReadList( proBranInfo = ProductBrandBLL.ReadList(); List <AdImageInfo> flashList = AdImageBLL.ReadList(6); int count = 0; //likeProductList = ProductBLL.SearchList(1, 5, new ProductSearchInfo { ProductOrderType = "LikeNum", IsSale = (int)BoolType.True }, ref count); artListInfo = ArticleBLL.SearchList(1, 4, new ArticleSearchInfo { ClassId = "|58|" }, ref count); topnewsList = ArticleBLL.SearchList(1, 5, new ArticleSearchInfo { ClassId = "|38|", IsTop = (int)BoolType.True }, ref count); topylzcList = ArticleBLL.SearchList(1, 6, new ArticleSearchInfo { ClassId = "|47|", IsTop = (int)BoolType.True }, ref count); //newProductList = ProductBLL.SearchList(1, 5, new ProductSearchInfo { IsNew = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); //hotProductList = ProductBLL.SearchList(1, 10, new ProductSearchInfo { IsHot = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); //specialProductList = ProductBLL.SearchList(1, 10, new ProductSearchInfo { IsSpecial = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); //textLinkList = LinkBLL.ReadLinkCacheListByClass((int)LinkType.Text); //pictureLinkList = LinkBLL.ReadLinkCacheListByClass((int)LinkType.Picture); //在线咨询 if (RequestHelper.GetQueryString <string>("Action") == "AskOnline") { AskOnline(); } }
protected override void PageLoad() { ProductClassList = ProductClassBLL.ReadList(); TopBanner = AdImageBLL.ReadList((int)AdImageType.TopBanner).FirstOrDefault() ?? new AdImageInfo(); hotKeyword = ShopConfig.ReadConfigInfo().HotKeyword; productClassList = ProductClassBLL.ReadRootList(); helpClassList = ArticleClassBLL.ReadChilds(ArticleClass.Help); bottomList = ArticleBLL.ReadBottomList(); strHistorySearch = Server.UrlDecode(CookiesHelper.ReadCookieValue("HistorySearch")); textLinkList = LinkBLL.ReadLinkCacheListByClass((int)LinkType.Text); topNavMenuList = NavMenuBLL.ReadList(true); ReadCart(); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } int id = RequestHelper.GetQueryString <int>("Id"); if (id > 0) { CheckAdminPower("ReadAdKeyword", PowerCheckType.Single); var adKeyword = AdKeywordBLL.Read(id); Name.Text = adKeyword.Name; Url.Text = adKeyword.Url; OrderId.Text = adKeyword.OrderId.ToString(); } else { OrderId.Text = AdImageBLL.MaxOrderId(AdKeywordInfo.TABLENAME).ToString(); } }
public JsonResult Contact() { try { int count = 0; var aboutEntity = ArticleBLL.SearchList(1, 1, new ArticleSearchInfo { ClassId = "|1|" }, ref count).FirstOrDefault() ?? new ArticleInfo(); aboutEntity.Content = string.IsNullOrEmpty(aboutEntity.AddCol2) ? aboutEntity.Content : aboutEntity.AddCol2; var aboutCat = ArticleClassBLL.Read(1) ?? new ArticleClassInfo(); var bannercount = RequestHelper.GetForm <int>("bannercount"); if (bannercount <= 0) { bannercount = 8; } var companyPhotos = AdImageBLL.ReadList(14, bannercount); return(Json(new { ok = true, aboutentity = aboutEntity, aboutcat = aboutCat, photos = companyPhotos })); } catch (Exception ex) { return(Json(new { ok = false })); } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { return; } CheckAdminPower("ReadAdImage", PowerCheckType.Single); string action = RequestHelper.GetQueryString <string>("Action"); if (action == "Delete") { CheckAdminPower("DeleteAdImage", PowerCheckType.Single); int id = RequestHelper.GetQueryString <int>("Id"); AdImageBLL.Delete(id); } classId = RequestHelper.GetQueryString <int>("class_id"); adType = RequestHelper.GetQueryString <int>("ad_type"); var images = AdImageBLL.ReadList(adType); if (adType == (int)AdImageType.MobileFloorClass) { if (classId < 1) { var rootList = ProductClassBLL.ReadRootList(); if (rootList != null && rootList.Count > 0) { classId = rootList[0].Id; } } images = images.Where(k => k.ClassId == classId).ToList(); } BindControl(images, RecordList); }
protected override void PageLoad() { base.PageLoad(); topNav = 1; imageList = AdImageBLL.ReadList(); int count = 0; likeProductList = ProductBLL.SearchList(1, 5, new ProductSearchInfo { ProductOrderType = "LikeNum", IsSale = (int)BoolType.True }, ref count); newsList = ArticleBLL.SearchList(1, 7, new ArticleSearchInfo { ClassId = "|1|", IsTop = (int)BoolType.True }, ref count); newProductList = ProductBLL.SearchList(1, 5, new ProductSearchInfo { IsNew = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); hotProductList = ProductBLL.SearchList(1, 10, new ProductSearchInfo { IsHot = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); specialProductList = ProductBLL.SearchList(1, 10, new ProductSearchInfo { IsSpecial = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); textLinkList = LinkBLL.ReadLinkCacheListByClass((int)LinkType.Text); pictureLinkList = LinkBLL.ReadLinkCacheListByClass((int)LinkType.Picture); }
public ActionResult Index() { int userGrade = UserGradeBLL.ReadByMoney(0).Id; UserInfo user = new UserInfo(); #region 判断用户归属分销商 int uid = RequestHelper.GetForm <int>("uid"); //分销商Id int distributor_id = RequestHelper.GetForm <int>("distributor_id"); if (uid > 0) { user = UserBLL.ReadUserMore(uid); if (user.Id > 0) { userGrade = UserGradeBLL.ReadByMoney(user.MoneyUsed).Id; } } //if (distributor_id > 0) //{ // //当前分销商 // var distributor = UserBLL.Read(distributor_id); // //如果当前分销商状态正常 // if (distributor.Distributor_Status == (int)Distributor_Status.Normal) // { // //如果用户已有分销商 // if (user.Recommend_UserId > 0) // { // var old_distributor = UserBLL.Read(user.Recommend_UserId); // //如果原分销商状态不正常,,则修改用户归属当前分销商 // if (old_distributor.Distributor_Status != (int)Distributor_Status.Normal) // { // Dictionary<string, object> dict = new Dictionary<string, object>(); // dict.Add("[Recommend_UserId]", distributor.Id); // UserBLL.UpdatePart("[Usr]", dict, user.Id); // } // } // else // {//如果用户没有归属分销商,则修改用户归属当前分销商 // Dictionary<string, object> dict = new Dictionary<string, object>(); // dict.Add("[Recommend_UserId]", distributor.Id); // UserBLL.UpdatePart("[Usr]", dict, user.Id); // } // } //} #endregion #region 首页BANNER var bannercount = RequestHelper.GetForm <int>("bannercount"); if (bannercount <= 0) { bannercount = 5; } var banner = AdImageBLL.ReadList(11, bannercount); #endregion int count = int.MinValue; #region 推荐产品 var recmdprocount = RequestHelper.GetForm <int>("recmdprocount"); if (recmdprocount <= 0) { recmdprocount = 6; } var recmdpro = ProductBLL.SearchList(1, recmdprocount, new ProductSearchInfo() { IsSale = 1, IsTop = 1, IsDelete = 0 }, ref count).Select(k => new { id = k.Id, name = k.Name, img = ShopCommon.ShowImage(k.Photo.Replace("Original", "150-150")), imgbig = ShopCommon.ShowImage(k.Photo.Replace("Original", "350-350")), imgorg = ShopCommon.ShowImage(k.Photo), price = ProductBLL.GetCurrentPrice(k.SalePrice, userGrade) }); #endregion #region 排序前4个分类及相关产品 List <VirtualCategory> vcatelist = new List <VirtualCategory>(); var catelist = ProductClassBLL.ReadRootList().Take(6).ToList(); foreach (var category in catelist) { VirtualCategory vcate = new VirtualCategory(); vcate.productClass = category; List <ProductVirtualModel> tempvp = new List <ProductVirtualModel>(); var templist = ProductBLL.SearchList(1, 4, new ProductSearchInfo() { IsSale = 1, ClassId = "|" + category.Id + "|", IsDelete = 0 }, ref count); foreach (var item in templist) { var vp = new ProductVirtualModel() { id = item.Id, name = item.Name, img = ShopCommon.ShowImage(item.Photo.Replace("Original", "150-150")), imgbig = ShopCommon.ShowImage(item.Photo.Replace("Original", "350-350")), imgorg = ShopCommon.ShowImage(item.Photo), groupphoto = string.IsNullOrWhiteSpace(item.GroupPhoto) ? item.Photo : item.GroupPhoto, price = ProductBLL.GetCurrentPrice(item.SalePrice, userGrade), click = item.ViewCount, like = item.LikeNum, totalstore = item.TotalStorageCount, //ordercount=item.OrderCount //是否启用不限库存,分别计算销量 ordercount = item.UnlimitedStorage == 1 ? OrderBLL.GetProductOrderCountDaily(item.Id, item.StandardType, DateTime.Now) : item.OrderCount }; tempvp.Add(vp); } vcate.productlists = tempvp; vcatelist.Add(vcate); } #endregion //普通优惠券 var couponlist = CouponBLL.SearchList(1, 1000, new CouponSearchInfo { Type = (int)CouponKind.Common, CanUse = 1 }, ref count); //新客优惠券 CouponInfo registerCoupon = new CouponInfo(); var registerCouponlist = CouponBLL.SearchList(1, 1, new CouponSearchInfo { Type = (int)CouponKind.RegisterGet, CanUse = 1 }, ref count); if (registerCouponlist.Count > 0) { registerCoupon = registerCouponlist[0]; } //是否获取新人券 int hasRegisterCoupon = user.HasRegisterCoupon; //将到期未结束的砍价活动置为“砍价结束” BargainTimeExpire(); return(Json(new { flag = true, banner = banner, recmdpro = recmdpro, cateandproduct = vcatelist, coupons = couponlist, hasRegisterCoupon = hasRegisterCoupon, registerCoupon = registerCoupon })); }
protected override void PageLoad() { ProductClassList = ProductClassBLL.ReadList(); TopBanner = AdImageBLL.ReadList((int)AdImageType.TopBanner).FirstOrDefault() ?? new AdImageInfo(); }