Beispiel #1
0
        private async void Cell_Tapped(object sender, EventArgs e)
        {
            var         mth = new Methodlar();
            ContentPage p   = new ContentPage();

            if (g.signIn)
            {
                ImageCell cell = new ImageCell();
                cell = (ImageCell)sender;

                if (cell.Text == "ONLINE REPORTING")
                {
                    ServiceManager sm  = new ServiceManager();
                    StackLayout    lyt = new StackLayout();
                    lyt.BackgroundColor = Color.White;


                    p = mth.showProgress("Get Report List...", this);
                    try
                    {
                        List <MyData> sonuc = await sm.MenuList(g.user.sesid, "menu");

                        lyt = await mth.orMenuList(sonuc);
                    }
                    catch (Exception)
                    {
                        mth.hideProgress(p);

                        throw;
                    }
                    finally
                    {
                        mth.hideProgress(p);

                        DashPage dsh = new DashPage(g, lyt, cell.Text);

                        await this.Navigation.PushModalAsync(dsh);
                    }
                }
            }
            else
            {
                await this.DisplayAlert("Fail", "Sign in failed", "OK");
            }
        }
        public async void startInPage()
        {
            StackLayout layout = new StackLayout();
            var         mth    = new Methodlar();


            ContentPage p = new ContentPage();

            p = mth.showProgress("Get Report Data...", this);


            Grid grid = new Grid
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                ColumnSpacing     = 10,
                RowSpacing        = 10,
                RowDefinitions    =
                {
                    new RowDefinition {
                        Height = 75
                    },                                //GridLength.Auto
                    new RowDefinition {
                        Height = 200
                    },
                    new RowDefinition {
                        Height = 20
                    },
                    //new RowDefinition { Height = new GridLength(1, GridUnitType.Star) },
                    //new RowDefinition { Height = new GridLength(100, GridUnitType.Absolute) }
                },
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = GridLength.Star
                    },
                    new ColumnDefinition {
                        Width = GridLength.Star
                    },
                    //new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) },
                    //new ColumnDefinition { Width = new GridLength(100, GridUnitType.Absolute) }
                }
            };

            List <MyData> myData = new List <MyData>();


            try
            {
                ServiceManager sm = new ServiceManager();
                myData = await sm.GetReport(g.user.sesid, "101", "", "2");
            }
            catch (Exception)
            {
                mth.hideProgress(p);
                throw;
            }
            finally
            {
                grid.Children.Add(await mth.dsh_Label(myData[myData.Count() - 1].Val1, myData[myData.Count() - 1].Val1, myData[myData.Count() - 1].Val2, ""), 0, 2, 0, 1);

                grid.Children.Add(await mth.dsh_Line("Haftalık Satışlar", "WEEKLY QUANTITY"), 0, 2, 1, 3);

                grid.Children.Add(await mth.dsh_Text("http://www.peraport.net"), 0, 2, 3, 4);
            }



            layout.Children.Add(new ScrollView {
                Content = grid
            });
            layout.Children.Add(g.mainButton);


            this.Content = layout;


            //Navigation.InsertPageBefore(this, Navigation.NavigationStack.First());
            //await Navigation.PopToRootAsync(true);

            mth.hideProgress(p);
        }
Beispiel #3
0
        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;
                }
            }
        }