Example #1
0
        public int SaveTempData(temperatuerData objTempData)
        {
            int status = 0;

            try
            {
                database.DeleteAll <temperatuerData>();
                status = database.Insert(objTempData);
            }
            catch (Exception ex)
            {
                status = 0;
            }
            return(status);
        }
Example #2
0
        public bool GetTempData(out temperatuerData tempData)
        {
            tempData = new temperatuerData();
            bool isLogin = false;

            try
            {
                tempData = database.Table <temperatuerData>().First();
                if (tempData != null)
                {
                    isLogin = true;
                }
            }
            catch (Exception ex)
            {
                isLogin = false;
            }
            return(isLogin);
        }
        public HomePage()
        {
            InitializeComponent();

            if (Device.RuntimePlatform == Device.iOS)
            {
                //weatherGridcolumZero.Width = GridLength.Auto;

                //weatherGridcolumlast.Width = GridLength.Auto;

                InstragramTxt.Text = "See Us On Insta";

                FbText.Text = "Like Us On fb";

                settingImg.HeightRequest = 50;

                settingImg.WidthRequest = 50;
            }

            else
            {
                weatherGridcolumZero.Width = 50;

                weatherGridcolumlast.Width = 50;

                InstragramTxt.Text = "See Us On Instagram";
            }


            loggedInUser user = new loggedInUser();

            if (App.Database.GetLoginUser(out user))
            {
                LoginDetails.userId = user.userId;

                TotalNoOfCoffee = user.TotalCoffeeCups;

                loggedUserName.Text = user.UserName;

                registeredOnWhichDate.Text = user.UserCreateDate;


                barCodeImage.Source = user.BarcodeImageUrl;



                passwordText.Text = Convert.ToString(user.WifiInfo);
            }

            temperatuerData tempData = new temperatuerData();

            if (App.Database.GetTempData(out tempData))
            {
                // lblTemp.Text = tempData.temprature+""+tempData.tempUnit;

                //  imgWeather.Source = tempData.weatherImgDB;
            }

            NavigationPage.SetHasNavigationBar(this, false);

            this.BackgroundImage = "ic_bg.png";

            var width = App.ScreenWidth;

            if (width < 350)
            {
                FbText.FontSize        = 13;
                InstragramTxt.FontSize = 13;
            }

            this.Opacity = 0.9;



            BindingContext = new HomePageViewModel(this);
            // UpdateControls();

            string url = "http://www.yr.no/place/Norway/M%C3%B8re_og_Romsdal/%C3%85lesund/%C3%85lesund/forecast_hour_by_hour.xml";

            GetXML(url);
        }
Example #4
0
        public SignUp(string fbLink, string instaLink)
        {
            InitializeComponent();



            Title = "Sign Up";

            this.BackgroundImage = "ic_bg.png";


            if (Device.RuntimePlatform == Device.iOS)
            {
                //weatherGridcolumZero.Width = GridLength.Auto;

                //weatherGridcolumlast.Width = GridLength.Auto;

                FirstName.PlaceholderColor = Color.Black;

                LastName.PlaceholderColor = Color.Black;

                Email.PlaceholderColor = Color.Black;

                Password.PlaceholderColor = Color.Black;

                UserName.PlaceholderColor = Color.Black;

                settingImg.HeightRequest = 50;

                settingImg.WidthRequest = 50;

                InstragramTxt.Text = "See Us On Insta";

                FbText.Text = "Like Us On fb";
            }

            else
            {
                weatherGridcolumZero.Width = 50;

                weatherGridcolumlast.Width = 50;

                InstragramTxt.Text = "See Us On Instagram";
            }

            var width = App.ScreenWidth;

            if (width < 350)
            {
                FbText.FontSize        = 13;
                InstragramTxt.FontSize = 13;
            }

            this.Opacity = 0.9;

            FirstName.Text = string.Empty;

            LastName.Text = string.Empty;

            UserName.Text = string.Empty;

            Email.Text = string.Empty;

            Password.Text = string.Empty;

            FbLink    = fbLink;
            InstaLink = instaLink;


            temperatuerData tempData = new temperatuerData();

            if (App.Database.GetTempData(out tempData))
            {
                lblTempValue.Text = tempData.temprature;
                //lblTempUnit.Text = " " + tempData.tempUnit;

                imgWeather.Source = tempData.weatherImgDB;
            }
        }