Пример #1
0
        public Task Addlibrary(LibInfo.RootObject lib)
        {
            libname libn = new libname();

            _connection.DeleteAll <libname>();
            libn.LibraryName = lib.LibName;
            return(Task.Run(() => (_connection.Insert(libn))));
        }
Пример #2
0
        public LoadPage(LibInfo.RootObject lib)
        {
            InitializeComponent();
            dataStore = DependencyService.Get <IDataStore>();
            var assembly = typeof(LoadPage);

            libary = lib;
            logoEtangibles.Source    = ImageSource.FromResource("Library.Assets.AppImages.logo_eTangibles_white_letters.png", assembly);
            logoTheLibraryApp.Source = ImageSource.FromResource(LibInfo.Imagefolderclinetlogos + lib.Items[0].image, assembly);
            loading();
        }
Пример #3
0
        public PickerPage()
        {
            stackLayout.Children.Add(header);

            stackLayout.Children.Add(title);

            stackLayout.Children.Add(picker);
            foreach (string libName in LibInfo.LibraryList.Keys)
            {
                picker.Items.Add(libName);
            }


            stackLayout.Children.Add(launch);
            picker.SelectedIndexChanged += (sender, args) =>
            {
                if (picker.SelectedIndex == -1)
                {
                    DisplayAlert("Warning", "Please select one Library", "Ok");
                }
                else
                {
                    string libname = picker.Items[picker.SelectedIndex];
                    if (stackLayout.Children.Contains(title))
                    {
                        stackLayout.Children.Remove(title);
                        stackLayout.Children.Insert(1, image);
                    }
                    var json = ResourceLoader.GetEmbeddedResourceString(Assembly.Load(new AssemblyName("Library")), LibInfo.LibraryList[libname]);
                    lib                 = JsonConvert.DeserializeObject <LibInfo.RootObject>(json);
                    image.Source        = ImageSource.FromResource(LibInfo.Imagefolderclinetlogos + lib.Items[0].image, typeof(PickerPage));
                    image.WidthRequest  = 320;
                    image.HeightRequest = 135;
                }
            };
            launch.Clicked += OnbuttonClicked;
            Title           = "Librarys";
            BackgroundColor = Color.White;
            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);
            Content      = stackLayout;
        }
Пример #4
0
 public HomePage(LibInfo.RootObject lib)
 {
     InitializeComponent();
     dataStore = DependencyService.Get <IDataStore>();
     Lib       = lib;
 }
Пример #5
0
 public LibCardViewModel(LibInfo.RootObject libinfo, Page page) : base(page)
 {
     lib         = libinfo;
     barcodeType = (ZXing.BarcodeFormat)Enum.Parse(typeof(ZXing.BarcodeFormat), libinfo.Barcodetype);
 }
Пример #6
0
        public LibInfoPage_d(LibInfo.RootObject lib)
        {
            libInfo = lib;

            #region Grid Interface
            for (int i = 0; i < libInfo.Items.Count; i++)
            {
                var controlgrid = new Grid
                {
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    RowSpacing      = 10,
                    ColumnSpacing   = 5,
                    Padding         = new Thickness(5, 0, 5, 0),
                    BackgroundColor = Color.White,
                    RowDefinitions  =
                    {
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = GridLength.Auto
                        },
                        new RowDefinition {
                            Height = new GridLength(300, GridUnitType.Absolute)
                        }
                    },
                    ColumnDefinitions =
                    {
                        new ColumnDefinition {
                            Width = new GridLength(.475, GridUnitType.Star)
                        },
                        new ColumnDefinition {
                            Width = new GridLength(.05, GridUnitType.Star)
                        },
                        new ColumnDefinition {
                            Width = new GridLength(.475, GridUnitType.Star)
                        }
                    }
                };
                controlgrid.Children.Add(new Image
                {
                    VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand,
                    WidthRequest    = 320,
                    HeightRequest   = 130,
                    IsVisible       = string.IsNullOrEmpty(libInfo.Items[i].image) ? false : true,
                    Source          = ImageSource.FromResource(LibInfo.Imagefolderclinetlogos + lib.Items[i].image, typeof(LibInfoPage_d)),
                }, 0, 3, 0, 1);
                controlgrid.Children.Add(new Label
                {
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    Text     = libInfo.Items[i].branchName,
                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                }, 0, 3, 1, 2);



                controlgrid.Children.Add(new Button
                {
                    CommandParameter = i,
                    Command          = new Command(o =>
                    {
                        var phoneCallTask = CrossMessaging.Current.PhoneDialer;
                        if (phoneCallTask.CanMakePhoneCall)
                        {
                            phoneCallTask.MakePhoneCall(libInfo.Items[int.Parse(o.ToString())].phoneNumber.CleanPhone());
                        }
                    }),
                    Text = string.Format("Call:{0}",
                                         libInfo.Items[i].phoneNumber),
                    Image           = "phone.png",
                    TextColor       = Color.FromHex(libInfo.TextColor),
                    CornerRadius    = 1,
                    BackgroundColor = Color.FromHex(libInfo.backGroundColor),
                    BorderColor     = Color.FromHex(libInfo.borderColor),
                }, 0, 1, 2, 3);
                controlgrid.Children.Add(new Label
                {
                    Text = string.Format("Fax:{0}", libInfo.Items[i].Fax),

                    TextColor = Color.FromHex(libInfo.TextColor),

                    BackgroundColor   = Color.FromHex(libInfo.backGroundColor),
                    VerticalOptions   = LayoutOptions.Center,
                    HorizontalOptions = LayoutOptions.End
                }, 2, 3, 2, 3);
                controlgrid.Children.Add(new Button
                {
                    CommandParameter = i,

                    Command = new Command(o =>
                    {
                        Device.OpenUri(new Uri("mailto:" + libInfo.Items[int.Parse(o.ToString())].email));
                    }),


                    IsVisible = string.IsNullOrEmpty(libInfo.Items[i].email) ? false : true,

                    Text = libInfo.Items[i].email,

                    TextColor       = Color.FromHex(libInfo.TextColor),
                    CornerRadius    = 1,
                    BackgroundColor = Color.FromHex(libInfo.backGroundColor),
                    BorderColor     = Color.FromHex(libInfo.borderColor),
                }, 0, 3, 3, 4);

                controlgrid.Children.Add(new Label
                {
                    Text = "Library Hours",

                    TextColor      = Color.FromHex(libInfo.backGroundColor),
                    FontSize       = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                    FontAttributes = FontAttributes.Bold,
                }, 0, 3, 4, 5);

                controlgrid.Children.Add(new Label
                {
                    Text = "Monday",

                    VerticalOptions = LayoutOptions.Center,
                    FontSize        = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                    FontAttributes  = FontAttributes.Bold,
                }, 0, 2, 5, 6);
                controlgrid.Children.Add(new Label
                {
                    Text = string.Format("{0} - {1}",
                                         libInfo.Items[i].Time.MondayOpen,
                                         libInfo.Items[i].Time.MondayClose),

                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),

                    HorizontalOptions = LayoutOptions.End,
                }, 2, 3, 5, 6);
                controlgrid.Children.Add(new Label
                {
                    Text = "Tuesday",

                    VerticalOptions = LayoutOptions.Center,
                    FontSize        = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                    FontAttributes  = FontAttributes.Bold,
                }, 0, 2, 6, 7);
                controlgrid.Children.Add(new Label
                {
                    Text = string.Format("{0} - {1}",
                                         libInfo.Items[i].Time.TuesdayOpen,
                                         libInfo.Items[i].Time.TuesdayClose),

                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),

                    HorizontalOptions = LayoutOptions.End,
                }, 2, 3, 6, 7);
                controlgrid.Children.Add(new Label
                {
                    Text = "Wednesday",

                    VerticalOptions = LayoutOptions.Center,
                    FontSize        = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                    FontAttributes  = FontAttributes.Bold,
                }, 0, 2, 7, 8);
                controlgrid.Children.Add(new Label
                {
                    Text = string.Format("{0} - {1}",
                                         libInfo.Items[i].Time.WednesdayOpen,
                                         libInfo.Items[i].Time.WednesdayClose),

                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),

                    HorizontalOptions = LayoutOptions.End,
                }, 2, 3, 7, 8);

                controlgrid.Children.Add(new Label
                {
                    Text = "Thursday",

                    VerticalOptions = LayoutOptions.Center,
                    FontSize        = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                    FontAttributes  = FontAttributes.Bold,
                }, 0, 2, 8, 9);
                controlgrid.Children.Add(new Label
                {
                    Text = string.Format("{0} - {1}",
                                         libInfo.Items[i].Time.ThursdayOpen,
                                         libInfo.Items[i].Time.ThursdayClose),

                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),

                    HorizontalOptions = LayoutOptions.End,
                }, 2, 3, 8, 9);
                controlgrid.Children.Add(new Label
                {
                    Text            = "Friday",
                    VerticalOptions = LayoutOptions.Center,
                    FontSize        = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                    FontAttributes  = FontAttributes.Bold,
                }, 0, 2, 9, 10);
                controlgrid.Children.Add(new Label
                {
                    Text = string.Format("{0} - {1}",
                                         libInfo.Items[i].Time.FridayOpen,
                                         libInfo.Items[i].Time.FridayClose),

                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),

                    HorizontalOptions = LayoutOptions.End,
                }, 2, 3, 9, 10);

                controlgrid.Children.Add(new Label
                {
                    Text            = "Saturday",
                    VerticalOptions = LayoutOptions.Center,
                    FontSize        = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                    FontAttributes  = FontAttributes.Bold,
                }, 0, 2, 10, 11);
                controlgrid.Children.Add(new Label
                {
                    Text = string.Format("{0} - {1}",
                                         libInfo.Items[i].Time.SaturdayOpen,
                                         libInfo.Items[i].Time.SaturdayClose),

                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),

                    HorizontalOptions = LayoutOptions.End,
                }, 2, 3, 10, 11);

                controlgrid.Children.Add(new Label
                {
                    Text            = "Sunday",
                    VerticalOptions = LayoutOptions.Center,
                    FontSize        = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                    FontAttributes  = FontAttributes.Bold,
                }, 0, 2, 11, 12);
                controlgrid.Children.Add(new Label
                {
                    Text = string.Format("{0} - {1}",
                                         libInfo.Items[i].Time.SundayOpen,
                                         libInfo.Items[i].Time.SundayClose),

                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),

                    HorizontalOptions = LayoutOptions.End,
                }, 2, 3, 11, 12);

                controlgrid.Children.Add(new Label
                {
                    Text            = "Location",
                    VerticalOptions = LayoutOptions.Center,
                    FontSize        = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                    FontAttributes  = FontAttributes.Bold,
                    TextColor       = Color.FromHex(libInfo.backGroundColor)
                }, 0, 3, 12, 13);

                controlgrid.Children.Add(new Button
                {
                    CommandParameter = libInfo.Items[i],
                    Command          = new Command <LibInfo.Item>(obj =>
                                                                  CrossExternalMaps.Current.NavigateTo(
                                                                      obj.branchName,
                                                                      obj.Latitude,
                                                                      obj.Longitude)),
                    Text            = "Navigate",
                    Image           = "navigation.png",
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    TextColor       = Color.FromHex(libInfo.TextColor),
                    CornerRadius    = 1,
                    BackgroundColor = Color.FromHex(libInfo.backGroundColor),
                    BorderColor     = Color.FromHex(libInfo.borderColor)
                }, 0, 1, 13, 14);


                controlgrid.Children.Add(new Label
                {
                    Text = string.Format(" {0} {4} {1}, {2} {3}",
                                         libInfo.Items[i].Address.Street,
                                         libInfo.Items[i].Address.City,
                                         libInfo.Items[i].Address.State,
                                         libInfo.Items[i].Address.zipCode,
                                         Environment.NewLine),
                    VerticalOptions   = LayoutOptions.CenterAndExpand,
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    FontSize          = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                }, 1, 3, 13, 14);
                var map = new Map()
                {
                    IsShowingUser = true,
                    MapType       = MapType.Hybrid,
                };
                controlgrid.Children.Add(map, 0, 3, 14, 15);
                gridlist.Add(controlgrid);
                Maplist.Add(map);
            }
            #endregion


            ToolbarItems.Add(new ToolbarItem
            {
                Text    = "Setting",
                Command = new Command(async(obj) =>
                {
                    await Navigation.PushAsync(new PickerPage());
                })
            });
            var stack = new StackLayout();
            for (int i = 0; i < libInfo.Items.Count; i++)
            {
                stack.Children.Add(gridlist[i]);
            }
            Content = new ScrollView
            {
                Padding         = new Thickness(5, 10, 5, 5),
                BackgroundColor = Color.FromHex(libInfo.backGroundColor),
                Content         = stack
            };
        }
Пример #7
0
        public MainTabPage(LibInfo.RootObject lib)
        {
            this.Title         = "TabbedPage";
            BarTextColor       = lib.toTextColor();
            BarBackgroundColor = lib.tobackgroundColor();
            //this.Children.GetEnumerator.baStyle = Device.Styles.TitleStyle;
            //BindingContext


            var Newspad = new NewsTabletPage()
            {
                IsPresented = true, BackgroundColor = lib.tobackgroundColor()
            };

            if (Device.Idiom != TargetIdiom.Phone)
            {
                this.PropertyChanging += (sender, e) =>
                {
                    if (e.PropertyName == "CurrentPage")
                    {
                        Newspad.IsPresented = true;
                    }
                };


                this.Children.Add(new NavigationPage(Newspad)
                {
                    Title = "News",

                    BarTextColor       = lib.toTextColor(),
                    BarBackgroundColor = lib.tobackgroundColor(),
                    BackgroundColor    = lib.tobackgroundColor(),
                    Icon = "news_30x30.png"
                });
            }
            else
            {
                this.Children.Add(new NavigationPage(new NewsPhonePage())
                {
                    Title = "News",
                    //Style = Device.Styles.TitleStyle,
                    BarBackgroundColor = lib.tobackgroundColor(),
                    BarTextColor       = lib.toTextColor(),
                    BackgroundColor    = lib.tobackgroundColor(),
                    Icon = "news_30x30.png"
                });
            }


            this.Children.Add(new NavigationPage(new CalendarPage()
            {
                Title           = "Events",
                BackgroundColor = lib.tobackgroundColor()
            })
            {
                Title = "Events",
                BarBackgroundColor = lib.tobackgroundColor(),
                BarTextColor       = lib.toTextColor(),
                BackgroundColor    = lib.tobackgroundColor(),
                Icon = "calendar_30x30.png"
            });



            //string Url = "https://evergreen.lib.in.us/eg/opac/home";
            this.Children.Add(new WebViewPage(lib.Catalogs)
            {
                Title           = "Catalog",
                BackgroundColor = lib.tobackgroundColor(),
                Icon            = "catalogue_30x30.png"
            });



            this.Children.Add(new NavigationPage(new LibInfoPage_d(lib)
            {
                Title           = "Contacts",
                BackgroundColor = lib.tobackgroundColor()
            })
            {
                Title = "Contacts",
                Icon  = "contact_30x30.png",
                BarBackgroundColor = lib.tobackgroundColor(),
                BarTextColor       = lib.toTextColor(),
                BackgroundColor    = lib.tobackgroundColor(),
            });

            this.Children.Add(new NavigationPage(new BarCodePageX(lib)
            {
                Title = "Card"
            })
            {
                Title = "Card",
                Icon  = "card_30x30.png",
                BarBackgroundColor = lib.tobackgroundColor(),
                BarTextColor       = lib.toTextColor(),
                BackgroundColor    = lib.tobackgroundColor()
            });



            //{

            //	Title = "Catalog",

            //	BarBackgroundColor = Replace.backGroundcolor,
            //	BarTextColor = Replace.BarTextColor,
            //	//BackgroundColor = Replace.BarTextColor

            //});



            //this.Children.Add(new NavigationPage(new ScanListView { Title = "ScanView" })
            //{
            //	Title = "ScanView",
            //	BarBackgroundColor = Color.FromHex("#24678d"),
            //	BarTextColor = Color.White,
            //	BackgroundColor = Color.White
            //});
        }
Пример #8
0
        //string cardValue="Tap '+' and scan your card.";
        //string cardValue = "";

        public BarCodePageX(LibInfo.RootObject lib)
        {
            InitializeComponent();
            BindingContext = viewModel = new LibCardViewModel(lib, this);
        }