public SelectRecordFormPopupView(BasicReportViewModel basicReportViewModel, FullReportViewModel fullReportViewModel)
 {
     InitializeComponent();
     if (basicReportViewModel != null)
     {
         ReportViewModel = basicReportViewModel;
         BindingContext  = basicReportViewModel;
         this.CloseWhenBackgroundIsClicked = true;
         this.BackgroundClicked           += BasicReportPopupView_BackgroundClicked;
         recordFormListview.ItemTapped    += RecordFormItemTapped;
         if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS)
         {
             recordFormListview.RowHeight = 52;
         }
     }
     else
     {
         FullReportViewModel = fullReportViewModel;
         BindingContext      = fullReportViewModel;
         this.CloseWhenBackgroundIsClicked = true;
         this.BackgroundClicked           += FullReportPopupView_BackgroundClicked;
         recordFormListview.ItemTapped    += RecordFormItemTapped;
         if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS)
         {
             recordFormListview.RowHeight = 50;
         }
     }
 }
Пример #2
0
        public SelectNotesPopupView(FullReportViewModel fullReportViewModel)
        {
            InitializeComponent();
            ReportViewModel = fullReportViewModel;
            BindingContext  = fullReportViewModel;
            this.CloseWhenBackgroundIsClicked = true;
            this.BackgroundClicked           += FullReportPopupView_BackgroundClicked;
            NotesListView.ItemTapped         += FullReportNoteItemTapped;
            {
                NotesPopupView.Margin = new Thickness(0, 10, 0, 0);
            }

            if (Device.RuntimePlatform != Device.Android)
            {
                Frame1.IsVisible       = NotesListView.IsVisible = true;
                AndroidFrame.IsVisible = NotesCollectionView.IsVisible = false;
            }
            else
            {
                Frame1.IsVisible       = NotesListView.IsVisible = false;
                AndroidFrame.IsVisible = NotesCollectionView.IsVisible = true;
            }

            if (ReportViewModel.selectedNoteCount == 0)
            {
                foreach (var item in ReportViewModel.NoteTypeList)
                {
                    if (item.IsSelected)
                    {
                        item.IsSelected = false;
                    }
                }
            }
        }
Пример #3
0
 public SelectChildPopupView(BasicReportViewModel basicReportViewModel, FullReportViewModel fullReportViewModel)
 {
     InitializeComponent();
     if (basicReportViewModel != null)
     {
         ReportViewModel = basicReportViewModel;
         BindingContext  = basicReportViewModel;
         this.CloseWhenBackgroundIsClicked = true;
         this.BackgroundClicked           += BasicReportPopupView_BackgroundClicked;
     }
     else if (fullReportViewModel != null)
     {
         FullReportViewModel = fullReportViewModel;
         BindingContext      = fullReportViewModel;
         this.CloseWhenBackgroundIsClicked = true;
         this.BackgroundClicked           += FullReportPopupView_BackgroundClicked;
         if (Device.RuntimePlatform == Device.iOS)
         {
             ChildPopupView.Margin = new Thickness(0, 10, 0, 0);
         }
     }
     if (Device.RuntimePlatform != Device.Android)
     {
         Frame1.IsVisible          = childListview.IsVisible = true;
         childListview.ItemTapped += ChildItemTapped;
         AndroidFrame.IsVisible    = childCollectionView.IsVisible = false;
     }
     else
     {
         Frame1.IsVisible       = childListview.IsVisible = false;
         AndroidFrame.IsVisible = childCollectionView.IsVisible = true;
     }
 }
        public SelectOutputFormatPopupView(FullReportViewModel fullReportViewModel)
        {
            InitializeComponent();
            ReportViewModel = fullReportViewModel;
            BindingContext  = fullReportViewModel;
            this.CloseWhenBackgroundIsClicked = true;
            this.BackgroundClicked           += FullReportPopupView_BackgroundClicked;
            if (Device.RuntimePlatform == Device.Android)
            {
                ReportViewModel.SetOutputFormat();
                OutputFormatList.ItemsSource = ReportViewModel.OutputFormatTypeList;
                SetData();
            }
            OutputFormatList.ItemTapped += OutputFormatTypeItemTapped;

            if (Device.RuntimePlatform != Device.Android)
            {
                Frame1.IsVisible       = OutputFormatList.IsVisible = true;
                AndroidFrame.IsVisible = OutputFormatCollectionView.IsVisible = false;
            }
            else
            {
                Frame1.IsVisible       = OutputFormatList.IsVisible = false;
                AndroidFrame.IsVisible = OutputFormatCollectionView.IsVisible = true;
            }
        }
Пример #5
0
 public SelectScoresPopupView(FullReportViewModel fullReportViewModel)
 {
     InitializeComponent();
     ReportViewModel = fullReportViewModel;
     BindingContext  = fullReportViewModel;
     this.CloseWhenBackgroundIsClicked = true;
     this.BackgroundClicked           += FullReportPopupView_BackgroundClicked;
     ScoreListView.ItemTapped         += FullReportReportTypeItemTapped;
 }
Пример #6
0
        public FullReport()
        {
            InitializeComponent();
            this.CloseWhenBackgroundIsClicked = true;
            ReportViewModel           = new FullReportViewModel();
            BindingContext            = ReportViewModel;
            ReportViewModel.RunReport = false;

            LocationText.TextColor    = Colors.LightGrayColor;
            childText.TextColor       = Colors.LightGrayColor;
            batteryTypeText.TextColor = Colors.LightGrayColor;
            recordFormText.TextColor  = Colors.LightGrayColor;
            ReportTypeText.TextColor  = Colors.LightGrayColor;
        }
 public StandardDeviationPopUpView(FullReportViewModel fullReportViewModel)
 {
     InitializeComponent();
     ReportViewModel = fullReportViewModel;
     BindingContext  = fullReportViewModel;
     this.CloseWhenBackgroundIsClicked     = true;
     this.BackgroundClicked               += FullReportPopupView_BackgroundClicked;
     StandardDeviationListview.ItemTapped += StandardDeviationItemTapped;
     if (Device.RuntimePlatform != Device.Android)
     {
         Frame1.IsVisible       = StandardDeviationListview.IsVisible = true;
         AndroidFrame.IsVisible = StandardDeviationCollectionview.IsVisible = false;
     }
     else
     {
         Frame1.IsVisible       = StandardDeviationListview.IsVisible = false;
         AndroidFrame.IsVisible = StandardDeviationCollectionview.IsVisible = true;
     }
 }
 public SelectBatteryTypePopupView(BasicReportViewModel basicReportViewModel, FullReportViewModel fullReportViewModel)
 {
     InitializeComponent();
     if (basicReportViewModel != null)
     {
         ReportViewModel = basicReportViewModel;
         BindingContext  = basicReportViewModel;
         this.CloseWhenBackgroundIsClicked = true;
         this.BackgroundClicked           += BasicReportPopupView_BackgroundClicked;
         assesmentTypeListview.ItemTapped += AssessmentItemTapped;
         if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS)
         {
             assesmentTypeListview.RowHeight = 52;
         }
     }
     else
     {
         FullReportViewModel = fullReportViewModel;
         BindingContext      = fullReportViewModel;
         this.CloseWhenBackgroundIsClicked = true;
         this.BackgroundClicked           += FullReportPopupView_BackgroundClicked;
         assesmentTypeListview.ItemTapped += AssessmentItemTapped;
         if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS)
         {
             assesmentTypeListview.RowHeight = 50;
         }
         if (Device.RuntimePlatform == Device.iOS)
         {
             BatteryTypePopupView.Margin = new Thickness(0, 10, 0, 0);
         }
     }
     if (Device.RuntimePlatform != Device.Android)
     {
         Frame1.IsVisible       = assesmentTypeListview.IsVisible = true;
         AndroidFrame.IsVisible = assesmentTypeCollectionView.IsVisible = false;
     }
     else
     {
         Frame1.IsVisible       = assesmentTypeListview.IsVisible = false;
         AndroidFrame.IsVisible = assesmentTypeCollectionView.IsVisible = true;
     }
 }
Пример #9
0
        public SelectLocationPopupView(BasicReportViewModel basicReportViewModel = null, FullReportViewModel fullReportViewModel = null, List <string> SelectedLocations = null)
        {
            InitializeComponent();
            if (basicReportViewModel != null)
            {
                ReportViewModel = basicReportViewModel;
                BindingContext  = basicReportViewModel;
                this.CloseWhenBackgroundIsClicked   = true;
                LocationPopupView.Margin            = new Thickness(0, 0, 0, 0);
                LocationPopupView.VerticalOptions   = LayoutOptions.Center;
                LocationPopupView.HorizontalOptions = LayoutOptions.Center;
                this.BackgroundClicked           += BasicReportPopupView_BackgroundClicked;
                ReportViewModel.SelectedLocations = new List <string>();
                if (SelectedLocations != null)
                {
                    ReportViewModel.SelectedLocations = SelectedLocations;
                }
            }
            else if (fullReportViewModel != null)
            {
                FullReportViewModel = fullReportViewModel;
                BindingContext      = fullReportViewModel;
                this.CloseWhenBackgroundIsClicked     = true;
                this.BackgroundClicked               += FullReportPopupView_BackgroundClicked;
                FullReportViewModel.SelectedLocations = new List <string>();
                if (SelectedLocations != null)
                {
                    FullReportViewModel.SelectedLocations = SelectedLocations;
                }
                LocationPopupView.Margin            = new Thickness(0, 0, 0, 0);
                LocationPopupView.VerticalOptions   = LayoutOptions.Center;
                LocationPopupView.HorizontalOptions = LayoutOptions.Center;

                if (Device.RuntimePlatform == Device.iOS)
                {
                    LocationPopupView.Margin = new Thickness(0, 10, 0, 0);
                }
            }
        }
Пример #10
0
 public SelectProgramLabel(FullReportViewModel fullReportViewModel)
 {
     InitializeComponent();
     ReportViewModel = fullReportViewModel;
     BindingContext  = fullReportViewModel;
     this.CloseWhenBackgroundIsClicked = true;
     this.BackgroundClicked           += ProgramLabelPopupView_BackgroundClicked;
     if (Device.RuntimePlatform == Device.iOS)
     {
         SelectProgramLabelPopupView.Margin = new Thickness(0, 10, 0, 0);
     }
     if (Device.RuntimePlatform != Device.Android)
     {
         Frame1.IsVisible       = ProgramLabelListview.IsVisible = true;
         AndroidFrame.IsVisible = ProgramLabelCollectionview.IsVisible = false;
     }
     else
     {
         Frame1.IsVisible       = ProgramLabelListview.IsVisible = false;
         AndroidFrame.IsVisible = ProgramLabelCollectionview.IsVisible = true;
     }
 }
Пример #11
0
        public SelectReportType(FullReportViewModel fullReportViewModel)
        {
            InitializeComponent();
            ReportViewModel = fullReportViewModel;
            BindingContext  = fullReportViewModel;
            this.CloseWhenBackgroundIsClicked = true;
            this.BackgroundClicked           += FullReportPopupView_BackgroundClicked;
            ReportTypeListview.ItemTapped    += FullReportReportTypeItemTapped;
            if (Device.RuntimePlatform == Device.iOS)
            {
                ReportTypePopUp.Margin = new Thickness(0, 10, 0, 0);
            }

            if (Device.RuntimePlatform != Device.Android)
            {
                Frame1.IsVisible       = ReportTypeListview.IsVisible = true;
                AndroidFrame.IsVisible = ReportTypeCollectionView.IsVisible = false;
            }
            else
            {
                Frame1.IsVisible       = ReportTypeListview.IsVisible = false;
                AndroidFrame.IsVisible = ReportTypeCollectionView.IsVisible = true;
            }
        }
Пример #12
0
        public ActionResult ReportDetails(int page, string iD)
        {
            FullReportViewModel mainModel = new FullReportViewModel();
            HtmlToText          convert   = new HtmlToText();
            string LoggedInUser           = User.Identity.GetUserId();


            var SingleReport = _applicationDbContext.Reports
                               .Where(i => i.ReportId == page)
                               .Include(t => t.Topic).Include(c => c.Category).Include(r => r.ReportImages)
                               .Include(reb => reb.Rebuttals).Include(th => th.Threads)
                               .Include(upd => upd.ReportUpdates).Include(st => st.State).Include(ci => ci.City)
                               .Include(vi => vi.ReportVideos)/*.Include(l =>l.RipOffLegalTeams)*/
                               .SingleOrDefault();

            var rebuttalList         = new List <RebuttalViewModel>();
            var threadList           = new List <ThreadViewModel>();
            var rptUpdateList        = new List <ReportUpdateViewModel>();
            var caseUpdateList       = new List <RipOffCaseUpdateViewModel>();
            var rptImageList         = new List <ReportImageViewModel>();
            var rptVideoList         = new List <ReportVideoViewModel>();
            var commentList          = new List <CommentViewModel>();
            var legalList            = new List <RipOffLegalTeamViewModel>();
            var updateLegalList      = new List <LegalAdviceViewModel>();
            var relatedCompanyReport = new List <RelatedReportedCompanyViewModel>();


            if (SingleReport != null)
            {
                var User        = UserManager.FindByIdAsync(SingleReport.UserId);
                var ReportOwner = User.Result.NameExtension;

                mainModel.ReportId            = SingleReport.ReportId;
                mainModel.DisplayName         = ReportOwner;
                mainModel.CompanyorIndividual = SingleReport.CompanyorIndividual;
                mainModel.Website             = SingleReport.Website;
                mainModel.Email         = SingleReport.Email;
                mainModel.CategoryName  = SingleReport.Category.Name;
                mainModel.TopicName     = SingleReport.Topic.Name;
                mainModel.ContactNumber = SingleReport.ContactNumber;
                mainModel.Address       = SingleReport.Address;
                mainModel.Title         = SingleReport.Title;
                if (SingleReport.StateId != null || SingleReport.CityId != null)
                {
                    mainModel.CityName  = SingleReport.City.Name;
                    mainModel.StateName = SingleReport.State.Name;
                }
                else
                {
                    //Do nothing
                }
                //HtmlToText convert = new HtmlToText();

                mainModel.ReportText        = SingleReport.ReportText;
                mainModel.OnlineTransaction = SingleReport.OnlineTransaction;
                mainModel.CreditCard        = SingleReport.CreditCard;
                mainModel.ReportDateCreated = SingleReport.DateCreated.ToString("d,MMMM yy");
                mainModel.ReportTimeCreated = SingleReport.DateCreated.ToString("H:mm tt");


                var rebuttals = _applicationDbContext.Rebuttals.Where(r => r.ReportId == SingleReport.ReportId)
                                .Include(c => c.City).Include(s => s.State)
                                .OrderByDescending(d => d.DateCreated);


                foreach (var reb in rebuttals)
                {
                    var rebModel = new RebuttalViewModel();
                    var RebUser  = UserManager.FindByIdAsync(reb.UserId);
                    var RebOwner = RebUser.Result.NameExtension;

                    rebModel.RebuttalDisplayName = RebOwner;
                    rebModel.RebuttalTitle       = reb.Title;
                    rebModel.RebuttalAddress     = reb.Address;
                    rebModel.RebuttalText        = reb.RebuttalText;

                    if (reb.StateId != null || reb.CityId != null)
                    {
                        rebModel.RebuttalCity  = reb.City.Name;
                        rebModel.RebuttalState = reb.State.Name;
                    }

                    rebModel.RebuttalDateCreated = reb.DateCreated.ToString("d,MMMM yy");
                    rebModel.RebuttalTimeCreated = reb.DateCreated.ToString("H:mm tt");

                    rebuttalList.Add(rebModel);
                }
                if (LoggedInUser == null)
                {
                    LoggedInUser = "******";
                }
                else
                {
                    if (LoggedInUser.StartsWith(SingleReport.UserId))
                    {
                        mainModel.RebuttalAccess = true;
                    }
                }

                var thread = _applicationDbContext.Threads.Where(r => r.ReportId == SingleReport.ReportId)
                             .Include(com => com.Comments)
                             .OrderBy(d => d.DateCreated).ToList();

                foreach (var th in thread)
                {
                    var CommenterProfile = _applicationDbContext.UserProfilePhotos.SingleOrDefault(id => id.UserId == th.UserId);
                    var threadModel      = new ThreadViewModel();
                    var threadUser       = UserManager.FindByIdAsync(th.UserId);
                    var threadOwner      = threadUser.Result.NameExtension;

                    if (CommenterProfile == null)
                    {
                        threadModel.ThreadImageName = "person.gif";
                    }
                    else
                    {
                        threadModel.ThreadImageName = CommenterProfile.ImageName;
                    }

                    threadModel.ThreadDisplayName = threadOwner;
                    threadModel.ThreadId          = th.ThreadId;
                    threadModel.ThreadText        = th.ThreadText;
                    threadModel.ThreadDateCreated = th.DateCreated.ToString("d,MMMM yy");
                    threadModel.ThreadTimeCreated = th.DateCreated.ToString("H:mm tt");



                    foreach (Comment com in th.Comments.OrderBy(d => d.DateCreated))
                    {
                        var commentModel      = new CommentViewModel();
                        var ReplyDisplayImage = _applicationDbContext.UserProfilePhotos.SingleOrDefault(id => id.UserId == com.UserId);
                        if (ReplyDisplayImage == null)
                        {
                            commentModel.CommentImageName = "person.gif";
                        }
                        else
                        {
                            commentModel.CommentImageName = ReplyDisplayImage.ImageName;
                        }

                        commentModel.ThreadId           = com.ThreadId;
                        commentModel.CommentText        = com.CommentText;
                        commentModel.CommentDateCreated = com.DateCreated.ToString("d,MMMM yy");
                        commentModel.CommentTimeCreated = com.DateCreated.ToString("H:mm tt");

                        var commentUser  = UserManager.FindByIdAsync(com.UserId);
                        var commentOwner = commentUser.Result.NameExtension;
                        commentModel.CommentDisplayName = commentOwner;

                        commentList.Add(commentModel);
                    }

                    threadList.Add(threadModel);
                }

                IQueryable <ReportUpdate> update = _applicationDbContext.ReportUpdates.Where(r => r.ReportId == SingleReport.ReportId)
                                                   .Include(upd => upd.UpdateAdvices)
                                                   .OrderByDescending(d => d.DateCreated);
                foreach (var r in update)
                {
                    var rptUpdateModel = new ReportUpdateViewModel();

                    rptUpdateModel.ReportUpdateId          = r.ReportUpdateId;
                    rptUpdateModel.ReportUpdateDisplayName = ReportOwner;
                    rptUpdateModel.ReportUpdateText        = r.Update;
                    rptUpdateModel.ReportUpdateDateCreated = r.DateCreated.ToString("d,MMMM yy");
                    rptUpdateModel.ReportUpdateTimeCreated = r.DateCreated.ToString("H:mm tt");

                    foreach (UpdateAdvice upd in r.UpdateAdvices.OrderBy(d => d.DateCreated))
                    {
                        var updateLegalModel = new LegalAdviceViewModel();

                        updateLegalModel.UpdateAdvice   = upd.AdviseText;
                        updateLegalModel.ReportUpdateId = upd.ReportUpdateId;

                        updateLegalList.Add(updateLegalModel);
                    }

                    rptUpdateList.Add(rptUpdateModel);
                }

                IQueryable <ReportImage> image = _applicationDbContext.ReportImages.Where(r => r.ReportId == SingleReport.ReportId)
                                                 .OrderByDescending(d => d.DateCreated);
                foreach (var i in image)
                {
                    var rptImageModel = new ReportImageViewModel();

                    rptImageModel.ImageName        = i.ImageName;
                    rptImageModel.ImageCaption     = i.ImageCaption;
                    rptImageModel.ImageDateCreated = i.DateCreated;

                    rptImageList.Add(rptImageModel);
                }

                IQueryable <ReportVideo> video = _applicationDbContext.ReportVideos.Where(r => r.ReportId == SingleReport.ReportId)
                                                 .OrderByDescending(d => d.DateCreated);
                foreach (var v in video)
                {
                    var rptVideoModel = new ReportVideoViewModel();

                    rptVideoModel.VideoName        = v.VideoName;
                    rptVideoModel.VideoCaption     = v.VideoCaption;
                    rptVideoModel.VideoDateCreated = v.DateCreated;

                    rptVideoList.Add(rptVideoModel);
                }

                IQueryable <RipoffCaseUpdate> caseU = _applicationDbContext.RipoffCaseUpdates.Where(r => r.ApprovedLawyerRequest.LawyerRequest.ReportId == SingleReport.ReportId);
                if (caseU != null)
                {
                    foreach (var c in caseU)
                    {
                        mainModel.CaseUpdateExist = true;
                        var caseModel = new RipOffCaseUpdateViewModel();

                        caseModel.CaseUpdateText = c.UpdateText;


                        caseUpdateList.Add(caseModel);
                    }
                }
                else
                {
                    Exception ex;
                }

                IQueryable <RipOffLegalTeamAdvice> legalAdive = _applicationDbContext.RipOffLegalTeamAdvices.Where(m => m.ReportId == SingleReport.ReportId);
                if (legalAdive != null)
                {
                    foreach (var l in legalAdive)
                    {
                        var legalModel = new RipOffLegalTeamViewModel();
                        mainModel.LegalAdviceExist = true;

                        legalModel.LegalAdvice = convert.Convert(l.LegalAdvice);
                        legalModel.DateCreated = l.DateCreated;

                        legalList.Add(legalModel);
                    }
                }
                else
                {
                }

                string search = SingleReport.CompanyorIndividual;
                IQueryable <Report> reports = _applicationDbContext.Reports.Where(r => r.ReportText.ToLower().Contains(search) || r.Title.ToLower().Contains(search) || r.CompanyorIndividual.ToLower().Contains(search) || r.Website.ToLower().Contains(SingleReport.CompanyorIndividual) || r.Email.ToLower().Contains(SingleReport.CompanyorIndividual) || r.Address.ToLower().Contains(SingleReport.CompanyorIndividual))
                                              .OrderByDescending(d => d.DateCreated);

                foreach (var q in reports)
                {
                    RelatedReportedCompanyViewModel relModel = new RelatedReportedCompanyViewModel();

                    relModel.ReportText = convert.Convert(q.ReportText);
                    relModel.ReportId   = q.ReportId;

                    relatedCompanyReport.Add(relModel);
                }
            }


            string PageTitle    = SingleReport.CompanyorIndividual + " : " + convert.Convert(SingleReport.ReportText).Substring(0, 50);
            string sm_PageTitle = Regex.Replace(PageTitle, "[^A-Za-z0-9]", "-");

            mainModel.RebuttalViewModels               = rebuttalList;
            mainModel.ThreadViewModels                 = threadList;
            mainModel.ReportUpdateViewModels           = rptUpdateList;
            mainModel.ReportImageViewModels            = rptImageList;
            mainModel.ReportVideoViewModels            = rptVideoList;
            mainModel.CommentViewModels                = commentList;
            mainModel.RipOffLegalTeamViewModels        = legalList;
            mainModel.LegalAdviceViewModels            = updateLegalList;
            mainModel.RelatedReportedCompanyViewModels = relatedCompanyReport;

            ViewBag.PageTitle = sm_PageTitle;
            ViewBag.RandomId  = Guid.NewGuid().ToString();

            string rawUrl = this.Request.RawUrl.ToString();

            ViewBag.absoluteUrl = "https://www.ripoff.com.ng/" + rawUrl;

            return(View(mainModel));
        }