void OnbtnChangePassClicked(object sender, EventArgs e) { ServiceManager sm = new ServiceManager(); var m = new UserMethods(); if (g.usernameEntry.Text == "" || g.passwordEntry.Text == "") { this.DisplayAlert("User Name Error", "Please Enter your POSDA account name", "OK"); } else { g = m.dbCheckUser(g).Result; //var signResult = m.SignInOut(g, 0).Result; if (g.signIn) { ChangePassPage cp = new ChangePassPage(g); g.mdp.Detail.Navigation.PushAsync(cp); } //else //{ // await parentpage.DisplayAlert("Error", "Failed Sign In", "OK"); //} } }
public async Task <GlobalDegisken> SignIn(GlobalDegisken glb) { g = glb; ServiceManager sm = new ServiceManager(); var m = new Methodlar(); g = await sm.signIn(g); if (g.signIn) { g = glb; //g.usernameEntry.Text = g.user.user; //g.passwordEntry.Text = g.user.pass; //g.custEntry.Text = g.user.cust; //g.cpssEntry.Text = g.user.cpss; //g.rememberSwt.On = g.user.remember; //g.savepassSwt.On = g.user.save; //g.signIn = true; g.mainButton.Text = ""; g.btnLogin.Text = "SIGN OUT ( " + g.user.user + " )";; g.btnLogin.BackgroundColor = Color.Red; } else { g.mainButton.Text = "Start To tyr!"; g.btnLogin.Text = "SIGN IN"; g.btnLogin.BackgroundColor = Color.Orange; } return(g); }
public MainListPage(GlobalDegisken glb) { g = glb; var mth = new Methodlar(); Title = ""; StackLayout layout = new StackLayout(); if (g.signIn) { }else { g.mainButton.Text = "Start To tyr!"; g.mainButton.Clicked += OnButtonClicked; } layout.Children.Add(mth.mainList(this,g)); layout.Children.Add(g.mainButton); Content = layout; }
public MenuPage(GlobalDegisken glb) { g = glb; g.menup = this; Content = menuLayout().Result; }
public async Task <GlobalDegisken> dbCheckUser(GlobalDegisken glb) { g = glb; SQLiteManager sqlm = new SQLiteManager(); g.user = sqlm.GetFirst(); if (g.user != null) { if (g.user.remember) { g.usernameEntry.Text = g.user.user; g.custEntry.Text = g.user.cust; g.rememberSwt.On = g.user.remember; g.savepassSwt.On = g.user.save; if (g.user.save) { g.passwordEntry.Text = g.user.pass; g.cpssEntry.Text = g.user.cpss; } else { g.passwordEntry.Text = ""; g.cpssEntry.Text = ""; } g.checkDbUser = true; } else { g.usernameEntry.Text = ""; g.custEntry.Text = ""; g.rememberSwt.On = true; g.savepassSwt.On = false; g.passwordEntry.Text = ""; g.cpssEntry.Text = ""; g.checkDbUser = false; } } else { if (g.user == null) { g.user = new posdaUser(); } } return(g); }
public void callPage(GlobalDegisken glb, ContentPage page) { g = glb; g.prevp = g.activep; if (g.mdp.IsPresented) { glb.mdp.IsPresented = false; } g.activep.Navigation.PushAsync(page); g.activep = page; }
public DashPage(GlobalDegisken glb, StackLayout layout, string title) { Title = title; g = glb; ScrollView scroll = new ScrollView(); //scroll.BackgroundColor = Color.White; scroll.Content = layout; if (title == "ONLINE REPORTING") { this.ToolbarItems.Add(new ToolbarItem { Text = "Dun", Order = ToolbarItemOrder.Secondary }); this.ToolbarItems.Add(new ToolbarItem { Text = "Guncel", Order = ToolbarItemOrder.Secondary }); this.ToolbarItems.Add(new ToolbarItem { Text = "Gecen Hafta", Order = ToolbarItemOrder.Secondary }); this.ToolbarItems.Add(new ToolbarItem { Text = "Hafta", Order = ToolbarItemOrder.Secondary }); this.ToolbarItems.Add(new ToolbarItem { Text = "Gecen Ay", Order = ToolbarItemOrder.Secondary }); this.ToolbarItems.Add(new ToolbarItem { Text = "Ay", Order = ToolbarItemOrder.Secondary }); foreach (ToolbarItem my in this.ToolbarItems) { my.Activated += onActivateTb; } } else { this.ToolbarItems.Clear(); } Content = scroll; }
public StackLayout changePassView(GlobalDegisken glb, ContentPage p) { g = glb; parentpage = p; StackLayout lyt = new StackLayout(); lyt.Padding = new Thickness(5, 30, 5, 5); lyt.Spacing = 3; lyt.BackgroundColor = Color.White; Label lbl = new Label(); lbl.Text = g.usernameEntry.Text; lbl.HorizontalOptions = LayoutOptions.Center; lbl.VerticalOptions = LayoutOptions.Center; Button btn = new Button(); btn.Text = "Change Password"; btn.BackgroundColor = Color.Orange; btn.Clicked += OnChangePasswordClicked; btn.HorizontalOptions = LayoutOptions.FillAndExpand; btn.VerticalOptions = LayoutOptions.End; Image loginImg = new Image(); loginImg.WidthRequest = 100; loginImg.HeightRequest = 100; loginImg.HorizontalOptions = LayoutOptions.Center; loginImg.VerticalOptions = LayoutOptions.Center; loginImg.Source = ImageSource.FromFile("lock.png"); lyt.Children.Add(loginImg); lyt.Children.Add(lbl); lyt.Children.Add(g.oldpassEntry); lyt.Children.Add(g.newpassEntry); lyt.Children.Add(g.renewpassEntry); lyt.Children.Add(btn); return(lyt); }
public async Task <int> SignOut(GlobalDegisken glb) { g.user = null; g.usernameEntry.Text = ""; g.passwordEntry.Text = ""; g.custEntry.Text = ""; g.cpssEntry.Text = ""; g.rememberSwt.On = true; g.savepassSwt.On = false; g.signIn = false; g.mainButton.Text = "Start To Try!"; g.btnLogin.Text = "SIGN IN"; g.btnLogin.BackgroundColor = Color.Orange; g.loginImg.Source = ImageSource.FromFile("login2.jpg"); g.user = null; //await Task.Delay(3000); return(1); }
public WelcomePage(GlobalDegisken glb) { Padding = new Thickness(0, Device.OS == TargetPlatform.iOS ? 20 : 0, 0, 0); g = glb; if (g.signIn) { startInPage(); } else { if (g.checkDbUser) { } else { } startOutPage(); } }
public async Task <GlobalDegisken> signIn(GlobalDegisken g) { List <MyData> sonuc = await AuthControl(g.user.user, g.user.pass, g.user.udid, g.user.cust, g.user.cpss); if (sonuc[0].Val1.ToString() == "0") { g.signIn = true; g.user.sesid = sonuc[0].Val3.ToString(); } else { if (sonuc[0].Val4 == null && g.user.udid != null) { g.user.udid = null; } else { g.user.udid = sonuc[0].Val4.ToString(); } g.signIn = false; } return(g); }
public ChangePassPage(GlobalDegisken glb) { var mth = new Methodlar(); Content = mth.changePassView(glb, this); }
public TableView mainList(ContentPage p, GlobalDegisken glb) { parentpage = p; g = glb; TableView tableView = new TableView(); tableView.Intent = TableIntent.Menu; tableView.BackgroundColor = Color.White; tableView.RowHeight = 1; tableView.HasUnevenRows = true; TableRoot root = new TableRoot(); TableSection section = new TableSection(); section.Title = ""; ImageCell cell1 = new ImageCell(); cell1.Text = "ONLINE REPORTING"; cell1.Detail = "Classic Posda"; cell1.ImageSource = ImageSource.FromFile("linearrow.png"); cell1.TextColor = Color.Black; cell1.DetailColor = Color.Default; cell1.Height = 80; ImageCell cell2 = new ImageCell(); cell2.Text = "LOCATION ANALYSIS"; cell2.Detail = "Store, Mall Analysis"; cell2.ImageSource = ImageSource.FromFile("gauge2.png"); cell2.TextColor = Color.Black; cell2.DetailColor = Color.Default; cell2.Height = 80; ImageCell cell3 = new ImageCell(); cell3.Text = "PRODUCT REPORTS"; cell3.Detail = "Segment and MainGroup Reports"; cell3.ImageSource = ImageSource.FromFile("bar.png"); cell3.TextColor = Color.Black; cell3.DetailColor = Color.Default; cell3.Height = 80; ImageCell cell4 = new ImageCell(); cell4.Text = "COMPARISON"; cell4.Detail = "You and Others"; cell4.ImageSource = ImageSource.FromFile("list.png"); cell4.TextColor = Color.Black; cell4.DetailColor = Color.Default; cell4.Height = 80; //cell1.Tapped += mainCell_Tapped; //cell2.Tapped += mainCell_Tapped; //cell3.Tapped += mainCell_Tapped; //cell4.Tapped += mainCell_Tapped; TextCell text1 = new TextCell(); text1.Text = "Online Reporting"; text1.TextColor = Color.Gray; text1.Height = 25; TextCell text2 = new TextCell(); text2.Text = "Analysis"; text2.TextColor = Color.Gray; text2.Height = 25; section.Add(text1); section.Add(cell1); section.Add(text2); section.Add(cell2); section.Add(cell3); section.Add(cell4); root.Add(section); tableView.Root = root; return(tableView); }
public LoginPage(GlobalDegisken glb) { g = glb; Padding = new Thickness(0, Device.OS == TargetPlatform.iOS ? 20 : 0, 0, 0); Content = loginView(); }
async void OnLoginClicked(object sender, EventArgs e) { var m = new UserMethods(); var mth = new Methodlar(); SQLiteManager sqlm = new SQLiteManager(); ContentPage p = new ContentPage(); if (g.usernameEntry.Text == "" || g.usernameEntry.Text == null || g.passwordEntry.Text == "" || g.passwordEntry.Text == null) { await this.DisplayAlert("Info Error", "Please enter POSDA account or Password", "OK"); } else { try { p = mth.showProgress("Sign In POSDA...", this); g.user.user = g.usernameEntry.Text; g.user.pass = g.passwordEntry.Text; g.user.cust = g.custEntry.Text; g.user.cpss = g.cpssEntry.Text; g.user.remember = g.rememberSwt.On; g.user.save = g.savepassSwt.On; if (g.user.udid == null) { g.user.udid = "-1"; } g = await m.SignIn(g); //if (g.signIn) //{ if (g.rememberSwt.On) { g.user.remember = true; if (g.savepassSwt.On) { g.user.save = true; } else { g.user.save = false; g.user.pass = null; g.user.cpss = null; } sqlm.DeleteAll(); sqlm.Insert(g.user); } else { g.user.remember = false; //g.user.user = null; g.user.pass = null; g.user.cust = null; g.user.cpss = null; g.user.remember = false; if (g.savepassSwt.On) { g.user.save = true; } else { g.user.save = false; } sqlm.DeleteAll(); sqlm.Insert(g.user); }; //} if (!g.signIn) { mth.hideProgress(p); await this.DisplayAlert("Info Error", "SignIn Fail", "OK"); } else { mth.hideProgress(p); WelcomePage welcomep = new WelcomePage(g); NavigationPage np = new NavigationPage(welcomep); g.mdp.Detail = np; //await g.mdp.Detail.Navigation.PushModalAsync(welcomep); await Navigation.PopToRootAsync(); //mth.callPage(g, welcomep); } } catch (Exception) { mth.hideProgress(p); throw; } } }