private void backButton_Click(object sender, RoutedEventArgs e) { var s = new FirstPage(); gridMain.Children.Clear(); gridMain.Children.Add(s); }
public App() { InitializeComponent(); //FlashCard flash = new FlashCard(); string mainDir = FileSystem.AppDataDirectory; string path = System.IO.Path.Combine(mainDir, "FlashCard.xml"); Group m = BindableModelBase.Load <Group>(path); if (m == null) { //No such file, then create a new model with defaults and save m = new Group(); m.Setup(); m.Save(path); } //Instantiate the viewmodel, and pass it a reference to the model FirstPageViewModel vm = new FirstPageViewModel(m); //Instantiatge the view, and pass it a reference to the viewmodel FirstPage firstPage = new FirstPage(vm); //Navigate in the first page MainPage = new NavigationPage(firstPage); }
internal override void Serialize(XmlSerializer serializer) { bool hasPrimary = HasHeaderFooter(HeaderFooterIndex.Primary); bool hasEvenPage = HasHeaderFooter(HeaderFooterIndex.EvenPage); bool hasFirstPage = HasHeaderFooter(HeaderFooterIndex.FirstPage); bool hasLastPage = HasHeaderFooter(HeaderFooterIndex.LastPage); // \primary... if (hasPrimary) { Primary.Serialize(serializer, "Primary"); } // \even... if (hasEvenPage) { EvenPage.Serialize(serializer, "Evenpage"); } // \firstpage... if (hasFirstPage) { FirstPage.Serialize(serializer, "Firstpage"); } if (hasLastPage) { LastPage.Serialize(serializer, "Lastpage"); } }
public App() { #region Create Main UI // To define the Main UI of the Xamarin.Form app // Instantiate a Page class // Populate it with Layouts and Controls // Assign to the App.MainPage property #endregion #region Markup as UI definition // Modern UI frameworks default to markup languages for UI definition // HTML, AXML, .XIB, .Storyboard, XAML #endregion // The root page of your application MainPage = new FirstPage(); //new ContentPage //{ // Content = new StackLayout // { // VerticalOptions = LayoutOptions.Start, // Children = { // new Label { // HorizontalTextAlignment = TextAlignment.Center, // Text = "Tailor-made Tour Stops", // FontSize = 24 // }, // new Label { // HorizontalTextAlignment = TextAlignment.Center, // Text = TourStops.Models.TourSource.First().Name, // FontSize = 20, // }}}}; }
public void Test1_GoogleTest() { String sPattern = TestConfiguration.Get <String>("PatternToSearch"); logger.Info("Executed testcase is: " + System.Reflection.MethodBase.GetCurrentMethod().Name); logger.Info("Open Browser."); LogManager.GetLogger("MyClassName"); _driver = new DriverRoutine().Create(); // Load Google and search for needed text; logger.Info("Open Google. Search for \"" + sPattern + "\""); new FirstPage(_driver).EnterSearchPattern(sPattern); logger.Info("Open the first link on search results page."); String sActualTitleOfFirstLink = new FirstPage(_driver).GetTitleOfFirstLink(); logger.Info("The title of first page is \"" + sActualTitleOfFirstLink + "\""); logger.Info("Close instance of driver."); new DriverRoutine().Dismiss(_driver); Boolean bPASSED = sActualTitleOfFirstLink.Contains(sPattern); logger.Info("Verify got result: EXPECTED \"" + sPattern + "\" must be in ACTUAL \"" + sActualTitleOfFirstLink + "\""); if (!bPASSED) { logger.Error("TEST FAILED!!!"); } else { logger.Info("TEST PASSED!!!"); } Assert.True(bPASSED); }
public void Test2_GoogleTest() { logger.Info("Executed testcase is: " + System.Reflection.MethodBase.GetCurrentMethod().Name); String sPattern = TestConfiguration.Get <String>("PatternToSearch"); String sDomainTosaerch = TestConfiguration.Get <String>("sDomainTosaerch"); Byte iPages = TestConfiguration.Get <Byte>("iPagesToSearchAt"); logger.Info("Test parameters: PatternToSearch = " + sPattern); logger.Info(" sDomainTosaerch = " + sDomainTosaerch); logger.Info(" iPagesToSearchAt = " + iPages); logger.Info("Open Browser."); _driver = new DriverRoutine().Create(); // Load Google and search for needed text; logger.Info("Open Google. Search for \"" + sPattern + "\""); new FirstPage(_driver).EnterSearchPattern(sPattern); //List<FoundElement> lResults = new FirstPage(_driver).GetResults(iPages); logger.Info("Get all found results form first " + iPages + " result pages"); String sFound = new FirstPage(_driver).SearchForDomain(sDomainTosaerch, iPages); logger.Info("Close instance of driver."); new DriverRoutine().Dismiss(_driver); Boolean bPASSED = sFound != ""; logger.Info("Searched domain \"" + sDomainTosaerch + " was expected on first " + iPages + " result pages..."); if (!bPASSED) { logger.Error("...but it was not! TEST FAILED!!!"); } else { logger.Info("...and was found! TEST PASSED!!!"); } Assert.True(bPASSED); }
public ActionResult AllBlog() { FirstPage bnm = new FirstPage(); bnm.blogs = db.Blogs.ToList(); return(View(bnm)); }
// GET: Blog public ActionResult Read(int id) { FirstPage bnm = new FirstPage(); bnm.blogs2 = db.Blogs.Find(id); return(View(bnm)); }
private void Btn_LogIn_Click(object sender, RoutedEventArgs e) { List <Employee> list = db.Employee.Where(i => i.Login != null && i.Password != null).ToList(); list = list.Where(i => i.Login.Equals(Tb_Login.Text)).ToList(); if (list.Count() == 1) { list = list.Where(i => i.Password.Equals(Tb_Password.Password)).ToList(); if (list.Count() == 1) { var user = list.FirstOrDefault(); FirstPage firstPage = new FirstPage(this, user); this.Visibility = Visibility.Hidden; Tb_Login.Clear(); Tb_Password.Clear(); firstPage.ShowDialog(); } else { MessageBox.Show("Пароль неверный, попробуйте ещё раз.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } else { MessageBox.Show("Логин неверный, попробуйте ещё раз.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
public App(IWindowManager windowManager) { InitializeComponent(); WindowManager = windowManager; MainPage = new FirstPage(); }
public FirstPagePresenter(FirstPage firstPage) { FirstPage = firstPage; FirstPage.LogIn += LogInUser; FirstPage.Register += RegisterNewUser; uiPresenter = new UIPresenter(); uiPresenter.UIClosed += ShowFirstPage; }
public override int GetHashCode() { int hash = 17; hash *= 23 + ETag.GetHashCode(); hash *= 23 + FirstPage.GetHashCode(); return(hash); }
public void Print(List <FirstPage> pnl) { firstPage = pnl; pannel = pnl.ElementAt(0); GetPrintArea(pnl); temp = MemoryImage.ToList(); previewdlg.Document = printdoc1; DialogResult result = PrintDialog(); }
/// <summary> /// Create a new FirstPage /// </summary> /// <param name="newFirstPage">new FirstPage</param> /// <returns>new FirstPage id</returns> public Guid Create(FirstPage newFirstPage) { string sql = string.Format("EXEC sp_firstpage_c {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19},{20},{21},{22},{23},{24},{25},{26},{27},{28},{29},{30},{31}" , ToQuote(newFirstPage.ID) , ToQuote(newFirstPage.twitter_id) , ToQuote(newFirstPage.twitter_author_uid) , ToQuote(newFirstPage.twitter_show_type) , ToQuote(newFirstPage.twitter_images_id) , ToQuote(newFirstPage.twitter_source_tid) , ToQuote(newFirstPage.twitter_htmlcontent) , ToQuote(newFirstPage.twitter_goods_id) , ToQuote(newFirstPage.twitter_pic_type) , ToQuote(newFirstPage.like_twitter_id) , ToQuote(newFirstPage.like_author_uid) , ToQuote(newFirstPage.from_act_name) , ToQuote(newFirstPage.from_act_id) , ToQuote(newFirstPage.goods_price) , ToQuote(newFirstPage.goods_title) , ToQuote(newFirstPage.goods_pic_url) , ToQuote(newFirstPage.goods_url) , ToQuote(newFirstPage.goods_picture_id) , ToQuote(newFirstPage.show_pic) , ToQuote(newFirstPage.BadyId) , ToQuote(newFirstPage.Type) , ToQuote(newFirstPage.Page) , ToQuote(newFirstPage.Liked) , ToQuote(newFirstPage.Record) , ToQuote(newFirstPage.Comment) , ToQuote(newFirstPage.Link) , ToQuote(newFirstPage.Rank) , ToQuote(CurrentUserName) , ToQuote(DateTime.Now) , ToQuote(CurrentUserName) , ToQuote(DateTime.Now) , ToQuote(newFirstPage.Statues) ); try { int rowcount = SqlHelper.ExecuteNonQuery(ConnectStr, CommandType.Text, sql); if (rowcount == 1) { return(newFirstPage.ID); } else { throw new Exception("SQL execution failed"); } } catch (Exception ex) { throw new Exception("SQL execution failed", ex); } }
public override int GetHashCode() { unchecked { int hash = base.GetHashCode(); hash = hash * 37 + FirstPage.GetHashCode(); hash = hash * 37 + SecondPage.GetHashCode(); return(hash); } }
public ActionResult Read(int id) { FirstPage bnm = new FirstPage(); bnm.place2 = db.Places.Find(id); bnm.prohots = db.Photos.ToList(); bnm.servicplace = db.PlaceServices.ToList(); return(View(bnm)); }
// GET: Listing public ActionResult Index() { FirstPage bnm = new FirstPage(); bnm.places = db.Places.ToList(); bnm.prohots = db.Photos.ToList(); bnm.cites = db.Cities.ToList(); return(View(bnm)); }
public void TestMethod1() { FirstPage firstPage = new FirstPage(Driver); firstPage.GoTo(); firstPage.LoginWithRightCredentials(); Assert.IsTrue(firstPage.IsLoaded, "The Home Page did not open successfully"); //Expected conditions Assert.IsTrue(firstPage.IsVisibleTitle, "The title is not visible"); //Hide user and pwd }
public ActionResult GetFirstPage() { FirstPage fp = new FirstPage(); List <FirstPage> liFP = new List <FirstPage>(); liFP = fp.GetFirstPage(); ViewData["FirstPageData"] = liFP; return(View(liFP.ToList())); // return View(); }
public void SetUp() { ChromeOptions options = new ChromeOptions(); options.AddArgument("--start-maximized"); options.AddArgument("--ignore-certificate-errors"); Properties.driver = new ChromeDriver(options); firstPage = new FirstPage(); firstPage.NavigateToUrl(); }
public App() { InitializeComponent(); var firstVm = new FirstViewModel(); var firstPage = new FirstPage { ViewModel = firstVm }; MainPage = new NavigationPage(firstPage); }
private SharpProp CreateTree() { var firstPage = new FirstPage { Number = state.FirstPage.Number }; var secondPage = new SecondPage { Text = state.SecondPage.Text }; return(new Router { Children = { new HomeRoute { Content = firstPage }, new TypeRoute <FirstPageNavigationArgs> { Content = firstPage }, new TypeRoute <SecondPageNavigationArgs> { Content = secondPage } } }); //return new FirstPage(); //return new StackPanel //{ // Key = "master", // Children = // { // //new Sharp.TextBlock { Key=0, Text = "Test1" }, // //new Sharp.TextBlock { Key=1, Text = "Test2" }, // //new Sharp.TextBlock { Key=2, Text = "Test3" }, // new Button { // Click = Clicked, // FontSize = 30, // Content = new TextBlock { Text = buttonText } // }, // new Button { // Click = Clicked, // FontSize = 30, // Content = new TextBlock { Text = "xxx" } // }, // } //}; //return new Button //{ // Click = Clicked, // FontSize = 30, // Content = new TextBlock { Text = buttonText } //}; }
public ActionResult Index() { FirstPage bnm = new FirstPage(); bnm.categories = db.Categories.ToList(); bnm.places = db.Places.Take(3).ToList(); bnm.prohots = db.Photos.ToList(); bnm.cites = db.Cities.ToList(); bnm.blogs = db.Blogs.Take(4).ToList(); bnm.blogs = db.Blogs.Take(4).ToList(); return(View(bnm)); }
/// <summary> /// Don't repeat yourself! This private function is for shared by all query public functions /// </summary> /// <param name="sql"></param> /// <param name="page"></param> /// <param name="pg"></param> /// <returns></returns> IList <FirstPage> GetFirstPages(string sql, int page, string sortKey, out PaginationInfo paging) { using (DataSet ds = SqlHelper.ExecuteDataset(ConnectStr, CommandType.Text, sql)) { if (ds == null || ds.Tables.Count != 2) { throw new Exception("SQL execution failed"); } else { List <FirstPage> Comments = new List <FirstPage>(); foreach (DataRow dr in ds.Tables[0].Rows) { FirstPage Comment = new FirstPage() { ID = new Guid(dr["id"].ToString()), BadyId = ParseStr(dr["BadyId"]), Comment = ParseInt(dr["Comment"]), Liked = ParseInt(dr["Liked"]), Link = ParseStr(dr["Link"]), Page = ParseInt(dr["page"]), Record = ParseInt(dr["Record"]), mtype = ParseStr(dr["mtype"]), Type = ParseStr(dr["Type"]), Statues = ParseInt(dr["Statues"]), Createby = ParseStr(dr["Createby"]), Createtime = ParseStr(dr["Createtime"]), Updateby = ParseStr(dr["Updateby"]), Updatetime = ParseStr(dr["Updatetime"]) }; Comments.Add(Comment); } paging = new PaginationInfo() { Current = page, Size = ParseInt(ds.Tables[1].Rows[0]["pagesize"]), TotalRecords = ParseInt(ds.Tables[1].Rows[0]["totalrecords"]), TotalPages = (int)Math.Ceiling(ParseInt(ds.Tables[1].Rows[0]["totalrecords"]) / ParseFloat(ds.Tables[1].Rows[0]["pagesize"])) }; return(Comments); } } }
public MainPage() { InitializeComponent(); List <PayementOption> PayementOptions = new List <PayementOption>() { new PayementOption { ImageSource1 = "credit_card.png", Name = "Credit Card", Price = 0 }, new PayementOption { ImageSource1 = "bank_transfer.png", Name = "Bank Transfer", Price = 0 }, }; List <DeliveryOption> DeliveryOptions = new List <DeliveryOption>() { new DeliveryOption { ImageSource1 = "normal_shipping.png", Name = "Express", Price = 30 }, new DeliveryOption { ImageSource1 = "express_shipping.png", Name = "Normal", Price = 10 }, }; this.PayementStep = 0; //Step3Image.Source = this.acimgsource; //Step2Image.Source = this.acimgsource; //Step3Image.Source = this.acimgsource; Step1Frame.HasShadow = true; //Step1Frame.OutlineColor = Color.FromHex("#443E43"); //Step1Frame.BackgroundColor = Color.FromHex("#F9FAFC"); Step2Frame.HasShadow = true; //Step2Frame.OutlineColor = Color.FromHex("#443E43"); //Step2Frame.BackgroundColor = Color.FromHex("#F9FAFC"); Step3Frame.HasShadow = true; //Step3Frame.OutlineColor = Color.FromHex("#443E43"); //Step3Frame.BackgroundColor = Color.FromHex("#F9FAFC"); switchsteps(this.PayementStep); this.a = new FirstPage(this); this.aa = new SecondPage(a); this.aaa = new ThirdPage(aa); CheckOutContentHolder.Content = a.Content; }
public void FirstTest() { //IWebElement element = null; FirstPage firstPage = new FirstPage(driver); bool isPresent = WebElementHelpers.IsElementPresent(firstPage.testElement); string expectedText = ""; //string textFromWebElement = element.GetText(); int count = 5; Assert.False(count == 0, "dsvsdv"); }
public App() { InitializeComponent(); if (Device.RuntimePlatform == Device.iOS) { MainPage = new FirstPage(); } else { MainPage = new NavigationPage(new FirstPage()); } SetUpFontSizes(); }
public static void SetTableVale(DataTable dt, FirstPage model) { DataRow dataRow = dt.NewRow(); dataRow[0] = model.ID; dataRow[1] = model.twitter_id; dataRow[2] = model.twitter_author_uid; dataRow[3] = model.twitter_show_type; dataRow[4] = model.twitter_images_id; dataRow[5] = model.twitter_source_tid; dataRow[6] = model.twitter_htmlcontent; dataRow[7] = model.twitter_goods_id; dataRow[8] = model.twitter_pic_type; dataRow[9] = model.like_twitter_id; dataRow[10] = model.like_author_uid; dataRow[11] = model.from_act_name; dataRow[12] = model.from_act_id; dataRow[13] = model.goods_price; dataRow[14] = model.goods_title; dataRow[15] = model.goods_pic_url; dataRow[16] = model.goods_url; dataRow[17] = model.goods_picture_id; dataRow[18] = model.show_pic; dataRow[19] = DBNull.Value; dataRow[20] = model.Type; dataRow[21] = model.Page; dataRow[22] = model.Liked; dataRow[23] = model.Record; dataRow[24] = model.Comment; dataRow[25] = model.Link; dataRow[26] = model.Rank; dataRow[27] = model.Createby; dataRow[28] = model.Createtime; dataRow[29] = model.Updateby; dataRow[30] = model.Updatetime; dataRow[31] = model.Statues; dt.Rows.Add(dataRow); }
/// <summary> /// Converts HeadersFooters into DDL. /// </summary> public override void Serialize(Serializer serializer) { bool hasPrimary = HasHeaderFooter(HeaderFooterIndex.Primary); bool hasEvenPage = HasHeaderFooter(HeaderFooterIndex.EvenPage); bool hasFirstPage = HasHeaderFooter(HeaderFooterIndex.FirstPage); // \primary... if (hasPrimary) { Primary.Serialize(serializer, "primary"); } // \even... if (hasEvenPage) { EvenPage.Serialize(serializer, "evenpage"); } // \firstpage... if (hasFirstPage) { FirstPage.Serialize(serializer, "firstpage"); } }
/// <summary> /// Update an existing FirstPage /// </summary> /// <param name="thisFirstPage">FirstPage</param> /// <returns>bool</returns> public bool Update(FirstPage thisFirstPage) { string sql = string.Format("EXEC sp_firstpage_u {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}" , ToQuote(thisFirstPage.ID) , ToQuote(thisFirstPage.BadyId) , ToQuote(thisFirstPage.Type) , ToQuote(thisFirstPage.Page) , ToQuote(thisFirstPage.Liked) , ToQuote(thisFirstPage.Record) , ToQuote(thisFirstPage.Comment) , ToQuote(thisFirstPage.Link) , ToQuote(CurrentUserName) , ToQuote(DateTime.Now) , ToQuote(thisFirstPage.Statues) ); try { int rowcount = SqlHelper.ExecuteNonQuery(ConnectStr, CommandType.Text, sql); if (rowcount == 1) { return(true); } else { throw new Exception("SQL execution failed"); } } catch (Exception ex) { throw new Exception("SQL execution failed", ex); } }
async void SignUpUser(string userName, string email, string pass) { if (IsBusy) { return; } IsBusy = true; try { var connected = RegistrationPage.HasConnection(); if (connected) { mobackUser mu = new mobackUser(ApplicationKeyId: "YTRkZDRjZTUtMDVhMi00NTZkLWFhMjUtMWRlNTc1YzFlYmIx", DevelopmentKey: "YTVlZDE3NWQtZGZmMS00MmE2LWJiODMtYTIxOTZlMTViZjA2", baseurl: "https://api.moback.com"); mobackClient mc = new mobackClient(ApplicationKeyId: "YTRkZDRjZTUtMDVhMi00NTZkLWFhMjUtMWRlNTc1YzFlYmIx", DevelopmentKey: "YTVlZDE3NWQtZGZmMS00MmE2LWJiODMtYTIxOTZlMTViZjA2", baseurl: "https://api.moback.com"); appUSer appuser = new appUSer(); Collection<Item> favorites = new Collection<Item>(); appuser["Favorites"] = favorites; appuser.password = pass; appuser.email = email; try { var result = mu.Signup(appuser); var sessionToken = mu.Login(appuser); var fPage = new FirstPage(); await Navigation.PushModalAsync(fPage); } catch(Exception ex) { Console.Error.WriteLine(@"Error{0}", ex.Message); } } else { this.Content = new Label() { Text = "Нет подключения к интернету", Font = Font.SystemFontOfSize(40), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; } } catch (Exception ex) { /* Navigation.PushAsync (new NavigationPage(new ContentPage { Title = "Error", Content = new Label { Text = ex.Message, Font = Font.SystemFontOfSize(40), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center } })); */ Console.Error.WriteLine(@"Error{0}", ex.Message); } }