Beispiel #1
0
 public void ShowOrHidePoducts()
 {
     try
     {
         List <AnniversaryModel> memberList = null;
         Task.Factory.StartNew(() =>
         {
             ISyncServices syncService = new SyncServices();
             memberList = syncService.GetAnniversaryList();
         }).ContinueWith((obj) =>
         {
             Device.BeginInvokeOnMainThread(() =>
             {
                 if (memberList != null)
                 {
                     foreach (var item in memberList)
                     {
                         if (!string.Equals(item.merrageAnyver, "0000-00-00"))
                         {
                             MemberList.Add(item);
                         }
                     }
                     CreateGroupList();
                 }
             });
         });
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #2
0
        private void SendFeedback()
        {
            List <ChangePasswordModel> model = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                model = syncService.ChangePassword(txtCurrentPassword.Text, txtNewPassword.Text);
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (!ReferenceEquals(model, null))
                    {
                        DisplayAlert("Alert", model[0].msg, "Ok");
                        //App.Current.MainPage = new NavigationPage(new Views.MainPage());
                        App.Current.MainPage = new NavigationPage(new LoginPage());
                    }
                    else
                    {
                        // CommonHelpers.ShowAlert(model[0].messages);
                    }
                });
            });
        }
        private void BindImages()
        {
            List <SliderModel> memberList = null;

            Images.Clear();
            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                memberList = syncService.GetFooterSliderImages();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (memberList != null)
                    {
                        //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular success");
                        foreach (var item in memberList)
                        {
                            Images.Add(item);
                        }

                        MessagingCenter.Send <object>(this, "StartMoving");
                        //CircularList = new ObservableCollection<CircularModel>(circularList);
                    }
                });
            });
        }
 private void GetBearers()
 {
     try
     {
         List <NewsModel> bearersList = null;
         Task.Factory.StartNew(() =>
         {
             ISyncServices syncService = new SyncServices();
             bearersList = syncService.GetNews();
         }).ContinueWith((obj) =>
         {
             Device.BeginInvokeOnMainThread(() =>
             {
                 if (bearersList != null && bearersList.Count > 0)
                 {
                     var sorted = bearersList.OrderByDescending(d => d.added_on)
                                  .Select(x => x).ToList();
                     foreach (var item in sorted)
                     {
                         var convertedTime = DateTime.ParseExact(item.added_on, "dd-MM-yyyy", null);
                         var time          = convertedTime.ToString("D") + " | " + convertedTime.DayOfWeek;
                         item.added_on     = time;
                         NewsList.Add(item);
                     }
                 }
             });
         });
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #5
0
        private void GetMembers(string galleryId)
        {
            List <GalleryModel> memberList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                memberList = syncService.GetGalleryDetails(galleryId);
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (memberList != null)
                    {
                        //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular success");
                        foreach (var item in memberList)
                        {
                            if (string.IsNullOrEmpty(item.galleryPhoto))
                            {
                                item.galleryPhoto = "demo";
                            }
                            MemberList.Add(item);
                        }
                        //CircularList = new ObservableCollection<CircularModel>(circularList);
                    }
                });
            });
        }
Beispiel #6
0
        public void ShowOrHidePoducts()
        {
            try
            {
                List <BloodGroupModel> memberList = null;
                Task.Factory.StartNew(() =>
                {
                    ISyncServices syncService = new SyncServices();
                    memberList = syncService.GetBloodGroupList();
                }).ContinueWith((obj) =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        if (memberList != null)
                        {
                            // var sorted = memberList.OrderBy(d => Convert.ToDateTime(d.memBG)).ToList();


                            foreach (var item in memberList)
                            {
                                if (!string.IsNullOrEmpty(item.memBG))
                                {
                                    MemberList.Add(item);
                                }
                            }
                            //CircularList = new ObservableCollection<CircularModel>(circularList);
                        }
                        CreateGroupList();
                    });
                });
            }
            catch (Exception ex)
            {
            }
        }
        private void GetBearers()
        {
            List <WeeklyUpdatesModel> bearersList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                bearersList = syncService.GetWeeklyUpdates();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (bearersList != null)
                    {
                        foreach (var item in bearersList)
                        {
                            var date      = DateTime.ParseExact(item.added_on, "dd-MM-yyyy", null);
                            var time      = date.ToString("D") + " | " + date.DayOfWeek;
                            item.added_on = time;
                            UpdatesList.Add(item);
                        }
                    }
                });
            });
        }
Beispiel #8
0
        private void GetBearers()
        {
            List <GalleryModel> bearersList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                bearersList = syncService.GetGallery();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (bearersList != null)
                    {
                        foreach (var item in bearersList)
                        {
                            if (string.IsNullOrEmpty(item.galleryPhoto))
                            {
                                item.galleryPhoto = "demo";
                            }


                            GalleryList.Add(item);
                        }
                    }
                });
            });
        }
        private void GetBearers()
        {
            try
            {
                List <NotificationModel> bearersList = null;
                Task.Factory.StartNew(() =>
                {
                    ISyncServices syncService = new SyncServices();
                    bearersList = syncService.GetAllNotification();
                }).ContinueWith((obj) =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        if (bearersList != null)
                        {
                            bearersList = bearersList.OrderByDescending(d => DateTime.Parse(d.addedOn).Date)
                                          .Select(x => x).ToList();

                            foreach (var item in bearersList)
                            {
                                if (!string.IsNullOrEmpty(item.addedOn))
                                {
                                    item.addedOn = CommonHelpers.TimeAgo(DateTime.Parse(item.addedOn));
                                }
                                NotificationList.Add(item);
                            }
                        }
                    });
                });
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #10
0
        public void GetChoghadiya()
        {
            List <ChokadiyaModel> memberList = null;

            ChoghadiyaList.Clear();
            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                memberList = syncService.GetChoghadiya();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (memberList != null)
                    {
                        //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular success");
                        foreach (var item in memberList)
                        {
                            ChoghadiyaList.Add(item);
                        }
                        //CircularList = new ObservableCollection<CircularModel>(circularList);
                    }
                });
            });
        }
Beispiel #11
0
        public void BindImages()
        {
            try
            {
                List <SliderModel> memberList = null;


                Task.Factory.StartNew(() =>
                {
                    ISyncServices syncService = new SyncServices();
                    memberList = syncService.GetSliderImages();
                }).ContinueWith((obj) =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        if (memberList != null)
                        {
                            //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular success");
                            foreach (var item in memberList)
                            {
                                Images.Add(item);
                            }

                            MessagingCenter.Send <object>(this, "StartMoving");
                        }
                    });
                });
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #12
0
        void GetCircular()
        {
            //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular");

            List <CircularModel> circularList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                circularList = syncService.GetCircular();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (circularList != null)
                    {
                        //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular success");
                        foreach (var item in circularList)
                        {
                            item.cirName = item.cirName.ToUpper();
                            CircularList.Add(item);
                        }

                        //CircularList = new ObservableCollection<CircularModel>(circularList);
                    }
                });
            });
        }
        private void GetMembers()
        {
            List <MemberModel> memberList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                memberList = syncService.GetMembers();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (memberList != null)
                    {
                        //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular success");
                        memberList = memberList.OrderBy(x => x.memName).ToList();
                        foreach (var item in memberList)
                        {
                            if (string.IsNullOrEmpty(item.memPhoto))
                            {
                                item.memPhoto = "demo";
                            }
                            Items.Add(item);
                        }
                        MemberList = Items;
                        //CircularList = new ObservableCollection<CircularModel>(circularList);
                    }
                });
            });
        }
 public SearchProviderOrderViewModel()
 {
     providerService = new ProviderService();
     orderService    = new OrderService();
     Providers       = new ObservableCollection <Provider>();
     syncServices    = new SyncServices();
     PressButton     = PROVEEDOR;
 }
Beispiel #15
0
        void GetCircular(string memberId)
        {
            //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular");

            List <MembersDetailsModel> circularList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                circularList = syncService.GetMemberDetails(memberId);
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (circularList != null)
                    {
                        var memberDetails           = circularList[0];
                        lblMemberName.Text          = memberDetails.memName;
                        lblmarriageAnniversary.Text = memberDetails.merrageAnyver;
                        lblHusbandDob.Text          = memberDetails.dob_Husband;
                        lblWifeDob.Text             = memberDetails.dob_Wife;
                        lblOccupation.Text          = memberDetails.business;
                        lblOfficeAddress.Text       = memberDetails.businessAddr;
                        lblResidentialAddress.Text  = memberDetails.residenceAddr;
                        lblHusbandMobileNumber.Text = memberDetails.memMobile;
                        lblWifeMobileNumber.Text    = memberDetails.wifeContact;
                        lblResidenceContactNo.Text  = memberDetails.residenceNum;
                        lblEmail.Text           = memberDetails.email;
                        lblWebsite.Text         = memberDetails.website;
                        lblBGHusband.Text       = memberDetails.memBG;
                        lblBGWife.Text          = memberDetails.wifeBG;
                        lblOfficeContactNo.Text = memberDetails.businessNum;

                        if (string.IsNullOrEmpty(memberDetails.memPhoto))
                        {
                            imgMemberImage.Source = "demo";
                        }
                        else
                        {
                            imgMemberImage.Source = memberDetails.memPhoto;
                        }
                        if (!ReferenceEquals(memberDetails.child, null))
                        {
                            listview.FlowItemsSource = memberDetails.child;
                        }
                        //lblChildrenName.Text = memberDetails.;
                        //lblChildrenDob.Text = memberDetails.merrageAnyver;
                        //lblChildrenClass.Text = memberDetails.merrageAnyver;
                    }
                });
            });
        }
Beispiel #16
0
        public async Task Update_One_Attendant_In_EventBrite_Attended()
        {
            FillData(123456);

            await SyncServices.SyncEvent(_event.Id);

            var attendees = Context.Attendances.Include(x => x.Member).Where(x => x.EventId == _event.Id).ToList();

            var attended = attendees.FirstOrDefault(x => x.Member.MeetupId == 123456);

            attended.DidNotAttend.Should().BeFalse();
            attended.Attended.Should().BeTrue();
        }
        public CountViewModel(int?id)
        {
            countServices = new CountServices();
            syncServices  = new SyncServices();

            if (id == null)
            {
                LoadItems();
            }
            else
            {
                LoadDetailsPlan((int)id);
            }

            User = "******";
        }
        public CountViewModel(int?id)
        {
            Items.Clear();
            Details.Clear();
            DetailList.Clear();

            countServices = new CountServices();
            syncServices  = new SyncServices();

            //if (id == null)
            //    LoadItems();
            //else
            //    LoadDetailsPlan((int)id);

            User = "******";
        }
Beispiel #19
0
        public async Task Add_Two_New_Attendees_One_Attended_One_No_Attended()
        {
            FillData("*****@*****.**");

            await SyncServices.SyncEvent(_event.Id);

            var attendees = Context.Attendances.Include(x => x.Member).Where(x => x.EventId == _event.Id).ToList();

            var noAttended = attendees.FirstOrDefault(x => x.Member.Email == "*****@*****.**");
            var attended   = attendees.FirstOrDefault(x => x.Member.Email == "*****@*****.**");

            attendees.Count.Should().Be(3);
            noAttended.DidNotAttend.Should().BeTrue();

            attended.DidNotAttend.Should().BeFalse();
            attended.Attended.Should().BeTrue();
        }
Beispiel #20
0
        public async Task Not_Add_Member_With_The_Same_Email()
        {
            FillData("*****@*****.**");
            _event.Attendees.Add(new Attendance
            {
                Member = new Member
                {
                    Email = "*****@*****.**"
                },
                Attended = false
            });
            Context.SaveChanges();
            await SyncServices.SyncEvent(_event.Id);

            var attendees = Context.Attendances.Include(x => x.Member).Where(x => x.EventId == _event.Id).ToList();

            attendees.Count.Should().Be(3);
        }
        private void GetGroupIntro()
        {
            List <GroupIntroModel> groupIntroModel = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                groupIntroModel           = syncService.GetGroupIntro();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (groupIntroModel != null)
                    {
                        Description = groupIntroModel[0].groupDesc;
                    }
                });
            });
        }
Beispiel #22
0
        public async Task Add_Two_New_Attendees_One_Attended_One_No_Attended()
        {
            FillData(0000);

            await SyncServices.SyncEvent(_event.Id);

            RefreshContext();
            var attendees = Context.Attendances.Include(x => x.Member).Where(x => x.EventId == _event.Id).ToList();

            var noAttended = attendees.FirstOrDefault(x => x.Member.MeetupId == 1234567);
            var attended   = attendees.FirstOrDefault(x => x.Member.MeetupId == 123456);

            attendees.Count.Should().Be(4);
            noAttended.DidNotAttend.Should().BeTrue();
            noAttended.Member.Role.Should().Be(UserRole.Member);
            attended.Member.Role.Should().Be(UserRole.Member);
            attendees[2].Member.Role.Should().Be(UserRole.Member);
            attendees[3].Member.Role.Should().Be(UserRole.Member);
            attended.DidNotAttend.Should().BeFalse();
            attended.Attended.Should().BeTrue();
        }
        void GetBearerDetails(string bearerId)
        {
            BearersModel bearerModel = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                bearerModel = syncService.GetBearerDetails(bearerId);
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (bearerModel != null)
                    {
                        Name        = bearerModel.bearName;
                        Designation = bearerModel.bearDesination;
                        Description = bearerModel.bearDesc;
                        BearPhoto   = bearerModel.bearPhoto;
                    }
                });
            });
        }
Beispiel #24
0
        public void ShowOrHidePoducts()
        {
            try
            {
                List <BirthdayListModel> memberList = null;
                Task.Factory.StartNew(() =>

                {
                    ISyncServices syncService = new SyncServices();
                    memberList = syncService.GetBirthdayList();
                }).ContinueWith((obj) =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        if (memberList != null)
                        {
                            //var sorted = memberList.OrderByDescending(d => Convert.ToDateTime(d.merrageAnyver)).ToList();
                            //sorted.Reverse();
                            ////MvvmTest.Helpers.CommonHelpers.ShowAlert("circular success");
                            foreach (var item in memberList)
                            {
                                //var convertedTime = Convert.ToDateTime(item.merrageAnyver);
                                //var time = convertedTime.ToString("M");
                                //item.merrageAnyver = time;
                                if (!string.Equals(item.merrageAnyver, "0000-00-00"))
                                {
                                    Products.Add(item);
                                }
                            }
                            CreateGroupList();
                            //CircularList = new ObservableCollection<CircularModel>(circularList);
                        }
                    });
                });
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #25
0
        private void GetBearers()
        {
            List <BearersModel> bearersList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                bearersList = syncService.GetBearers();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (bearersList != null)
                    {
                        foreach (var item in bearersList)
                        {
                            BearersList.Add(item);
                        }
                    }
                });
            });
        }
Beispiel #26
0
        protected override void OnStarting(string[] args)
        {
            try
            {
                source = new CancellationTokenSource();

                task = Task.Factory.StartNew(() =>
                {
                    while (true)
                    {
                        SyncServices.RunService(_logger);
                        Thread.Sleep(30 * 60 * 1000);
                    }
                }, source.Token);
            }
            catch (Exception ex)
            {
                source.Cancel();
                _logger.LogError(ex, "OnStarting error");
            }
            _logger.LogDebug("OnStarting method called.");
            base.OnStarting(args);
        }
        public CountViewModel(int?id, string user)
        {
            Items.Clear();
            Details.Clear();
            DetailList.Clear();

            countServices = new CountServices();
            syncServices  = new SyncServices();



            if (id == null)
            {
                AsyncLoadItems(); //LoadItems();
            }
            else
            {
                IdPlan = (int)id;
                AsyncLoadDetailsPlan();
            }
            //LoadDetailsPlan((int)id);

            User = user;
        }
Beispiel #28
0
        private void SendFeedback()
        {
            bool ret = false;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                ret = syncService.SendFeedback(txtSubject.Text, txtFeedback.Text);
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (ret)
                    {
                        //App.Current.MainPage = new NavigationPage(new Views.MainPage());
                        App.Current.MainPage = new Views.MainPage();
                    }
                    else
                    {
                        CommonHelpers.ShowAlert("Failed to submit!");
                    }
                });
            });
        }
Beispiel #29
0
        void GetCircular()
        {
            //MvvmTest.Helpers.CommonHelpers.ShowAlert("circular");

            List <NotificationModel> circularList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                circularList = syncService.GetNotificationDetails(_memId);
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (circularList != null)
                    {
                        var memberDetails = circularList[0];
                        if (_name != null)
                        {
                            var array = _name.Split(new[] { "has" }, StringSplitOptions.None);
                            var name  = array[0];

                            if (_type.Equals("0"))
                            {
                                lblName.Text = "HAPPY ANNIVERSARY " + Environment.NewLine + name;
                            }
                            else if (_type.Equals("1"))
                            {
                                lblName.Text = "HAPPY BIRTHDAY " + Environment.NewLine + name;
                            }
                            else
                            {
                                lblName.Text = _event;
                            }
                        }
                        else
                        {
                            if (_type.Equals("0"))
                            {
                                lblName.Text = "HAPPY ANNIVERSARY " + Environment.NewLine + memberDetails.name;
                            }
                            else if (_type.Equals("1"))
                            {
                                lblName.Text = "HAPPY BIRTHDAY " + Environment.NewLine + memberDetails.name;
                            }
                            else
                            {
                                lblName.Text = memberDetails.@event;
                            }
                        }


                        lblMobile.Text = memberDetails.memMobile;



                        if (string.IsNullOrEmpty(memberDetails.memPhoto))
                        {
                            imgMember.Source = "demo";
                        }
                        else
                        {
                            imgMember.Source = memberDetails.memPhoto;
                        }
                    }
                });
            });
        }
Beispiel #30
0
        /// <summary>
        /// Logins the process.
        /// </summary>
        public void LoginProcess()
        {
            //MobileNumber = "9770789763";
            //Password = "******";

            if (IsValid())
            {
                List <LoginModel> loginModel = null;
                Task.Factory.StartNew(() =>
                {
                    ISyncServices syncService = new SyncServices();
                    loginModel = syncService.ValidateUser(MobileNumber, Password);
                }).ContinueWith((obj) =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        if (loginModel != null && loginModel.Count > 0)
                        {
                            //saving to local
                            DependencyService.Get <IPersistStoreServices>().SaveUserData(loginModel[0]);
                            CommonHelpers.UserId = loginModel[0].mobile;
                            App.Current.MainPage = new NavigationPage(new Views.MainPage());
                        }

                        else
                        {
                            CommonHelpers.ShowAlert(AppResources.ResourceManager.GetString("validationError"));
                        }
                    });
                });
            }
            else
            {
                CommonHelpers.ShowAlert(AppResources.ResourceManager.GetString("validationError"));
            }


            /// <summary>
            /// checks for
            /// Is the credentials are valid.
            /// </summary>
            /// <returns><c>true</c>, if valid was ised, <c>false</c> otherwise.</returns>
            bool IsValid()
            {
                bool isValid = true;

                if (string.IsNullOrEmpty(MobileNumber))
                {
                    isValid = false;
                }
                else
                {
                    if (MobileNumber.Length != 10)
                    {
                        CommonHelpers.ShowAlert(AppResources.ResourceManager.GetString("invalidMobileNoError"));
                        isValid = false;
                    }
                    else
                    {
                        isValid = true;
                    }
                }
                if (string.IsNullOrEmpty(Password))
                {
                    isValid = false;
                }

                return(isValid);
            }
        }