Ejemplo n.º 1
0
        public void LoggedInStatusCheck()
        {
            UserData _userdata = AppStatics.LoadIsolatedData();

            if (_userdata == null)
            {
                imgUser.HeightRequest            = 0;
                lblUserName.HeightRequest        = 0;
                lblUserNameEmailId.HeightRequest = 0;
                lblLogIn_Out.Text = AppResources.AppResources.MLogin;
            }
            else
            {
                if (string.IsNullOrEmpty(lblUserNameEmailId.Text))
                {
                    imgUser.Source          = _userdata.avatar;
                    lblUserName.Text        = _userdata.first_name + " " + _userdata.last_name;
                    lblUserNameEmailId.Text = _userdata.email;
                    imgUser.HeightRequest   = 90;
                    if (string.IsNullOrEmpty(_userdata.first_name) && string.IsNullOrEmpty(_userdata.last_name))
                    {
                        lblUserName.HeightRequest = 0;
                    }
                    else
                    {
                        lblUserName.HeightRequest = -1;
                    }
                    lblUserNameEmailId.HeightRequest = -1;
                    lblLogIn_Out.Text = AppResources.AppResources.MLogout;
                }
            }
        }
Ejemplo n.º 2
0
        public async Task CallWebserviceAboutUs()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    RootObjectAboutUs response = await CallWebservice.GetResponse_Get <RootObjectAboutUs>(WebServiceURL.Url_AboutUs);

                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            DetailData              = response;
                            imgHeader.Source        = response.is_image;
                            lblTourDescription.Text = response.content;
                            lblTourName.Text        = AppResources.AppResources.LAbt_Vadodara_By_Foot;
                            ContentLayout.IsVisible = true;
                        }
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
            AppStatics.Loading(loading, false);
        }
Ejemplo n.º 3
0
        public void SetFontSizeControls()
        {
            lblName.FontSize        = AppStatics.GetFontSizeMedium();
            lblEmail.FontSize       = AppStatics.GetFontSizeMedium();
            lblMobNum.FontSize      = AppStatics.GetFontSizeMedium();
            lblPass.FontSize        = AppStatics.GetFontSizeMedium();
            lblConfirmPass.FontSize = AppStatics.GetFontSizeMedium();
            lblFirstName.FontSize   = AppStatics.GetFontSizeMedium();
            lblLastName.FontSize    = AppStatics.GetFontSizeMedium();

            txtbxName.FontSize        = AppStatics.GetFontSizeMedium();
            txtbxEmail.FontSize       = AppStatics.GetFontSizeMedium();
            txtbxMobNum.FontSize      = AppStatics.GetFontSizeMedium();
            txtbxPass.FontSize        = AppStatics.GetFontSizeMedium();
            txtbxConfirmPass.FontSize = AppStatics.GetFontSizeMedium();
            txtbxFirstName.FontSize   = AppStatics.GetFontSizeMedium();
            txtbxLastName.FontSize    = AppStatics.GetFontSizeMedium();

            lblLogin.FontSize            = AppStatics.GetFontSizeSmall();
            lblAlreadyHaveAccnt.FontSize = AppStatics.GetFontSizeSmall();

            lblAgreeTermCondition.FontSize     = AppStatics.GetFontSizeSmall();
            lblAgreeTermConditionLink.FontSize = AppStatics.GetFontSizeSmall();

            btnRegistration.FontSize = AppStatics.GetFontSizeMedium();
        }
 public async void Search_Clicked(object sender, System.EventArgs e)
 {
     if (AppStatics.CheckInternetConnection())
     {
         if (TbSearch.Icon.File == "top_search_icon.png")
         {
             SearchhStack.HeightRequest = 45;
             SearchhStack.IsVisible     = true;
             TbSearch.Icon = "menu_drawer_close_icon.png";
         }
         else
         {
             SearchhStack.HeightRequest = 0;
             SearchhStack.IsVisible     = false;
             TbSearch.Icon           = "top_search_icon.png";
             lstWalkTour.ItemsSource = _walktourList;
             txtbxSearch.Text        = "";
             lblNoRecord.IsVisible   = false;
             DependencyService.Get <VadodaraByFoot.Interface.IDissmissKeyboard>().DismissKeyboard();
             //txtbxSearch.Unfocus();
         }
     }
     else
     {
         AppStatics.Loading(loading, false);
         await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
     }
 }
Ejemplo n.º 5
0
        public async void OnLoginLogoutTap(object sender, System.EventArgs e)
        {
            IsPresented = false;
            UserData _userdata = AppStatics.LoadIsolatedData();

            if (_userdata == null)
            {
                var stack = Detail.Navigation.NavigationStack;
                if (stack[stack.Count - 1].GetType() != typeof(VadodaraByFoot.View.LoginModule.LoginPage))
                {
                    Page displayPage = new VadodaraByFoot.View.LoginModule.LoginPage();
                    await Detail.Navigation.PushAsync(displayPage);
                }
            }
            else
            {
                AppStatics.ClearIsolatedData();
                imgUser.Source                   = null;
                imgUser.HeightRequest            = 0;
                lblUserName.HeightRequest        = 0;
                lblUserNameEmailId.HeightRequest = 0;
                lblUserName.Text                 = null;
                lblUserNameEmailId.Text          = null;
                await DisplayAlert(AppResources.AppResources.LMessage, AppResources.AppResources.LLogoutSucessful, AppResources.AppResources.LOk);
            }
        }
 protected override PageContent getContent() =>
 new UiPageContent(
     pageActions: AppTools.User != null && articleRow.AuthorId == AppTools.User.UserId
                                                      ? new HyperlinkSetup(
         Editor.GetInfo(ArticleId),
         "Edit Article",
         icon: new ActionComponentIcon(new FontAwesomeIcon("fa-pencil")))
     .Append <ActionComponentSetup>(
         new ButtonSetup(
             "Delete Article",
             behavior: new PostBackBehavior(
                 postBack: PostBack.CreateFull(
                     id: "delete",
                     modificationMethod: () => {
     ArticleTagsModification.DeleteRows(new ArticleTagsTableEqualityConditions.ArticleId(ArticleId));
     ArticlesModification.DeleteRows(new ArticlesTableEqualityConditions.ArticleId(ArticleId));
 },
                     actionGetter: () => new PostBackAction(Home.GetInfo()))),
             icon: new ActionComponentIcon(new FontAwesomeIcon("fa-trash"))))
     .Materialize()
                                                      : AppStatics.GetFollowAction(articleRow.AuthorId).Append(getFavoriteAction()).Materialize())
 .Add(AppStatics.GetAuthorDisplay(articleRow, UsersTableRetrieval.GetRowMatchingId(articleRow.AuthorId)))
 .Add(new HtmlBlockContainer(Markdown.ToHtml(articleRow.BodyMarkdown)))
 .Add(AppStatics.GetTagDisplay(ArticleId, ArticleTagsTableRetrieval.GetRowsLinkedToArticle(ArticleId)))
 .Add(getCommentComponents());
Ejemplo n.º 7
0
        private FlowComponent getResultTable()
        {
            var results              = ShowFavorites ? ArticlesRetrieval.GetRowsLinkedToUser(UserId) : ArticlesRetrieval.GetRowsLinkedToAuthor(UserId);
            var usersById            = UsersTableRetrieval.GetRows().ToIdDictionary();
            var tagsByArticleId      = ArticleTagsTableRetrieval.GetRows().ToArticleIdLookup();
            var favoritesByArticleId = FavoritesTableRetrieval.GetRows().ToArticleIdLookup();

            var table = EwfTable.Create(defaultItemLimit: DataRowLimit.Fifty);

            table.AddData(results, i => EwfTableItem.Create(AppStatics.GetArticleDisplay(i, usersById, tagsByArticleId, favoritesByArticleId).ToCell()));
            return(table);
        }
Ejemplo n.º 8
0
        private FlowComponent getResultTable(string filter)
        {
            var results = filter == "user" && AppTools.User != null?ArticlesRetrieval.GetRowsLinkedToFollower(AppTools.User.UserId) :
                              filter.StartsWith("tag") ? ArticlesRetrieval.GetRowsLinkedToTag(int.Parse(filter.Substring(3))) :
                              ArticlesRetrieval.GetRowsOrderedByCreation();

            var usersById            = UsersTableRetrieval.GetRows().ToIdDictionary();
            var tagsByArticleId      = ArticleTagsTableRetrieval.GetRows().ToArticleIdLookup();
            var favoritesByArticleId = FavoritesTableRetrieval.GetRows().ToArticleIdLookup();

            var table = EwfTable.Create(defaultItemLimit: DataRowLimit.Fifty);

            table.AddData(results, i => EwfTableItem.Create(AppStatics.GetArticleDisplay(i, usersById, tagsByArticleId, favoritesByArticleId).ToCell()));
            return(table);
        }
Ejemplo n.º 9
0
        public void SetFontSizeControls()
        {
            lblFullName.FontSize = AppStatics.GetFontSizeMedium();
            lblEmail.FontSize    = AppStatics.GetFontSizeMedium();
            lblSubject.FontSize  = AppStatics.GetFontSizeMedium();
            lblMessage.FontSize  = AppStatics.GetFontSizeMedium();

            txtbxFullName.FontSize      = AppStatics.GetFontSizeMedium();
            txtbxEmail.FontSize         = AppStatics.GetFontSizeMedium();
            txtbxSubject.FontSize       = AppStatics.GetFontSizeMedium();
            txtbxMessage.FontSize       = AppStatics.GetFontSizeMedium();
            MessageTextOverlap.FontSize = AppStatics.GetFontSizeMedium();

            btnSubmit.FontSize = AppStatics.GetFontSizeMedium();
            lblFeedBackDescription.FontSize = AppStatics.GetFontSizeSmall();
        }
Ejemplo n.º 10
0
        public async Task CallWebserviceFAQ()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    RootObjectFAQ response = await CallWebservice.GetResponse_Get <RootObjectFAQ>(WebServiceURL.Url_FAQ);

                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            for (int i = 0; i < response.faqlist.Count; i++)
                            {
                                var objFAQ = new Faqlist();
                                objFAQ.TapId           = i.ToString();
                                objFAQ.expand_collapse = "faq_plus.png";
                                objFAQ.ObjIsVisible    = false;
                                objFAQ.title           = response.faqlist[i].title;
                                objFAQ.content         = response.faqlist[i].content;
                                objFAQ.TitleFontSize   = AppStatics.GetFontSizeMedium();
                                objFAQ.DetailFontSize  = AppStatics.GetFontSizeSmall();
                                ListFAQ.Add(objFAQ);
                            }
                            lstFAQ.ItemsSource = ListFAQ;
                            AppStatics.Loading(loading, false);
                        }
                    }
                    else
                    {
                        AppStatics.Loading(loading, false);
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Ejemplo n.º 11
0
        public async System.Threading.Tasks.Task CallWebserviceFeedback()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("your-name", txtbxFullName.Text));
                    values.Add(new KeyValuePair <string, string>("your-email", txtbxEmail.Text));
                    values.Add(new KeyValuePair <string, string>("your-subject", txtbxSubject.Text));
                    values.Add(new KeyValuePair <string, string>("your-message", txtbxMessage.Text));
                    values.Add(new KeyValuePair <string, string>("mobile-no", "9898898989"));
                    var response = await CallWebservice.GetResponse_Post <RootObjectFeedback>(WebServiceURL.Url_Feedback, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);

                        if (response._resultflag == "1")
                        {
                            txtbxFullName.Text = "";
                            txtbxEmail.Text    = "";
                            txtbxSubject.Text  = "";
                            txtbxMessage.Text  = "";
                        }
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
        public async Task CallWebserviceWalkTourList()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    RootObjectWalkTourList response = await CallWebservice.GetResponse_Get <RootObjectWalkTourList>(WebServiceURL.Url_walktourlst);

                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            foreach (var tourobj in response.Walktour)
                            {
                                tourobj.TitleFontSize = AppStatics.GetFontSizeMedium();
                            }
                            lstWalkTour.ItemsSource = response.Walktour;
                            _walktourList           = response.Walktour;
                            AppStatics.Loading(loading, false);
                            foreach (var objwalktour in response.Walktour)
                            {
                                objwalktour.title              = objwalktour.title.ToUpper();
                                objwalktour.EndColorGradient   = new Xamarin.Forms.Color(0, 0, 0, 0.8);
                                objwalktour.StartColorGradient = Xamarin.Forms.Color.Transparent;
                            }
                        }
                    }
                    else
                    {
                        AppStatics.Loading(loading, false);
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Ejemplo n.º 13
0
        public async Task CallWebserviceWalkTourDetail()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    RootObjectWalkTourDetail response = await CallWebservice.GetResponse_Get <RootObjectWalkTourDetail>(WebServiceURL.Url_walktourdetail + _tourId);

                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            DetailData = response;
                            lblTourDescription.Text = response.Walktourdetail.excerpt;
                            lblTourName.Text        = response.Walktourdetail.title.ToUpper();

                            #region
                            await CallMapDataPoints();

                            #endregion

                            /*   AppStatics.Loading(loading, false);
                             * ContentLayout.IsVisible = true;
                             * imgPlaceDetail.IsVisible = true;*/
                        }
                    }
                    else
                    {
                        AppStatics.Loading(loading, false);
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Ejemplo n.º 14
0
        public void SetFontSizeControls()
        {
            lblFullName.FontSize = AppStatics.GetFontSizeMedium();
            lblEmail.FontSize    = AppStatics.GetFontSizeMedium();
            lblSubject.FontSize  = AppStatics.GetFontSizeMedium();
            lblMessage.FontSize  = AppStatics.GetFontSizeMedium();

            lblOfficeName.FontSize        = AppStatics.GetFontSizeTitle();
            lblOfficeAddress.FontSize     = AppStatics.GetFontSizeMedium();
            lblOfficeEmail.FontSize       = AppStatics.GetFontSizeMedium();
            lblOfficePhoneNumber.FontSize = AppStatics.GetFontSizeMedium();

            txtbxFullName.FontSize      = AppStatics.GetFontSizeMedium();
            txtbxEmail.FontSize         = AppStatics.GetFontSizeMedium();
            txtbxSubject.FontSize       = AppStatics.GetFontSizeMedium();
            txtbxMessage.FontSize       = AppStatics.GetFontSizeMedium();
            MessageTextOverlap.FontSize = AppStatics.GetFontSizeMedium();

            btnSubmit.FontSize = AppStatics.GetFontSizeMedium();
        }
        public void routeCoversListBindData(int PlaceSelectedIndex)
        {
            int plcenumber = 1;

            for (int i = 0; i < _routeCovers.Count; i++)
            {
                _routeCovers[i].placeNumberRing      = "route_scroller_nor.png";
                _routeCovers[i].placeNumberTitle     = plcenumber.ToString();
                _routeCovers[i].SeparatorWidth       = 35;
                _routeCovers[i].NumberFontSize       = AppStatics.GetFontSizeMedium();
                _routeCovers[i].SpacingBetweenNumber = 0;
                plcenumber++;
            }
            _routeCovers[PlaceSelectedIndex].placeNumberRing    = "route_scroller_sel.png";
            _routeCovers[_routeCovers.Count - 1].SeparatorWidth = 0;
            //  lstPlaceNumber.ItemsSource = null;
            lstPlaceNumber.ItemsSource = _routeCovers;

            lstPlaceNumber.Render();
            designchanges();
        }
Ejemplo n.º 16
0
        public async System.Threading.Tasks.Task CallWebserviceForgotPassUser()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("user_login", txtbxForgotPass.Text));

                    var response = await VadodaraByFoot.ServiceLayer.CallWebservice.GetResponse_Post <RootObjectUserForgotPass>(WebServiceURL.Url_userForgotPass, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }

            ForgotPassPopupStack.IsEnabled      = false; ForgotPassPopupStack.IsVisible = false;
            LoginPageScrollView.Opacity         = 1;
            LoginPageScrollView.IsEnabled       = true;
            LoginPageScrollView.BackgroundColor = Color.Transparent;
        }
Ejemplo n.º 17
0
        public void SetFontSizeControls()
        {
            lblEmail.FontSize      = AppStatics.GetFontSizeMedium();
            lblPassword.FontSize   = AppStatics.GetFontSizeMedium();
            lblForgotPass.FontSize = AppStatics.GetFontSizeMedium();

            txtbxEmail.FontSize      = AppStatics.GetFontSizeMedium();
            txtbxPassword.FontSize   = AppStatics.GetFontSizeMedium();
            txtbxForgotPass.FontSize = AppStatics.GetFontSizeMedium();

            lblRegistration.FontSize   = AppStatics.GetFontSizeSmall();
            lblDontHaveAccnt.FontSize  = AppStatics.GetFontSizeSmall();
            LblForgotPassword.FontSize = AppStatics.GetFontSizeSmall();

            lblForgotPasTitlePage.FontSize = AppStatics.GetFontSizeTitle();

            btnLogin.FontSize            = AppStatics.GetFontSizeMedium();
            btnForgotPass.FontSize       = AppStatics.GetFontSizeMedium();
            btnForgotPassCancel.FontSize = AppStatics.GetFontSizeMedium();

            txtbxForgotPass.Placeholder = "Username or email address";
        }
Ejemplo n.º 18
0
        public async void PlaceDetail_Clicked(object sender, System.EventArgs e)
        {
            AppStatics.Loading(loading, true);
            //   await Navigation.PushAsync(new VadodaraByFoot.View.WalkTourModule.RouteCoversPage(DetailData, MapDataObject , imgHeader.Source));
            UserData _userdata = AppStatics.LoadIsolatedData();

            if (_userdata != null)
            {
                var stack = Navigation.NavigationStack;
                if (stack[stack.Count - 1].GetType() != typeof(RouteCoversPage))
                {
                    await Navigation.PushAsync(new VadodaraByFoot.View.WalkTourModule.RouteCoversPage(DetailData, MapDataObject, imgHeader.Source));
                }
            }
            else
            {
                var stack = Navigation.NavigationStack;
                if (stack[stack.Count - 1].GetType() != typeof(VadodaraByFoot.View.LoginModule.LoginPage))
                {
                    await Navigation.PushAsync(new VadodaraByFoot.View.LoginModule.LoginPage());
                }
            }
        }
Ejemplo n.º 19
0
        public async System.Threading.Tasks.Task CallWebserviceForgotPassUser()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("username", txtbxForgotPass.Text));

                    var response = await VadodaraByFoot.ServiceLayer.CallWebservice.GetResponse_Post <RootObjectUserForgotPass>(WebServiceURL.Url_userForgotPass, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);

                        await Navigation.PopAsync();
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Ejemplo n.º 20
0
        public async Task CallWebserviceLoginUser()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("username", txtbxEmail.Text));

                    #region  Password Encryption

                    byte[] PasswordBytes        = Encoding.UTF8.GetBytes(txtbxPassword.Text);
                    string base64StringPassword = Convert.ToBase64String(PasswordBytes);


                    var chars       = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                    var stringChars = new char[8];
                    var random      = new Random();

                    for (int i = 0; i < stringChars.Length; i++)
                    {
                        stringChars[i] = chars[random.Next(chars.Length)];
                    }

                    var    finalString = new String(stringChars);
                    string EncryptPass = finalString + base64StringPassword + finalString;

                    byte[] EncryptedPasswordBytes  = Encoding.UTF8.GetBytes(EncryptPass);
                    string SendEncryptedStringPass = Convert.ToBase64String(EncryptedPasswordBytes);
                    #endregion

                    values.Add(new KeyValuePair <string, string>("password", SendEncryptedStringPass));

                    var response = await VadodaraByFoot.ServiceLayer.CallWebservice.GetResponse_Post <RootObjectUserLogin>(WebServiceURL.Url_userLogin, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            UserData _userdata = new UserData()
                            {
                                username    = response.username,
                                name        = response.name,
                                first_name  = response.first_name,
                                last_name   = response.last_name,
                                nickname    = response.nickname,
                                slug        = response.slug,
                                URL         = response.URL,
                                avatar      = response.avatar,
                                mobile      = response.mobile,
                                description = response.description,
                                registered  = response.registered,
                                email       = response.email,
                                ID          = response.ID
                            };
                            AppStatics.SaveIsolatedData(_userdata);

                            await Navigation.PopAsync();
                        }
                        else
                        {
                            await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);
                        }
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Ejemplo n.º 21
0
        internal void GenerateCode(TextWriter writer)
        {
            writer.WriteLine("namespace {0} {{".FormatWith(generalData.Namespace));
            writer.WriteLine("public sealed partial class {0}: StaticFile {{".FormatWith(generalData.ClassName));

            UrlStatics.GenerateUrlClasses(
                writer,
                generalData.ClassName,
                null,
                Enumerable.Empty <WebItemParameter>().Materialize(),
                Enumerable.Empty <WebItemParameter>().Materialize(),
                !inVersionedFolder);
            writer.WriteLine("private readonly {0} folderSetup;".FormatWith(folderSetupClassName));

            if (inVersionedFolder)
            {
                writer.WriteLine("public {0}(): base( true ) {{".FormatWith(generalData.ClassName));
            }
            else
            {
                writer.WriteLine("public {0}( bool disableVersioning = false ): base( !disableVersioning ) {{".FormatWith(generalData.ClassName));
            }
            writer.WriteLine("folderSetup = new {0}();".FormatWith(folderSetupClassName));
            writer.WriteLine("}");

            writer.WriteLine("public override EntitySetupBase EsAsBaseType => folderSetup;");
            UrlStatics.GenerateGetEncoderMethod(
                writer,
                "",
                Enumerable.Empty <WebItemParameter>().Materialize(),
                Enumerable.Empty <WebItemParameter>().Materialize(),
                p => "false",
                !inVersionedFolder);
            writer.WriteLine(
                "protected override DateTimeOffset getBuildDateAndTime() => {0};".FormatWith(AppStatics.GetLiteralDateTimeExpression(DateTimeOffset.UtcNow)));
            writer.WriteLine("protected override bool isFrameworkFile => {0};".FormatWith(inFramework ? "true" : "false"));
            writer.WriteLine(
                "protected override string relativeFilePath => @\"{0}\";".FormatWith(
                    generalData.PathRelativeToProject.Substring(
                        ((inFramework
                                                            ? EnterpriseWebFramework.StaticFile.FrameworkStaticFilesSourceFolderPath
                                                            : EnterpriseWebFramework.StaticFile.AppStaticFilesFolderName) + Path.DirectorySeparatorChar).Length)));

            writer.WriteLine("}");
            writer.WriteLine("}");
        }
Ejemplo n.º 22
0
        private List <MapResponse.LatiLong> DecodePolylinePoints(string encodedPoints)
        {
            if (encodedPoints == null || encodedPoints == "")
            {
                return(null);
            }
            List <MapResponse.LatiLong> poly = new List <MapResponse.LatiLong>();

            char[] polylinechars = encodedPoints.ToCharArray();
            int    index         = 0;

            int currentLat = 0;
            int currentLng = 0;
            int next5bits;
            int sum;
            int shifter;

            try
            {
                while (index < polylinechars.Length)
                {
                    // calculate next latitude
                    sum     = 0;
                    shifter = 0;
                    do
                    {
                        next5bits = (int)polylinechars[index++] - 63;
                        sum      |= (next5bits & 31) << shifter;
                        shifter  += 5;
                    } while (next5bits >= 32 && index < polylinechars.Length);

                    if (index >= polylinechars.Length)
                    {
                        break;
                    }

                    currentLat += (sum & 1) == 1 ? ~(sum >> 1) : (sum >> 1);

                    //calculate next longitude
                    sum     = 0;
                    shifter = 0;
                    do
                    {
                        next5bits = (int)polylinechars[index++] - 63;
                        sum      |= (next5bits & 31) << shifter;
                        shifter  += 5;
                    } while (next5bits >= 32 && index < polylinechars.Length);

                    if (index >= polylinechars.Length && next5bits >= 32)
                    {
                        break;
                    }

                    currentLng += (sum & 1) == 1 ? ~(sum >> 1) : (sum >> 1);
                    MapResponse.LatiLong p = new MapResponse.LatiLong();
                    p.lat = Convert.ToDouble(currentLat) / 100000.0;
                    p.lng = Convert.ToDouble(currentLng) / 100000.0;
                    poly.Add(p);
                }
            }
            catch (Exception ex)
            {
                // logo it
            }
            AppStatics.Loading(loading, false);
            ContentLayout.IsVisible  = true;
            imgPlaceDetail.IsVisible = true;
            return(poly);
        }
Ejemplo n.º 23
0
        public async Task CallWebserviceRegisterUser()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("first_name", txtbxFirstName.Text));
                    values.Add(new KeyValuePair <string, string>("last_name", txtbxLastName.Text));
                    values.Add(new KeyValuePair <string, string>("username", txtbxName.Text));

                    #region  Password Encryption

                    byte[] PasswordBytes        = Encoding.UTF8.GetBytes(txtbxPass.Text);
                    string base64StringPassword = Convert.ToBase64String(PasswordBytes);


                    var chars       = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                    var stringChars = new char[8];
                    var random      = new Random();

                    for (int i = 0; i < stringChars.Length; i++)
                    {
                        stringChars[i] = chars[random.Next(chars.Length)];
                    }

                    var    finalString = new String(stringChars);
                    string EncryptPass = finalString + base64StringPassword + finalString;

                    byte[] EncryptedPasswordBytes  = Encoding.UTF8.GetBytes(EncryptPass);
                    string SendEncryptedStringPass = Convert.ToBase64String(EncryptedPasswordBytes);
                    #endregion

                    values.Add(new KeyValuePair <string, string>("password", SendEncryptedStringPass));

                    values.Add(new KeyValuePair <string, string>("confirmpassword", SendEncryptedStringPass));


                    //values.Add(new KeyValuePair<string, string>("password", txtbxPass.Text));
                    values.Add(new KeyValuePair <string, string>("email", txtbxEmail.Text));
                    values.Add(new KeyValuePair <string, string>("mobile", txtbxMobNum.Text));
                    var response = await CallWebservice.GetResponse_Post <RootObjectUserRegistration>(WebServiceURL.Url_userReg, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);

                        if (response._resultflag == 1)
                        {
                            Navigation.PopAsync();
                        }
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Ejemplo n.º 24
0
 public void MenuList()
 {
     lstMenu.ItemsSource = null;
     menuList            = new List <MenuItem>();
     menuList.Add(new MenuItem()
     {
         Icon = "menu_drawer_home_icon.png", Title = AppResources.AppResources.MHome, IsSelected = 1, TargetType = typeof(WalkTourModule.WalkToursListPage), TitleFontSize = AppStatics.GetFontSizeTitle()
     });
     menuList.Add(new MenuItem()
     {
         Icon = "menu_drawer_about_icon.png", Title = AppResources.AppResources.MAboutUs, IsSelected = 0, TargetType = typeof(MenuPages.About_us), TitleFontSize = AppStatics.GetFontSizeTitle()
     });
     menuList.Add(new MenuItem()
     {
         Icon = "menu_drawer_contact_icon.png", Title = AppResources.AppResources.MContactUs, IsSelected = 0, TargetType = typeof(MenuPages.Contact_Us), TitleFontSize = AppStatics.GetFontSizeTitle()
     });
     menuList.Add(new MenuItem()
     {
         Icon = "menu_drawer_feedback_icon.png", Title = AppResources.AppResources.MFeedback, IsSelected = 0, TargetType = typeof(MenuPages.FeedBack), TitleFontSize = AppStatics.GetFontSizeTitle()
     });
     //  menuList.Add(new MenuItem() { Icon = "menu_drawer_share_icon.png", Title = AppResources.AppResources.MShare, IsSelected = 0 , TargetType = typeof(FAQs), TitleFontSize = AppStatics.GetFontSizeTitle() });
     menuList.Add(new MenuItem()
     {
         Icon = "menu_drawer_faqs_icon.png", Title = AppResources.AppResources.MFAQs, IsSelected = 0, TargetType = typeof(FAQs), TitleFontSize = AppStatics.GetFontSizeTitle()
     });
     lstMenu.ItemsSource = menuList;
     VadodaraByFoot.AppStatics.CurrentPage = menuList[0].Title;
 }
Ejemplo n.º 25
0
        void Operation.Execute(Installation genericInstallation, OperationResult operationResult)
        {
            IsuStatics.ConfigureIis(true, false);
            Console.WriteLine("Configured IIS Express.");

            // This block exists because of https://enduracode.kilnhg.com/Review/K164316.
            try {
                IsuStatics.ConfigureIis(false, false);
                Console.WriteLine("Configured full IIS.");
            }
            catch {
                Console.WriteLine("Did not configure full IIS.");
            }

            var installation = genericInstallation as DevelopmentInstallation;

            DatabaseOps.UpdateDatabaseLogicIfUpdateFileExists(
                installation.DevelopmentInstallationLogic.Database,
                installation.ExistingInstallationLogic.DatabaseUpdateFilePath,
                true);

            try {
                copyInEwlFiles(installation);
            }
            catch (Exception e) {
                var message = "Failed to copy {0} files into the installation. Please try the operation again.".FormatWith(EwlStatics.EwlName);
                if (e is UnauthorizedAccessException || e is IOException)
                {
                    throw new UserCorrectableException(message, e);
                }
                throw new ApplicationException(message, e);
            }

            // Generate code.
            if (installation.DevelopmentInstallationLogic.SystemIsEwl)
            {
                generateCodeForProject(
                    installation,
                    AppStatics.CoreProjectName,
                    writer => {
                    writer.WriteLine("using System;");
                    writer.WriteLine("using System.Globalization;");
                    writer.WriteLine("using System.Reflection;");
                    writer.WriteLine("using System.Runtime.InteropServices;");
                    writer.WriteLine();
                    writeAssemblyInfo(writer, installation, "");
                    writer.WriteLine();
                    writer.WriteLine("namespace EnterpriseWebLibrary {");
                    writer.WriteLine("partial class EwlStatics {");
                    CodeGenerationStatics.AddSummaryDocComment(writer, "The date/time at which this version of EWL was built.");
                    writer.WriteLine(
                        "public static readonly DateTimeOffset EwlBuildDateTime = {0};".FormatWith(AppStatics.GetLiteralDateTimeExpression(DateTimeOffset.UtcNow)));
                    writer.WriteLine("}");
                    writer.WriteLine("}");
                });
                generateCodeForProject(
                    installation,
                    "Development Utility",
                    writer => {
                    writer.WriteLine("using System.Reflection;");
                    writer.WriteLine("using System.Runtime.InteropServices;");
                    writeAssemblyInfo(writer, installation, "Development Utility");
                });
            }
            generateLibraryCode(installation);
            foreach (var webProject in installation.DevelopmentInstallationLogic.DevelopmentConfiguration.webProjects ?? new WebProject[0])
            {
                generateWebConfigAndCodeForWebProject(installation, webProject);
            }
            foreach (var service in installation.ExistingInstallationLogic.RuntimeConfiguration.WindowsServices)
            {
                generateWindowsServiceCode(installation, service);
            }
            foreach (var project in installation.DevelopmentInstallationLogic.DevelopmentConfiguration.ServerSideConsoleProjectsNonNullable)
            {
                generateServerSideConsoleProjectCode(installation, project);
            }
            if (installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject != null)
            {
                generateCodeForProject(
                    installation,
                    installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.name,
                    writer => {
                    writer.WriteLine("using System.Reflection;");
                    writer.WriteLine("using System.Runtime.InteropServices;");
                    writeAssemblyInfo(writer, installation, installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.name);
                });
            }

            generateXmlSchemaLogicForCustomInstallationConfigurationXsd(installation);
            generateXmlSchemaLogicForOtherXsdFiles(installation);

            if (!installation.DevelopmentInstallationLogic.SystemIsEwl && Directory.Exists(EwlStatics.CombinePaths(installation.GeneralLogic.Path, ".hg")))
            {
                updateMercurialIgnoreFile(installation);
            }
        }
Ejemplo n.º 26
0
 protected override void OnDisappearing()
 {
     AppStatics.Loading(loading, false);
 }
Ejemplo n.º 27
0
 public void SetFontSizeControls()
 {
     lblLogIn_Out.FontSize       = AppStatics.GetFontSizeTitle();
     lblUserName.FontSize        = AppStatics.GetFontSizeMedium();
     lblUserNameEmailId.FontSize = AppStatics.GetFontSizeSmall();
 }
Ejemplo n.º 28
0
 protected override PageContent getContent() =>
 new UiPageContent(
     pageActions: AppTools.User != null && UserId == AppTools.User.UserId
                                              ? new HyperlinkSetup(User.GetInfo(), "Edit Profile Settings", icon: new ActionComponentIcon(new FontAwesomeIcon("fa-cog")))
     .ToCollection()
                                              : AppStatics.GetFollowAction(UserId).ToCollection()).Add(getArticleSection());
Ejemplo n.º 29
0
        internal void GenerateCode(TextWriter writer)
        {
            writer.WriteLine("namespace " + generalData.Namespace + " {");
            writer.WriteLine("public class " + generalData.ClassName + " {");
            writer.WriteLine("public sealed class Info: StaticCssInfo {");
            writeBuildUrlMethod(writer);

            writer.WriteLine(
                "protected override DateTimeOffset getBuildDateAndTime() { return " + AppStatics.GetLiteralDateTimeExpression(DateTimeOffset.UtcNow) + "; }");

            writeAppRelativeFilePathProperty(writer);
            writer.WriteLine("}");
            writer.WriteLine("}");
            writer.WriteLine("}");
        }
 public void SetFontSizeControls()
 {
     lblNoRecord.FontSize = AppStatics.GetFontSizeMedium();
     txtbxSearch.FontSize = AppStatics.GetFontSizeMedium();
 }