示例#1
0
        protected void btnAddBanner_Click(object sender, System.EventArgs e)
        {
            TplCfgInfo tplCfgInfo = new NavigateInfo();

            tplCfgInfo.IsDisable    = false;
            tplCfgInfo.ImageUrl     = this.fmSrc.Value;
            tplCfgInfo.ShortDesc    = this.txtNavigateDesc.Text;
            tplCfgInfo.LocationType = (LocationType)System.Enum.Parse(typeof(LocationType), this.ddlType.SelectedValue);
            tplCfgInfo.Url          = this.locationUrl.Value;
            tplCfgInfo.Client       = 1;
            if (string.IsNullOrWhiteSpace(this.locationUrl.Value))
            {
                this.ShowMsg("跳转页不能为空!", false);
                return;
            }
            if (string.IsNullOrWhiteSpace(tplCfgInfo.ImageUrl))
            {
                this.ShowMsg("请选择图标或上传图片!", false);
                return;
            }
            if (VShopHelper.SaveTplCfg(tplCfgInfo))
            {
                this.CloseWindow();
                return;
            }
            this.ShowMsg("添加错误!", false);
        }
示例#2
0
        private UserControl GetView(NavigateInfo navigationInfo)
        {
            switch (navigationInfo.ScreenName)
            {
            case "SelectCustomer":
                var view      = new CustomersView();
                var viewModel = new CustomersViewModel(ServiceLocator.Current.GetInstance <IWebservice>(), navigationInfo.CurrentCart);
                view.DataContext = viewModel;
                return(view);

            case "ProductSelection":
                var productsView      = new ProductsView();
                var productsViewModel = new ProductsViewModel(ServiceLocator.Current.GetInstance <IWebservice>(), navigationInfo.CurrentCart);
                productsView.DataContext = productsViewModel;
                return(productsView);

            case "CartCheckout":
                var cartView      = new CartView();
                var cartViewModel = new CartViewModel(ServiceLocator.Current.GetInstance <IWebservice>(), navigationInfo.CurrentCart, navigationInfo.CurrentCustomer);
                cartView.DataContext = cartViewModel;
                return(cartView);
            }

            return(null);
        }
示例#3
0
        protected void btnAddBanner_Click(object sender, System.EventArgs e)
        {
            TplCfgInfo info = new NavigateInfo
            {
                IsDisable    = false,
                ImageUrl     = this.fmSrc.Value,
                ShortDesc    = this.txtNavigateDesc.Text,
                LocationType = (LocationType)System.Enum.Parse(typeof(LocationType), this.ddlType.SelectedValue),
                Url          = this.locationUrl.Value
            };

            if (string.IsNullOrWhiteSpace(this.locationUrl.Value))
            {
                this.ShowMsg("跳转页不能为空!", false);
            }
            else
            {
                if (VShopHelper.SaveTplCfg(info))
                {
                    this.CloseWindow();
                }
                else
                {
                    this.ShowMsg("添加错误!", false);
                }
            }
        }
示例#4
0
文件: VDefault.cs 项目: tyriankid/WFX
        /// <summary>
        /// 获取所有大图
        /// </summary>
        private void getImgBanner()
        {
            IList <BannerInfo> allImgBanners = new List <BannerInfo>();

            allImgBanners = VshopBrowser.GetAllImgBanners();
            int activityCount = allImgBanners.Count;//获取所有的活动数量

            for (int i = 0; i < allImgBanners.Count; i++)
            {
                TplCfgInfo info2 = new NavigateInfo
                {
                    LocationType = allImgBanners[i].LocationType,
                    Url          = allImgBanners[i].Url
                };
                string loctionUrl = "javascript:";
                if (!string.IsNullOrEmpty(allImgBanners[i].Url))
                {
                    loctionUrl = info2.LoctionUrl;
                }
                if (litActivity != null)
                {
                    //排版处理
                    string text       = this.litActivity.Text;
                    int    cellCounts = 0;//排版的数量基数
                    switch (SettingsManager.GetMasterSettings(true).VTheme.ToLower())
                    {
                    case "e0402":
                    case "e0403":
                        cellCounts = 2;

                        if (activityCount % cellCounts != 0 && i == activityCount - 1)    //如果是单数,并且到了循环的最后一条图片时,
                        {
                            this.litActivity.Text = text + "<li style='list-style:none;width:100%'><a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + allImgBanners[i].ImageUrl + "\" title=\"" + allImgBanners[i].ShortDesc + "\" alt=\"" + allImgBanners[i].ShortDesc + "\" /></a></li>";
                        }
                        else
                        {
                            this.litActivity.Text = text + "<li style='list-style:none'><a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + allImgBanners[i].ImageUrl + "\" title=\"" + allImgBanners[i].ShortDesc + "\" alt=\"" + allImgBanners[i].ShortDesc + "\" /></a></li>";
                        }
                        break;

                    default:    //默认样式:直接堆叠.
                        this.litActivity.Text = text + "<li style='list-style:none'><a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + allImgBanners[i].ImageUrl + "\" title=\"" + allImgBanners[i].ShortDesc + "\" alt=\"" + allImgBanners[i].ShortDesc + "\" /></a></li>";
                        break;
                    }
                }
            }


            if (allImgBanners.Count == 0)
            {
                this.div_activity = (HtmlControl)this.FindControl("div_activity");
                if (div_activity != null)
                {
                    div_activity.Visible = false;
                }

                //this.litActivity.Text = "<a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a>";
            }
        }
示例#5
0
        public void OnPrevCommand()
        {
            NavigateInfo navigationInfo = new NavigateInfo()
            {
                ScreenName  = "ProductSelection",
                CurrentCart = currentCart
            };

            ServiceLocator.Current.GetInstance <IEventAggregator>().GetEvent <NavigateScreenEvent>().Publish(navigationInfo);
        }
示例#6
0
        public void OnCheckout()
        {
            if (myCart.Count == 0)
            {
                return;
            }

            NavigateInfo navigationInfo = new NavigateInfo()
            {
                ScreenName  = "SelectCustomer",
                CurrentCart = MyCart
            };

            ServiceLocator.Current.GetInstance <IEventAggregator>().GetEvent <NavigateScreenEvent>().Publish(navigationInfo);
        }
示例#7
0
        public void OnNextCommand()
        {
            if (Customer == null || Customer.CustomerID <= 0)
            {
                return;
            }

            NavigateInfo navigationInfo = new NavigateInfo()
            {
                ScreenName      = "CartCheckout",
                CurrentCart     = currentCart,
                CurrentCustomer = Customer
            };

            ServiceLocator.Current.GetInstance <IEventAggregator>().GetEvent <NavigateScreenEvent>().Publish(navigationInfo);
        }
        protected void btnAddBanner_Click(object sender, System.EventArgs e)
        {
            if (this.id == 0)
            {
                TplCfgInfo tplCfgInfo = new NavigateInfo();
                tplCfgInfo.IsDisable    = false;
                tplCfgInfo.ImageUrl     = this.fmSrc.Value;
                tplCfgInfo.ShortDesc    = this.txtBannerDesc.Text;
                tplCfgInfo.Client       = 3;
                tplCfgInfo.LocationType = (LocationType)System.Enum.Parse(typeof(LocationType), this.ddlType.SelectedValue);
                tplCfgInfo.Url          = this.locationUrl.Value;
                tplCfgInfo.SupplierId   = CheckSupplierRole();
                if (string.IsNullOrWhiteSpace(tplCfgInfo.ImageUrl))
                {
                    this.ShowMsg("请上传图片!", false);
                    return;
                }
                if (VShopHelper.SaveTplCfg(tplCfgInfo))
                {
                    this.CloseWindow();
                    return;
                }
                this.ShowMsg("添加错误!", false);
            }

            else
            {
                TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);
                tplCfgById.IsDisable    = false;
                tplCfgById.ImageUrl     = this.fmSrc.Value;
                tplCfgById.ShortDesc    = this.txtBannerDesc.Text;
                tplCfgById.Client       = 3;
                tplCfgById.LocationType = (LocationType)System.Enum.Parse(typeof(LocationType), this.ddlType.SelectedValue);
                tplCfgById.Url          = this.locationUrl.Value;
                tplCfgById.SupplierId   = CheckSupplierRole();
                if (VShopHelper.UpdateTplCfg(tplCfgById))
                {
                    this.CloseWindow();
                    return;
                }
                this.ShowMsg("修改失败!", false);
            }
        }
示例#9
0
        private UserControl GetView(NavigateInfo navigationInfo)
        {
            switch (navigationInfo.ScreenName)
            {
                case "SelectCustomer":
                    var view = new CustomersView();
                    var viewModel = new CustomersViewModel(ServiceLocator.Current.GetInstance<IWebservice>(), navigationInfo.CurrentCart);
                    view.DataContext = viewModel;
                    return view;
                case "ProductSelection":
                    var productsView = new ProductsView();
                    var productsViewModel = new ProductsViewModel(ServiceLocator.Current.GetInstance<IWebservice>(), navigationInfo.CurrentCart);
                    productsView.DataContext = productsViewModel;
                    return productsView;
                case "CartCheckout":
                    var cartView = new CartView();
                    var cartViewModel = new CartViewModel(ServiceLocator.Current.GetInstance<IWebservice>(), navigationInfo.CurrentCart, navigationInfo.CurrentCustomer);
                    cartView.DataContext = cartViewModel;
                    return cartView;
            }

            return null;
        }
示例#10
0
文件: VDefault.cs 项目: tyriankid/WFX
        protected override void AttachChildControls()
        {
            if (SettingsManager.GetMasterSettings(true).VTheme.ToLower() == "common")
            {
                this.Page.Response.Redirect("index.aspx");
                return;
            }
            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (HtmlImage)this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (Literal)this.FindControl("litstorename");
            this.litdescription = (Literal)this.FindControl("litdescription");
            this.litattention   = (Literal)this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            if (CustomConfigHelper.Instance.IsLogoOn == "false")
            {
                imglogo.Visible = false;
            }
            this.litImgae      = (Literal)this.FindControl("litImgae");
            this.litActivity   = (Literal)this.FindControl("litActivity");//大图展示页面
            this.litItemParams = (Literal)this.FindControl("litItemParams");

            //店铺推广码送过来的地址(参数:ReferralId)
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                //无传参,取COOKIE
                HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + cookie.Value);
                }
            }
            if (this.rptCategories.Visible)
            {
                DataTable brandCategories = CategoryBrowser.GetBrandCategories();
                this.itemcount = brandCategories.Rows.Count;
                if (brandCategories.Rows.Count > 0)
                {
                    this.rptCategories.DataSource = brandCategories;
                    this.rptCategories.DataBind();
                }
            }
            this.Page.Session["stylestatus"] = "3";
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            PageTitle.AddSiteNameTitle(masterSettings.SiteName);
            this.litstorename.Text   = masterSettings.SiteName;
            this.litdescription.Text = masterSettings.ShopIntroduction;
            if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
            {
                this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
            }
            if (base.referralId <= 0)
            {
                HttpCookie cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if ((cookie2 != null) && !string.IsNullOrEmpty(cookie2.Value))
                {
                    base.referralId = int.Parse(cookie2.Value);
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                HttpCookie cookie3 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (((cookie3 != null) && !string.IsNullOrEmpty(cookie3.Value)) && (this.referralId.ToString() != cookie3.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);//跳转到自己的店铺
                }
            }
            IList <BannerInfo> allBanners = new List <BannerInfo>();

            allBanners = VshopBrowser.GetAllBanners();
            foreach (BannerInfo info in allBanners)
            {
                TplCfgInfo info2 = new NavigateInfo
                {
                    LocationType = info.LocationType,
                    Url          = info.Url
                };
                string loctionUrl = "javascript:";
                if (!string.IsNullOrEmpty(info.Url))
                {
                    loctionUrl = info2.LoctionUrl;
                }
                string text = this.litImgae.Text;
                this.litImgae.Text = text + "<li><a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a></li>";
                //this.litActivity.Text = text + "<a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a>";
            }
            if (allBanners.Count == 0)
            {
                this.litImgae.Text = "<li><a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a></li>";
            }


            DistributorsInfo userIdDistributors = new DistributorsInfo();

            userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
            if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
            {
                PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
                this.litdescription.Text = userIdDistributors.StoreDescription;
                this.litstorename.Text   = userIdDistributors.StoreName;
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                }
                if (!string.IsNullOrEmpty(userIdDistributors.BackImage))
                {
                    this.litImgae.Text = "";
                    foreach (string str2 in userIdDistributors.BackImage.Split(new char[] { '|' }))
                    {
                        if (!string.IsNullOrEmpty(str2))
                        {
                            this.litImgae.Text = this.litImgae.Text + "<a ><img src=\"" + str2 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery query = new ProductQuery
                {
                    PageSize  = this.pager.PageSize,
                    PageIndex = this.pager.PageIndex,
                    SortBy    = "DisplaySequence",
                    SortOrder = SortAction.Desc
                };
                //查询条件处理
                switch (SettingsManager.GetMasterSettings(true).VTheme.ToLower())
                {
                case "underwear":
                    this.pager.Visible = false;
                    query.PageSize     = 1000;
                    query.PageIndex    = 1;
                    query.SortBy       = "ShowSaleCounts";
                    query.SortOrder    = SortAction.Desc;
                    query.TypeId       = 1;
                    break;
                }
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query);
                this.rptProducts.DataSource = homeProduct.Data;
                this.rptProducts.DataBind();
                this.pager.TotalRecords = homeProduct.TotalRecords;
                if (this.pager.TotalRecords <= this.pager.PageSize)
                {
                    this.pager.Visible = false;
                }
            }

            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }
            if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.GuidePageSet;
            }
            string str3 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                str3 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string str4 = "";
            string str5 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
            }
            this.litItemParams.Text = str3 + "|" + masterSettings.ShopHomeName + "|" + masterSettings.ShopHomeDescription + "$";
            this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str4, "|好店推荐之", str5, "商城|一个购物赚钱的好去处|", HttpContext.Current.Request.Url });

            int    userid         = 18;
            string userFomartCode = userid.ToString("000000000000000");

            LoadProductTop();
            getImgBanner();         //载入大图
            getMyCoupon();          //获取首页赠送优惠券
            InitDataByTheme();
            distributorVisitCont(); //更新店铺访问信息
        }
示例#11
0
 public void ScreenNavigate(NavigateInfo navigationInfo)
 {
     var nextView = GetView(navigationInfo);
     LetsHackThis.Content = nextView;
 }
示例#12
0
        protected override void AttachChildControls()
        {
            HttpCookie cookie2;

            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (HtmlImage)this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (Literal)this.FindControl("litstorename");
            this.litdescription = (Literal)this.FindControl("litdescription");
            this.litattention   = (Literal)this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            this.litImgae       = (Literal)this.FindControl("litImgae");
            this.litItemParams  = (Literal)this.FindControl("litItemParams");
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (!((cookie == null) || string.IsNullOrEmpty(cookie.Value)))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + cookie.Value);
                }
            }
            if (this.rptCategories.Visible)
            {
                DataTable brandCategories = CategoryBrowser.GetBrandCategories();
                this.itemcount = brandCategories.Rows.Count;
                if (brandCategories.Rows.Count > 0)
                {
                    this.rptCategories.DataSource = brandCategories;
                    this.rptCategories.DataBind();
                }
            }
            this.Page.Session["stylestatus"] = "3";
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            PageTitle.AddSiteNameTitle(masterSettings.SiteName);
            this.litstorename.Text   = masterSettings.SiteName;
            this.litdescription.Text = masterSettings.ShopIntroduction;
            if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
            {
                this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
            }
            if (base.referralId <= 0)
            {
                cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (!((cookie2 == null) || string.IsNullOrEmpty(cookie2.Value)))
                {
                    base.referralId = int.Parse(cookie2.Value);
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (((cookie2 != null) && !string.IsNullOrEmpty(cookie2.Value)) && (this.referralId.ToString() != cookie2.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            IList <BannerInfo> allBanners = new List <BannerInfo>();

            allBanners = VshopBrowser.GetAllBanners();
            foreach (BannerInfo info in allBanners)
            {
                TplCfgInfo info2 = new NavigateInfo {
                    LocationType = info.LocationType,
                    Url          = info.Url
                };
                string loctionUrl = "javascript:";
                if (!string.IsNullOrEmpty(info.Url))
                {
                    loctionUrl = info2.LoctionUrl;
                }
                string text = this.litImgae.Text;
                this.litImgae.Text = text + "<a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a>";
            }
            if (allBanners.Count == 0)
            {
                this.litImgae.Text = "<a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a>";
            }
            DistributorsInfo userIdDistributors = new DistributorsInfo();

            userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
            if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
            {
                PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
                this.litdescription.Text = userIdDistributors.StoreDescription;
                this.litstorename.Text   = userIdDistributors.StoreName;
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                }
                if (!string.IsNullOrEmpty(userIdDistributors.BackImage))
                {
                    this.litImgae.Text = "";
                    foreach (string str2 in userIdDistributors.BackImage.Split(new char[] { '|' }))
                    {
                        if (!string.IsNullOrEmpty(str2))
                        {
                            this.litImgae.Text = this.litImgae.Text + "<a ><img src=\"" + str2 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery query = new ProductQuery {
                    PageSize  = this.pager.PageSize,
                    PageIndex = this.pager.PageIndex,
                    SortBy    = "DisplaySequence",
                    SortOrder = SortAction.Desc
                };
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query);
                this.rptProducts.DataSource = homeProduct.Data;
                this.rptProducts.DataBind();
                this.pager.TotalRecords = homeProduct.TotalRecords;
                if (this.pager.TotalRecords <= this.pager.PageSize)
                {
                    this.pager.Visible = false;
                }
            }
            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }
            if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.GuidePageSet;
            }
            if ((this.Page.Request.UserAgent.ToLower().Contains("alipay") && !string.IsNullOrEmpty(masterSettings.AliPayFuwuGuidePageSet)) && !string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.AliPayFuwuGuidePageSet;
            }
            string str4 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string str5 = "";
            string str6 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                str5 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
            }
            this.litItemParams.Text = str4 + "|" + masterSettings.ShopHomeName + "|" + masterSettings.ShopHomeDescription + "$";
            this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str5, "|好店推荐之", str6, "商城|一个购物赚钱的好去处|", HttpContext.Current.Request.Url });
        }
示例#13
0
        public void OnNextCommand()
        {
            if (Customer == null || Customer.CustomerID <= 0)
                return;

            NavigateInfo navigationInfo = new NavigateInfo()
            {
                ScreenName = "CartCheckout",
                CurrentCart = currentCart,
                CurrentCustomer = Customer
            };

            ServiceLocator.Current.GetInstance<IEventAggregator>().GetEvent<NavigateScreenEvent>().Publish(navigationInfo);
        }
示例#14
0
        public void OnCheckout()
        {
            if (myCart.Count == 0)
                return;

            NavigateInfo navigationInfo = new NavigateInfo()
            {
                ScreenName = "SelectCustomer",
                CurrentCart = MyCart
            };

            ServiceLocator.Current.GetInstance<IEventAggregator>().GetEvent<NavigateScreenEvent>().Publish(navigationInfo);
        }
示例#15
0
        public void ScreenNavigate(NavigateInfo navigationInfo)
        {
            var nextView = GetView(navigationInfo);

            LetsHackThis.Content = nextView;
        }
示例#16
0
        public List <NavigateInfo> GetCurrentByProjectId(string projectId, string flowCode, string subFlowCode, string userAccount)
        {
            var flowList = FlowInfo.Search(e => e.ParentCode == FlowCode.Closure).OrderBy(e => e.LayoutSequence);

            //获取当前用户的项目任务
            var sql = string.Format(@"SELECT tb_users.*,tb_work.Status AS TaskStatus,tb_work.TypeCode,tb_work.Url,
            tb_work.ProcInstID,tb_users.ProjectId
            FROM dbo.ProjectUsers tb_users
            RIGHT JOIN dbo.TaskWork tb_work
            ON tb_users.UserAccount = tb_work.ReceiverAccount
            AND tb_work.RefID = tb_users.ProjectId
            WHERE tb_work.RefID = '{0}' AND tb_work.ReceiverAccount ='{1}'
            AND ISNULL(RoleCode,'')!='View' AND tb_work.Status = 0  ", projectId, userAccount);

            var navigateList = new List <NavigateInfo>();

            var result = ProjectUsers.SqlQuery <ProjectUsersEntity>(sql, null);
            var list   = result.ToList();



            //获取已完成的项目列表
            var finishedProjectList = ProjectInfo.Search(e => e.ProjectId == projectId && e.Status == ProjectStatus.Finished).ToList();

            NavigateInfo navigateItem  = null;
            var          viewPageStuff = "/View/param?projectId=" + projectId;
            var          editPageStuff = "/" + projectId;

            //是否是编辑页

            foreach (var flowItem in flowList)
            {
                var isEditPage = false;
                navigateItem          = new NavigateInfo();
                navigateItem.NameZHCN = flowItem.NameZHCN;
                navigateItem.Linked   = true;
                navigateItem.Code     = flowItem.Code;
                navigateItem.Href     = string.Empty;

                //设置当前的子流程的为选中状态
                if (flowItem.Code == subFlowCode)
                {
                    navigateItem.IsSelected = true;
                }

                //设置流程的完成状态
                foreach (var project in finishedProjectList)
                {
                    if (flowItem.Code == project.FlowCode)
                    {
                        navigateItem.IsFinished = true;
                    }
                }


                //默认的链接 主流程Code+/+子流程Code
                string defaultUrl = "#/" + flowItem.FlowCodePrefix + "/" + flowItem.Code.Split('_')[1];

                //判断当前用户是否有待办任务
                foreach (var item in list)
                {
                    if (item.TypeCode == flowItem.Code)
                    {
                        if (item.TaskStatus == TaskWorkStatus.UnFinish)
                        {
                            //如果有待办任务导航tab的链接为待办任务的链接
                            navigateItem.Href = item.Url;
                            if (item.ProcInstID.HasValue && !string.IsNullOrEmpty(item.ProjectId))
                            {
                                navigateItem.Href += "&projectId=" + item.ProjectId;
                            }
                        }
                        //如果任务已结束设置为只读页面的链接
                        else if (item.TaskStatus == TaskWorkStatus.Finished ||
                                 item.TaskStatus == TaskWorkStatus.K2ProcessApproved || navigateItem.IsFinished)
                        {
                            navigateItem.Href = defaultUrl + viewPageStuff;
                        }
                    }
                }


                //获取当前用户的项目组头衔

                var projectUser = ProjectUsers.Get(ClientCookie.UserCode, projectId);

                if (string.IsNullOrEmpty(navigateItem.Href))
                {
                    if (projectUser != null)
                    {
                        if (!string.IsNullOrEmpty(flowItem.RoleCode) &&
                            flowItem.RoleCode.Split('_').Contains(projectUser.RoleCode) && !navigateItem.IsFinished)
                        {
                            isEditPage = true;
                        }

                        if (isEditPage)
                        {
                            navigateItem.Href = defaultUrl + editPageStuff;
                        }
                        else
                        {
                            navigateItem.Href = defaultUrl + viewPageStuff;
                        }
                    }
                    else
                    {
                        navigateItem.Href = defaultUrl + viewPageStuff;
                    }
                }


                navigateList.Add(navigateItem);
            }


            return(navigateList);
        }
示例#17
0
文件: VDefault.cs 项目: zwkjgs/XKD
        protected override void AttachChildControls()
        {
            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (System.Web.UI.WebControls.Literal) this.FindControl("litstorename");
            this.litdescription = (System.Web.UI.WebControls.Literal) this.FindControl("litdescription");
            this.litattention   = (System.Web.UI.WebControls.Literal) this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            this.litImgae       = (System.Web.UI.WebControls.Literal) this.FindControl("litImgae");
            this.litItemParams  = (System.Web.UI.WebControls.Literal) this.FindControl("litItemParams");
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                System.Web.HttpCookie httpCookie = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + httpCookie.Value);
                }
            }
            if (this.rptCategories.Visible)
            {
                DataTable brandCategories = CategoryBrowser.GetBrandCategories();
                this.itemcount = brandCategories.Rows.Count;
                if (brandCategories.Rows.Count > 0)
                {
                    this.rptCategories.DataSource = brandCategories;
                    this.rptCategories.DataBind();
                }
            }
            this.Page.Session["stylestatus"] = "3";
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            PageTitle.AddSiteNameTitle(masterSettings.SiteName);
            this.litstorename.Text   = masterSettings.SiteName;
            this.litdescription.Text = masterSettings.ShopIntroduction;
            if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
            {
                this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[]
                {
                    '|'
                })[0];
            }
            if (this.referralId <= 0)
            {
                System.Web.HttpCookie httpCookie2 = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value))
                {
                    this.referralId = int.Parse(httpCookie2.Value);
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                System.Web.HttpCookie httpCookie2 = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value) && this.referralId.ToString() != httpCookie2.Value)
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            System.Collections.Generic.IList <BannerInfo> list = new System.Collections.Generic.List <BannerInfo>();
            list = VshopBrowser.GetAllBanners();
            foreach (BannerInfo current in list)
            {
                TplCfgInfo tplCfgInfo = new NavigateInfo();
                tplCfgInfo.LocationType = current.LocationType;
                tplCfgInfo.Url          = current.Url;
                string text = "javascript:";
                if (!string.IsNullOrEmpty(current.Url))
                {
                    text = tplCfgInfo.LoctionUrl;
                }
                System.Web.UI.WebControls.Literal expr_3E2 = this.litImgae;
                string text2 = expr_3E2.Text;
                expr_3E2.Text = string.Concat(new string[]
                {
                    text2,
                    "<a  id=\"ahref\" href='",
                    text,
                    "'><img src=\"",
                    current.ImageUrl,
                    "\" title=\"",
                    current.ShortDesc,
                    "\" alt=\"",
                    current.ShortDesc,
                    "\" /></a>"
                });
            }
            if (list.Count == 0)
            {
                this.litImgae.Text = "<a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a>";
            }
            DistributorsInfo distributorsInfo = new DistributorsInfo();

            distributorsInfo = DistributorsBrower.GetUserIdDistributors(this.referralId);
            if (distributorsInfo != null && distributorsInfo.UserId > 0)
            {
                PageTitle.AddSiteNameTitle(distributorsInfo.StoreName);
                this.litdescription.Text = distributorsInfo.StoreDescription;
                this.litstorename.Text   = distributorsInfo.StoreName;
                if (!string.IsNullOrEmpty(distributorsInfo.Logo))
                {
                    this.imglogo.ImageUrl = distributorsInfo.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[]
                    {
                        '|'
                    })[0];
                }
                if (!string.IsNullOrEmpty(distributorsInfo.BackImage))
                {
                    this.litImgae.Text = "";
                    string[] array = distributorsInfo.BackImage.Split(new char[]
                    {
                        '|'
                    });
                    for (int i = 0; i < array.Length; i++)
                    {
                        string text3 = array[i];
                        if (!string.IsNullOrEmpty(text3))
                        {
                            System.Web.UI.WebControls.Literal expr_5D7 = this.litImgae;
                            expr_5D7.Text = expr_5D7.Text + "<a ><img src=\"" + text3 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery productQuery = new ProductQuery();
                productQuery.PageSize  = this.pager.PageSize;
                productQuery.PageIndex = this.pager.PageIndex;
                productQuery.SortBy    = "DisplaySequence";
                productQuery.SortOrder = SortAction.Desc;
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), productQuery);
                this.rptProducts.DataSource = homeProduct.Data;
                this.rptProducts.DataBind();
                this.pager.TotalRecords = homeProduct.TotalRecords;
                if (this.pager.TotalRecords <= this.pager.PageSize)
                {
                    this.pager.Visible = false;
                }
            }
            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }
            if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.GuidePageSet;
            }
            string userAgent = this.Page.Request.UserAgent;

            if (userAgent.ToLower().Contains("alipay") && !string.IsNullOrEmpty(masterSettings.AliPayFuwuGuidePageSet))
            {
                if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
                {
                    this.litattention.Text = masterSettings.AliPayFuwuGuidePageSet;
                }
            }
            string text4 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                text4 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string text5 = "";
            string text6 = (distributorsInfo == null) ? masterSettings.SiteName : distributorsInfo.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                text5 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[]
                {
                    '|'
                })[0];
            }
            this.litItemParams.Text = string.Concat(new string[]
            {
                text4,
                "|",
                masterSettings.ShopHomeName,
                "|",
                masterSettings.ShopHomeDescription,
                "$"
            });
            this.litItemParams.Text = string.Concat(new object[]
            {
                this.litItemParams.Text,
                text5,
                "|好店推荐之",
                text6,
                "商城|一个购物赚钱的好去处|",
                System.Web.HttpContext.Current.Request.Url
            });
        }
示例#18
0
        public void OnPrevCommand()
        {
            NavigateInfo navigationInfo = new NavigateInfo()
            {
                ScreenName = "ProductSelection",
                CurrentCart = currentCart
            };

            ServiceLocator.Current.GetInstance<IEventAggregator>().GetEvent<NavigateScreenEvent>().Publish(navigationInfo);
        }
示例#19
0
 private async void ExecuteNavigateToPageCommand(NavigateInfo info)
 {
     _mainPage.HideMenu();
     await App.Current.Navigation.Navigate(info);
 }