public MainWindow() { InitializeComponent(); DBConnectionHandler.InitializeDB(); _loginView = new LoginView(); _registerView = new RegisterView(); _informationView = new InformationView(); DataContext = _loginView; }
// GET: Information public ActionResult Index() { var information = db.Information.ToList(); List <InformationView> model = new List <InformationView>(); foreach (var item in information) { InformationView driver = new InformationView(); driver.MapDataToViewModel(item); model.Add(driver); } return(View(model.OrderBy(s => s.FillUpDate))); }
private async void AddInformationView(SettingView view) { MakeButtonInactive(); using (UserDialogs.Instance.Loading("loading")) { await Task.Delay(1); PageTitle.Text = "Personal Info"; ContentStackLayout.Children.Clear(); var view2 = new InformationView(); await view2.InitPage(); ContentStackLayout.Children.Add(view2); } }
public ActionResult Index(string searchName, string searchModel, DateTime?startDate, DateTime?endDate) { var information = from m in db.Information.ToList() select m; List <InformationView> model = new List <InformationView>(); foreach (var item in information) { InformationView driver = new InformationView(); driver.MapDataToViewModel(item); model.Add(driver); } var fueler = from f in model select f; if (startDate != null) { fueler = fueler.Where(s => s.FillUpDate >= startDate); } if (endDate != null) { fueler = fueler.Where(s => s.FillUpDate <= endDate); } if (!string.IsNullOrEmpty(searchModel)) { fueler = fueler.Where(s => s.CarModel.ToLower().Contains(searchModel.ToLower())); } if (!string.IsNullOrEmpty(searchName)) { fueler = fueler.Where(s => s.LName.ToLower().Contains(searchName.ToLower()) || s.FName.ToLower().Contains(searchName.ToLower())); } try { ViewBag.AverageMPG = Math.Round(fueler.Average(s => s.MilesPerGallon), 2); } catch (Exception) { ViewBag.AverageMPG = 0; } return(View(fueler.OrderByDescending(s => s.FillUpDate).ThenBy(s => s.LName).ThenBy(s => s.CarModel))); }
// GET: Information2 public ActionResult Index() { var information = from m in db.Information.ToList() select m; List <InformationView> model = new List <InformationView>(); foreach (var item in information) { InformationView driver = new InformationView(); driver.MapDataToViewModel(item); model.Add(driver); } try { ViewBag.AverageMPG = Math.Round(model.Average(s => s.MilesPerGallon), 2); } catch (Exception) { ViewBag.AverageMPG = 0; } return(View(model.OrderByDescending(s => s.FillUpDate).ThenBy(s => s.LName).ThenBy(s => s.CarModel))); }
void ReleaseDesignerOutlets() { if (AContentView != null) { AContentView.Dispose(); AContentView = null; } if (AreaLabel != null) { AreaLabel.Dispose(); AreaLabel = null; } if (AuthorLabel != null) { AuthorLabel.Dispose(); AuthorLabel = null; } if (BookSize != null) { BookSize.Dispose(); BookSize = null; } if (BookSizeLabel != null) { BookSizeLabel.Dispose(); BookSizeLabel = null; } if (BookTitleLabel != null) { BookTitleLabel.Dispose(); BookTitleLabel = null; } if (CaseLabel != null) { CaseLabel.Dispose(); CaseLabel = null; } if (CasesButton != null) { CasesButton.Dispose(); CasesButton = null; } if (CaseTextField != null) { CaseTextField.Dispose(); CaseTextField = null; } if (CaseView != null) { CaseView.Dispose(); CaseView = null; } if (ContactEmailLabel != null) { ContactEmailLabel.Dispose(); ContactEmailLabel = null; } if (ContactPhoneLabel != null) { ContactPhoneLabel.Dispose(); ContactPhoneLabel = null; } if (CoverImageView != null) { CoverImageView.Dispose(); CoverImageView = null; } if (CurrencyDate != null) { CurrencyDate.Dispose(); CurrencyDate = null; } if (CurrencyDateLabel != null) { CurrencyDateLabel.Dispose(); CurrencyDateLabel = null; } if (CurrentDayLabel != null) { CurrentDayLabel.Dispose(); CurrentDayLabel = null; } if (DescriptionLabel != null) { DescriptionLabel.Dispose(); DescriptionLabel = null; } if (DescriptionView != null) { DescriptionView.Dispose(); DescriptionView = null; } if (DespTextField != null) { DespTextField.Dispose(); DespTextField = null; } if (ExpiredInfoTF != null) { ExpiredInfoTF.Dispose(); ExpiredInfoTF = null; } if (ExpiredLabel != null) { ExpiredLabel.Dispose(); ExpiredLabel = null; } if (ExpiredView != null) { ExpiredView.Dispose(); ExpiredView = null; } if (InfoLabel != null) { InfoLabel.Dispose(); InfoLabel = null; } if (InformationView != null) { InformationView.Dispose(); InformationView = null; } if (InstalledDate != null) { InstalledDate.Dispose(); InstalledDate = null; } if (InstalledLabel != null) { InstalledLabel.Dispose(); InstalledLabel = null; } if (LoanButton != null) { LoanButton.Dispose(); LoanButton = null; } if (PracticeArea != null) { PracticeArea.Dispose(); PracticeArea = null; } if (ProgressBar != null) { ProgressBar.Dispose(); ProgressBar = null; } if (ProgressStatusLabel != null) { ProgressStatusLabel.Dispose(); ProgressStatusLabel = null; } if (ProgressView != null) { ProgressView.Dispose(); ProgressView = null; } if (ScrollView != null) { ScrollView.Dispose(); ScrollView = null; } if (Subcategory != null) { Subcategory.Dispose(); Subcategory = null; } if (SubcategoryLabel != null) { SubcategoryLabel.Dispose(); SubcategoryLabel = null; } if (TagsView != null) { TagsView.Dispose(); TagsView = null; } if (TitleView != null) { TitleView.Dispose(); TitleView = null; } if (UpdateButton != null) { UpdateButton.Dispose(); UpdateButton = null; } if (UpdateInfoLabel != null) { UpdateInfoLabel.Dispose(); UpdateInfoLabel = null; } if (Version != null) { Version.Dispose(); Version = null; } if (VersionLabel != null) { VersionLabel.Dispose(); VersionLabel = null; } if (WhatNewInfoLabel != null) { WhatNewInfoLabel.Dispose(); WhatNewInfoLabel = null; } if (WhatNewInfoView != null) { WhatNewInfoView.Dispose(); WhatNewInfoView = null; } if (WhatNewLabel != null) { WhatNewLabel.Dispose(); WhatNewLabel = null; } if (WhatNewView != null) { WhatNewView.Dispose(); WhatNewView = null; } if (DotButton != null) { DotButton.Dispose(); DotButton = null; } }
void LayoutSubViews() { if (BookInfo == null) { return; } //calculate the subview size CGSize infoViewSize = InformationView.Frame.Size; CGSize whatsNewViewSize = WhatNewView.Frame.Size; CGSize casesViewSize; if (CaseView.Hidden) { casesViewSize = new CGSize(0, 0); } else { casesViewSize = CaseView.Frame.Size; } CGSize despViewSize = DescriptionView.Frame.Size; CGSize expiredViewSize; if (BookInfo.DaysRemaining < 0) { expiredViewSize = ExpiredView.Frame.Size; } else { expiredViewSize = new CGSize(0, 0); } CGSize titleViewSize = TitleView.Frame.Size; //set scrollview contentview size nfloat caseSpace = casesViewSize.Height == 0 ? 0 : VERTICAL_SPACING; nfloat expirdSpace = expiredViewSize.Height == 0 ? 0 : VERTICAL_SPACING; nfloat height = VERTICAL_SPACING + infoViewSize.Height + VERTICAL_SPACING + whatsNewViewSize.Height + VERTICAL_SPACING + casesViewSize.Height + caseSpace + despViewSize.Height + VERTICAL_SPACING + expiredViewSize.Height + expirdSpace + titleViewSize.Height; CGRect scrollFrame = ScrollView.Frame; nfloat contentHeight = scrollFrame.Bottom > height ? scrollFrame.Bottom : height; var contentSize = new CGSize(AContentView.Frame.Size.Width, contentHeight); AContentView.SetFrameSize(contentSize); //add subview to document view var docView = (NSView)ScrollView.DocumentView; docView.SetFrameSize(contentSize); foreach (NSView view in docView.Subviews) { view.RemoveFromSuperview(); } docView.AddSubview(AContentView); AContentView.SetFrameOrigin(new CGPoint(0, 0)); //recalulate subviews origin point nfloat startOffset = scrollFrame.Bottom >= height ? (scrollFrame.Bottom - height + VERTICAL_SPACING) : VERTICAL_SPACING; nfloat yOffset; var InfoViewPoint = InformationView.Frame.Location; InfoViewPoint.Y = startOffset; InformationView.SetFrameOrigin(InfoViewPoint); var WhatsViewPoint = new CGPoint(InfoViewPoint.X, InfoViewPoint.Y + infoViewSize.Height + VERTICAL_SPACING); WhatNewView.SetFrameOrigin(WhatsViewPoint); var CaseViewPoint = new CGPoint(InfoViewPoint.X, WhatsViewPoint.Y + whatsNewViewSize.Height + VERTICAL_SPACING); CaseView.SetFrameOrigin(CaseViewPoint); if (casesViewSize.Height > 0) { yOffset = VERTICAL_SPACING; } else { yOffset = 0; } var DesViewPoint = new CGPoint(InfoViewPoint.X, CaseViewPoint.Y + casesViewSize.Height + yOffset); DescriptionView.SetFrameOrigin(DesViewPoint); var ExpireViewPoint = new CGPoint(InfoViewPoint.X, DesViewPoint.Y + despViewSize.Height + VERTICAL_SPACING); ExpiredView.SetFrameOrigin(ExpireViewPoint); if (expiredViewSize.Height > 0) { yOffset = VERTICAL_SPACING; } else { yOffset = 0; } var TitleViewPoint = new CGPoint(InfoViewPoint.X, ExpireViewPoint.Y + expiredViewSize.Height + yOffset); TitleView.SetFrameOrigin(TitleViewPoint); ScrollToTop(); }
/// <summary>Initializes a new instance of the <see cref="InformationViewPresenter"/> class.</summary> /// <param name="infoView">The info view.</param> public InformationViewPresenter(InformationView infoView) { this.infoView = infoView; }
private void ShowInfos() { InformationView info = new InformationView(); info.ShowDialog(); }
void ReleaseDesignerOutlets() { if (AdvCreditLabel != null) { AdvCreditLabel.Dispose(); AdvCreditLabel = null; } if (AdventureButton != null) { AdventureButton.Dispose(); AdventureButton = null; } if (AdventureCreditLabel != null) { AdventureCreditLabel.Dispose(); AdventureCreditLabel = null; } if (AdventureEuroLabel != null) { AdventureEuroLabel.Dispose(); AdventureEuroLabel = null; } if (AdventureTitle != null) { AdventureTitle.Dispose(); AdventureTitle = null; } if (AdventureView != null) { AdventureView.Dispose(); AdventureView = null; } if (DiscoCreditLabel != null) { DiscoCreditLabel.Dispose(); DiscoCreditLabel = null; } if (DiscoveryButton != null) { DiscoveryButton.Dispose(); DiscoveryButton = null; } if (DiscoveryCreditLabel != null) { DiscoveryCreditLabel.Dispose(); DiscoveryCreditLabel = null; } if (DiscoveryEuroLabel != null) { DiscoveryEuroLabel.Dispose(); DiscoveryEuroLabel = null; } if (DiscoveryTitle != null) { DiscoveryTitle.Dispose(); DiscoveryTitle = null; } if (DiscoveryView != null) { DiscoveryView.Dispose(); DiscoveryView = null; } if (EpicButton != null) { EpicButton.Dispose(); EpicButton = null; } if (EpicCreditLabel != null) { EpicCreditLabel.Dispose(); EpicCreditLabel = null; } if (EpicEuroLabel != null) { EpicEuroLabel.Dispose(); EpicEuroLabel = null; } if (EpicTitle != null) { EpicTitle.Dispose(); EpicTitle = null; } if (EpicView != null) { EpicView.Dispose(); EpicView = null; } if (ExploCreditLabel != null) { ExploCreditLabel.Dispose(); ExploCreditLabel = null; } if (ExplorationButton != null) { ExplorationButton.Dispose(); ExplorationButton = null; } if (ExplorationCreditLabel != null) { ExplorationCreditLabel.Dispose(); ExplorationCreditLabel = null; } if (ExplorationEuroLabel != null) { ExplorationEuroLabel.Dispose(); ExplorationEuroLabel = null; } if (ExplorationTitle != null) { ExplorationTitle.Dispose(); ExplorationTitle = null; } if (ExplorationView != null) { ExplorationView.Dispose(); ExplorationView = null; } if (InformationTextView != null) { InformationTextView.Dispose(); InformationTextView = null; } if (InformationView != null) { InformationView.Dispose(); InformationView = null; } if (ObsCreditLabel != null) { ObsCreditLabel.Dispose(); ObsCreditLabel = null; } if (ObservationButton != null) { ObservationButton.Dispose(); ObservationButton = null; } if (ObservationCreditsLabel != null) { ObservationCreditsLabel.Dispose(); ObservationCreditsLabel = null; } if (ObservationEuroLabel != null) { ObservationEuroLabel.Dispose(); ObservationEuroLabel = null; } if (ObservationTitle != null) { ObservationTitle.Dispose(); ObservationTitle = null; } if (ObservationView != null) { ObservationView.Dispose(); ObservationView = null; } }
// Constructor for info controller private InfoController() { _informationView = Object.FindObjectOfType <InformationView>(); }
private async void AlertFromInformationView(InformationView informationView, AlertModel alertModel) { await DisplayAlert(alertModel.Title, alertModel.Content, alertModel.AcceptMessage); }