Пример #1
0
        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;

        }
Пример #2
0
        void OnButtonClicked(object sender, EventArgs e)
        {
            var mth = new Methodlar();


            if (g.signIn)
            {
            }
            else
            {
                if (g.checkDbUser)
                {
                    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;
                }


                LoginPage loginp = new LoginPage(g);
                g.mdp.Detail.Navigation.PushAsync(loginp);
            }
        }
Пример #3
0
        public App()
        {
            var mth = new Methodlar();

            MainPage = new MasterDetail();
            //mth.newMasterDetail();//
        }
Пример #4
0
        public MasterDetail()
        {
            var glb = new POSDA.GlobalVar.GlobalDegisken();
            var mth = new Methodlar();
            var um  = new UserMethods();

            glb.mdp         = this;
            glb.datePeriod  = 2;
            glb.signIn      = false;
            glb.checkDbUser = false;


            try
            {
                glb = um.dbCheckUser(glb).Result;

                if (glb.checkDbUser)
                {
                    if (glb.user.save)
                    {
                        glb = um.SignIn(glb).Result;

                        if (glb.signIn)
                        {
                        }
                        else
                        {
                            int i = um.SignOut(glb).Result;
                        }
                    }
                }
                else
                {
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Master = new MenuPage(glb)
                {
                    Title           = " ",
                    Padding         = new Thickness(0, Device.OS == TargetPlatform.iOS ? 20 : 0, 0, 0),
                    BackgroundColor = Color.Aqua
                };
                WelcomePage wp = new WelcomePage(glb);
                glb.activep = wp;
                glb.prevp   = null;
                Detail      = new NavigationPage(wp)
                {
                    BarBackgroundColor = Color.Aqua,
                    BarTextColor       = Color.Black,
                    Padding            = new Thickness(5, Device.OS == TargetPlatform.iOS ? 20 : 0, 5, 5),
                };
            }
        }
Пример #5
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");
            }
        }
Пример #6
0
        public async Task <StackLayout> menuLayout()
        {
            var mth = new Methodlar();

            StackLayout layout = new StackLayout();

            layout.Padding           = new Thickness(5, Device.OS == TargetPlatform.iOS ? 20 : 5, 5, 5);
            layout.BackgroundColor   = Color.Black;
            layout.Spacing           = 3;
            layout.VerticalOptions   = LayoutOptions.Fill;
            layout.HorizontalOptions = LayoutOptions.Fill;

            g.btnLogin.Text            = "SIGN IN";
            g.btnLogin.BackgroundColor = Color.Orange;
            g.loginImg.Source          = ImageSource.FromFile("login2.jpg");

            g.btnLogin.Clicked += OnbtnLoginClicked;

            Button btnExit = new Button();

            btnExit.Text              = "CLOSE";
            btnExit.Clicked          += OnbtnExitClicked;
            btnExit.BackgroundColor   = Color.Red;
            btnExit.HorizontalOptions = LayoutOptions.FillAndExpand;
            btnExit.VerticalOptions   = LayoutOptions.End;

            StackLayout layoutMiddle = new StackLayout();

            layoutMiddle.HorizontalOptions = LayoutOptions.FillAndExpand;
            layoutMiddle.VerticalOptions   = LayoutOptions.FillAndExpand;
            layoutMiddle.Children.Add(menuList());

            layout.Children.Add(g.loginImg);
            layout.Children.Add(g.btnLogin);
            layout.Children.Add(layoutMiddle);
            layout.Children.Add(btnExit);

            return(layout);
        }
Пример #7
0
        async void OnButtonClicked(object sender, EventArgs e)
        {
            if (g.signIn)
            {

            }
            else
            {
                

                var mth = new Methodlar();
                var um = new UserMethods();

                await um.dbCheckUser(g);

                LoginPage loginp = new LoginPage(g);

                mth.callPage(g, loginp);
            }



        }
Пример #8
0
        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);
        }
Пример #9
0
        public ChangePassPage(GlobalDegisken glb)
        {
            var mth = new Methodlar();

            Content = mth.changePassView(glb, this);
        }
Пример #10
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;
                }
            }
        }