public StoresTabletPage() { Title = "Stores"; Master = new StoresPage(); Detail = new ContentPage { Content = new StackLayout { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Children = { new Label { Text = "Select a Shop", FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) } } } }; ((StoresPage)Master).ItemSelected = (store) => { Detail = new StorePage(store); if (Device.OS != TargetPlatform.Windows) { IsPresented = false; } }; IsPresented = true; }
public async Task <object> Update(StorePage sp) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var rec = _db.StorePage.Find(sp.Id); if (rec == null) { StorePage newStore = new StorePage { Heading = sp.Heading, Description = sp.Description, PurchaseInfo = sp.PurchaseInfo, PurchaseInfoHeading = sp.PurchaseInfoHeading }; _db.Add(newStore); } else { rec.Heading = sp.Heading; rec.Description = sp.Description; rec.PurchaseInfo = sp.PurchaseInfo; rec.PurchaseInfoHeading = sp.PurchaseInfoHeading; rec.LocationList = sp.LocationList; } await _db.SaveChangesAsync(); return(Ok("200")); }
public StoresTabletPage() { Title = "Stores"; Master = new StoresPage(); Detail = new ContentPage { Content = new StackLayout { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Children = { new Label { Text = "Select a Shop", FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) } } } }; ((StoresPage)Master).ItemSelected = (store) => { Detail = new StorePage(store); if(Device.OS != TargetPlatform.Windows) IsPresented = false; }; IsPresented = true; }
public StorePage GetStorePageNoId() { StorePage page = new StorePage(); page.giftBoxes = GetGiftBoxes(null); return(page); }
public async Task OpenStorePageAsync(StorePage storePage) { if (Enum.IsDefined(typeof(StorePage), storePage) == false) { throw new ArgumentException("store page is not defined.", nameof(storePage)); } switch (storePage) { case StorePage.Home: await Launcher.LaunchUriAsync(new Uri("ms-windows-store://home")); break; case StorePage.Apps: case StorePage.Games: case StorePage.Music: case StorePage.Video: await Launcher.LaunchUriAsync(new Uri("ms-windows-store://navigatetopage/?Id=" + storePage.ToString())); break; default: break; } }
public void CheckRoot() { for (int i = 0; i < formList.Count; i++) { StatPage sp = formList[i] as StatPage; if (sp != null) { sp.CheckRoot(); sp.ChangeLoginButton(); continue; } StorePage storePage = formList[i] as StorePage; if (storePage != null) { storePage.CheckRoot(); continue; } MapPage mp = formList[i] as MapPage; if (mp != null) { mp.CheckRoot(); continue; } } }
public void ContactConcessionaryAd() { driver.Url = Url.Deautos.Views.Store.Main; var store = new StorePage(driver); store.ContactConcessionaryAd(); }
public void StoreMap() { driver.Url = Url.Deautos.Views.Store.Main; var store = new StorePage(driver); store.Map(); }
public void StoreInformationPresence() { driver.Url = Url.Deautos.Views.Store.Main; var store = new StorePage(driver); IsTrue(store.InformationPresence()); }
public static int UpdateStorePage(StorePage page) { DataCommand cmd = DataCommandManager.GetDataCommand("UpdateStorePage"); cmd.SetParameterValue(page); cmd.ExecuteNonQuery(); return(page.SysNo.Value); }
public StorePage GetStorePage(int?userId) { StorePage page = new StorePage(); page.cart = GetCart(userId); page.giftBoxes = GetGiftBoxes(null); return(page); }
private void button4_Click_1(object sender, EventArgs e) { MainPush.Text = "Загрузка автоматизации склада..."; StorePage storePage = new StorePage(); formList.Add(storePage); storePage.Show(); MainPush.Text = ""; }
public static int SaveStorePage(StorePage page) { var cmd = DataCommandManager.GetDataCommand("SaveStorePage"); if (cmd != null) { cmd.SetParameterValue(page); cmd.ExecuteNonQuery(); return((int)cmd.GetParameterValue("@SysNo")); } throw new Exception("command [SaveStorePage] is not defined"); }
public static int PublishStorePage(StorePage page) { var cmd = DataCommandManager.GetDataCommand("PublishStorePage"); if (cmd != null) { cmd.SetParameterValue(page); cmd.SetParameterValue("@StorePageSysNo", page.SysNo.Value); return(cmd.ExecuteNonQuery()); } throw new Exception("command [PublishStorePage] is not defined"); }
public void Checkout() { WelcomePage welcome = new WelcomePage(); StorePage store = welcome.Login("*****@*****.**", "@nuK1978"); Console.WriteLine("Login done"); Console.WriteLine("add product to cart"); Checkout shoppingCart = store.ShopProduct(); shoppingCart.ClickCheckout(); Console.WriteLine("Click checkout"); }
public void ShopItem() { WelcomePage welcome = new WelcomePage(); StorePage shop = welcome.Login("*****@*****.**", "@nuK1978"); Console.WriteLine("Login done"); Console.WriteLine("add product to cart"); shop.ShopProduct(); //IWebElement AddCart2; }
/// <summary> /// save drafts /// </summary> /// <param name="page"></param> /// <returns></returns> public static int SaveStorePage(StorePage page) { var result = StoreDA.QueryStorePageByPageName(page.PageName, page.SellerSysNo.Value); if (result != null) { page.SysNo = result.SysNo; return(StoreDA.UpdateStorePage(page)); } else { return(StoreDA.SaveStorePage(page)); } }
public void TestLogin() { var openStore = new StorePage(); openStore.OpenStore(); var storLogin = new LoginPageObject(); var mainPage = new MainPageObject(); mainPage.Dismiss(); mainPage.Account(); storLogin.LoginWeb(); storLogin.LoginWithCredentions(); }
/// <summary> /// publish store page /// </summary> /// <param name="page"></param> /// <returns></returns> public static int PublishStorePage(StorePage page) { using (var trans = TransactionManager.Create()) { //step 1 save drafts var sysNo = SaveStorePage(page); page.SysNo = sysNo; //StoreDA.SaveStorePageDraft(page); //step 2 publish StoreDA.PublishStorePage(page); trans.Complete(); } return(1); }
/// <summary> /// 初始化页面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { string type = Request.QueryString["type"]; string where = " 1=1 "; if (!string.IsNullOrEmpty(type)) { where = " pagetype='" + type + "'"; } this.ImageView.PrepareData.Handler = string.Concat("return ", "formatData(data);"); DataTable dt = settingManager.GetTemplateInfo(where); dt = ConvertDatatable(dt); StorePage.DataSource = dt; StorePage.DataBind(); } }
public void CheckMonthlyShoeDisplay() { HomePage page = new HomePage(_driver); string selectedMonth; for (int index = 0; index < page.Months.Count; index++) { var month = page.Months[index]; selectedMonth = month.Text; month.Click(); WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(10)); var isTitleMatchingMonth = wait.Until(ExpectedConditions.TitleContains(selectedMonth)); Assert.True(isTitleMatchingMonth, "Title does not match the selected month"); StorePage storePage = new StorePage(_driver); var shoeList = storePage.ShoeResults; //if there are shoe results for the month then verify everything else if (shoeList.Count > 0) { foreach (var shoe in shoeList) { var releaseMonth = shoe.FindElement(By.ClassName("shoe_release_month")).Text; Assert.True(selectedMonth == releaseMonth, "Selected month does not equal Release Month"); //verify that there is a description var shoeDescription = shoe.FindElement(By.ClassName("shoe_description")); Assert.True(shoeDescription.Displayed && shoeDescription.Text != "", "Shoe description did not display"); //verify image of shoe is present var shoeImage = shoe.FindElement(By.ClassName("shoe_image")); Assert.True(shoeImage.Displayed && shoeImage.GetAttribute("src") != "", "Image for the shoe did not display"); //check that there is a price var shoePrice = shoe.FindElement(By.ClassName("shoe_price")); Assert.True(shoePrice.Displayed && shoePrice.Text != "", "Shoe price did not display"); } } else { Assert.Fail("There was not a description for the shoe in the month of {0}", selectedMonth); } } }
public void Test01() { ExReports.createTest("Find and purchase item"); StorePage s = new StorePage(BaseClass.getDriver); s.searchItem("iphone"); s.openItem(); s.addToCard(); s.checkOutItem(); s.mail = "*****@*****.**"; s.firstName = "Gleb"; s.lastName = "Shustin"; s.address = "9041 E Shorewood Dr."; s.city = "Seattle"; s.state = "WA"; s.county = "USA"; s.phone = "4255335454"; s.submitItem(); }
public static void SaveStorePageDraft(StorePage page) { //DataCommand cmd = DataCommandManager.GetDataCommand("SaveStorePageDraft"); }
/// <summary> /// Updates the content of a store page. /// Documentation https://developers.google.com/androidenterprise/v1/reference/storelayoutpages/update /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated AndroidEnterprise service.</param> /// <param name="enterpriseId">The ID of the enterprise.</param> /// <param name="pageId">The ID of the page.</param> /// <param name="body">A valid AndroidEnterprise v1 body.</param> /// <returns>StorePageResponse</returns> public static StorePage Update(AndroidEnterpriseService service, string enterpriseId, string pageId, StorePage body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (enterpriseId == null) { throw new ArgumentNullException(enterpriseId); } if (pageId == null) { throw new ArgumentNullException(pageId); } // Make the request. return(service.Storelayoutpages.Update(body, enterpriseId, pageId).Execute()); } catch (Exception ex) { throw new Exception("Request Storelayoutpages.Update failed.", ex); } }
/// <summary> /// 获得商铺详细信息 /// </summary> /// <param name="sellerSysNo"></param> /// <returns></returns> public StoreDetailModel GetStoreDetailInfo(int sellerSysNo) { //商家信息 StoreBasicInfo storeinfo = StoreFacade.QueryStoreBasicInfo(sellerSysNo); if (storeinfo == null) { //提示商品找不到 throw new BusinessException("商家找不到啦,请进入其他店铺,谢谢。"); } //头部信息 string header = StoreFacade.QueryStorePageHeader(storeinfo.SellerSysNo.Value); //导航 QueryResult <StoreNavigation> StoreNavigation = StoreFacade.QueryStoreNavigationList(new StorePageListQueryFilter { PageIndex = 0, PageSize = 100 }, storeinfo.SellerSysNo.Value); //店铺网页的主信息 StorePage homeinfo = StoreFacade.QueryHomePage(storeinfo.SellerSysNo.Value); //获得店铺的页面,如果是预览则查询ECStore..StorePageInfo,否则查询ECStore..[PublishedStorePageInfo] StorePage pageinfo = StoreFacade.QueryStorePage(new StorePageFilter { SellerSysNo = storeinfo.SellerSysNo.Value, PublishPageSysNo = homeinfo.SysNo, IsPreview = false }); bool IfDecorate = false;//如果按照装修元素确定店铺新品和一周排行设置为true,否则设置为false //店铺新品商品10个 List <RecommendProduct> newStoreRecommendList = new List <RecommendProduct>(); //一周排行10个 List <RecommendProduct> WeekRankingProduct = new List <RecommendProduct>(); if (IfDecorate) { //店铺新品 bool NewProducts = false; //一周排行 bool WeekRanking = false; if (pageinfo != null) { if (pageinfo.StorePageTemplate.StorePageLayouts.Count > 0) { foreach (var item in pageinfo.StorePageTemplate.StorePageLayouts) { //店铺新品 if (item.StorePageElements.Exists(x => x.Key == "NewProducts")) { NewProducts = true; } //一周排行 if (item.StorePageElements.Exists(x => x.Key == "WeekRanking")) { WeekRanking = true; } } } } if (NewProducts) { newStoreRecommendList = StoreFacade.QueryStoreNewRecommendProduct(storeinfo.SellerSysNo.Value, null, 10, ConstValue.LanguageCode, ConstValue.CompanyCode); } if (WeekRanking) { WeekRankingProduct = StoreFacade.QueryWeekRankingForCategoryCode(storeinfo.SellerSysNo.Value, null, 10, ConstValue.LanguageCode, ConstValue.CompanyCode); } } else { //店铺新品商品10个 newStoreRecommendList = StoreFacade.QueryStoreNewRecommendProduct(storeinfo.SellerSysNo.Value, null, 10, ConstValue.LanguageCode, ConstValue.CompanyCode); //一周排行10个 WeekRankingProduct = StoreFacade.QueryWeekRankingForCategoryCode(storeinfo.SellerSysNo.Value, null, 10, ConstValue.LanguageCode, ConstValue.CompanyCode); } StoreDetailModel result = new StoreDetailModel(); //商铺基本信息 result.StoreBasicInfo = Transformstoreinfo(storeinfo); //头部信息 result.HeaderInfo = header; //导航 if (StoreNavigation.ResultList.Count > 0) { result.StoreNavigationInfo = Transformsstorenavigation(StoreNavigation); } //店铺新品商品10个 if (newStoreRecommendList.Count > 0) { result.StoreNewProductRecommendInfo = Transformsnewstorerecommend(newStoreRecommendList); } //一周排行10个 if (WeekRankingProduct.Count > 0) { result.StoreWeekRankingProductInfo = TransformsWeekrankingproduct(WeekRankingProduct); } return(result); }
/// <summary> /// 获取新的完整状态树 /// </summary> /// <param name="state">当前 UI 状态</param> /// <param name="userManager"><see cref="KeylolUserManager"/></param> /// <param name="dbContext"><see cref="KeylolDbContext"/></param> /// <param name="coupon"><see cref="CouponProvider"/></param> /// <param name="cachedData"><see cref="CachedDataProvider"/></param> /// <param name="pointIdCode">据点识别码</param> /// <param name="authorIdCode">作者识别码</param> /// <param name="userIdCode">用户识别码</param> /// <param name="sidForAuthor">文章在作者名下的序号</param> /// <param name="keyword">搜索关键字</param> /// <returns>完整状态树</returns> public static async Task <Root> Locate(string state, [Injected] KeylolUserManager userManager, [Injected] KeylolDbContext dbContext, [Injected] CouponProvider coupon, [Injected] CachedDataProvider cachedData, string pointIdCode = null, string authorIdCode = null, string userIdCode = null, int sidForAuthor = 0, string keyword = null) { var root = new Root(); var currentUserId = StateTreeHelper.GetCurrentUserId(); var isOperator = StateTreeHelper.GetCurrentUser().IsInRole(KeylolRoles.Operator); if (await StateTreeHelper.CanAccessAsync <Root>(nameof(CurrentUser))) { var user = await userManager.FindByIdAsync(currentUserId); root.CurrentUser = await CurrentUser.CreateAsync(user, userManager, dbContext, coupon, cachedData); } switch (state) { case "entrance": root.Entrance = await EntranceLevel.CreateAsync(currentUserId, States.Entrance.EntrancePage.Auto, dbContext, cachedData); break; case "entrance.discovery": root.Entrance = await EntranceLevel.CreateAsync(currentUserId, States.Entrance.EntrancePage.Discovery, dbContext, cachedData); break; case "entrance.points": root.Entrance = await EntranceLevel.CreateAsync(currentUserId, States.Entrance.EntrancePage.Points, dbContext, cachedData); break; case "entrance.timeline": root.Entrance = await EntranceLevel.CreateAsync(currentUserId, States.Entrance.EntrancePage.Timeline, dbContext, cachedData); break; case "aggregation.point": root.Aggregation = new AggregationLevel { Point = await PointLevel.CreateAsync(currentUserId, pointIdCode, States.Aggregation.Point.EntrancePage.Auto, dbContext, cachedData) }; break; case "aggregation.point.frontpage": root.Aggregation = new AggregationLevel { Point = await PointLevel.CreateAsync(currentUserId, pointIdCode, States.Aggregation.Point.EntrancePage.Frontpage, dbContext, cachedData) }; break; case "aggregation.point.intel": root.Aggregation = new AggregationLevel { Point = await PointLevel.CreateAsync(currentUserId, pointIdCode, States.Aggregation.Point.EntrancePage.Intel, dbContext, cachedData) }; break; case "aggregation.point.product": root.Aggregation = new AggregationLevel { Point = await PointLevel.CreateAsync(currentUserId, pointIdCode, States.Aggregation.Point.EntrancePage.Product, dbContext, cachedData) }; break; case "aggregation.point.timeline": root.Aggregation = new AggregationLevel { Point = await PointLevel.CreateAsync(currentUserId, pointIdCode, States.Aggregation.Point.EntrancePage.Timeline, dbContext, cachedData) }; break; case "aggregation.point.edit.info": root.Aggregation = new AggregationLevel { Point = await PointLevel.CreateAsync(currentUserId, pointIdCode, States.Aggregation.Point.EntrancePage.EditInfo, dbContext, cachedData) }; break; case "aggregation.point.edit.style": root.Aggregation = new AggregationLevel { Point = await PointLevel.CreateAsync(currentUserId, pointIdCode, States.Aggregation.Point.EntrancePage.EditStyle, dbContext, cachedData) }; break; case "aggregation.user": root.Aggregation = new AggregationLevel { User = await UserLevel.CreateAsync(currentUserId, userIdCode, EntrancePage.Auto, dbContext, cachedData, userManager) }; break; case "aggregation.user.dossier": root.Aggregation = new AggregationLevel { User = await UserLevel.CreateAsync(currentUserId, userIdCode, EntrancePage.Dossier, dbContext, cachedData, userManager) }; break; case "aggregation.user.people": root.Aggregation = new AggregationLevel { User = await UserLevel.CreateAsync(currentUserId, userIdCode, EntrancePage.People, dbContext, cachedData, userManager) }; break; case "aggregation.user.timeline": root.Aggregation = new AggregationLevel { User = await UserLevel.CreateAsync(currentUserId, userIdCode, EntrancePage.Timeline, dbContext, cachedData, userManager) }; break; case "aggregation.user.edit": root.Aggregation = new AggregationLevel { User = await UserLevel.CreateAsync(currentUserId, userIdCode, EntrancePage.Edit, dbContext, cachedData, userManager) }; break; case "content.article": root.Content = new ContentLevel { Article = await States.Content.Article.ArticlePage.CreateAsync(authorIdCode, sidForAuthor, currentUserId, isOperator, dbContext, cachedData, userManager) }; break; case "content.activity": root.Content = new ContentLevel { Activity = await ActivityPage.CreateAsync(authorIdCode, sidForAuthor, currentUserId, isOperator, dbContext, cachedData, userManager) }; break; case "post-office.unread": if (await StateTreeHelper.CanAccessAsync <Root>(nameof(PostOffice))) { root.PostOffice = new PostOfficeLevel { Unread = await UnreadPage.CreateAsync(currentUserId, dbContext, cachedData) } } ; break; case "post-office.social-activity.comment": if (await StateTreeHelper.CanAccessAsync <Root>(nameof(PostOffice))) { root.PostOffice = new PostOfficeLevel { SocialActivity = new SocialActivityLevel { Comment = await CommentPage.CreateAsync(currentUserId, dbContext, cachedData) } } } ; break; case "post-office.social-activity.like": if (await StateTreeHelper.CanAccessAsync <Root>(nameof(PostOffice))) { root.PostOffice = new PostOfficeLevel { SocialActivity = new SocialActivityLevel { Like = await LikePage.CreateAsync(currentUserId, dbContext, cachedData) } } } ; break; case "post-office.social-activity.subscriber": if (await StateTreeHelper.CanAccessAsync <Root>(nameof(PostOffice))) { root.PostOffice = new PostOfficeLevel { SocialActivity = new SocialActivityLevel { Subscriber = await SubscriberPage.CreateAsync(currentUserId, dbContext, cachedData) } } } ; break; case "post-office.missive": if (await StateTreeHelper.CanAccessAsync <Root>(nameof(PostOffice))) { root.PostOffice = new PostOfficeLevel { Missive = await MissivePage.CreateAsync(currentUserId, dbContext, cachedData) } } ; break; case "coupon.detail": if (await StateTreeHelper.CanAccessAsync <Root>(nameof(Coupon))) { root.Coupon = new CouponLevel { Detail = await DetailPage.CreateAsync(currentUserId, dbContext, userManager) } } ; break; case "coupon.store": if (await StateTreeHelper.CanAccessAsync <Root>(nameof(Coupon))) { root.Coupon = new CouponLevel { Store = await StorePage.CreateAsync(currentUserId, dbContext, cachedData, userManager, coupon) } } ; break; case "coupon.ranking": if (await StateTreeHelper.CanAccessAsync <Root>(nameof(Coupon))) { root.Coupon = new CouponLevel { Ranking = await RankingPage.CreateAsync(currentUserId, dbContext, cachedData) } } ; break; case "search.point": root.Search = new SearchLevel { Point = await PointPage.CreateAsync(currentUserId, keyword, dbContext, cachedData) }; break; case "search.article": root.Search = new SearchLevel { Article = await ArticlePage.CreateAsync(keyword, dbContext, cachedData) }; break; case "search.user": root.Search = new SearchLevel { User = await UserPage.CreateAsync(currentUserId, keyword, dbContext, cachedData) }; break; default: throw new NotSupportedException("Not supported state."); } return(root); }