Пример #1
0
        private async void BtnFamilyFillFrid_Click(object sender, RoutedEventArgs e)
        {
            MembersService members = new MembersService();

            list = await members.GetMembersByHouseWise();

            MemberDatagridview.ItemsSource = list.Take(numberOfRecPerPage);
            int count = list.Take(numberOfRecPerPage).Count();

            lblPageNumber.Content = count + " of " + list.Count;
            TotalNoPeople totalNoPeople = new TotalNoPeople();

            totalNoPeople.NoMales   = list.Where(x => x.Sex == "M").Count().ToString();
            totalNoPeople.NoFemales = list.Where(x => x.Sex == "F").Count().ToString();
            this.DataContext        = totalNoPeople;
            FillType = 3;
        }
Пример #2
0
        private async void BtnCreatePdf_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MembersService members        = new MembersService();
                List <Members> headmemberlist = await members.GetMembersByHeadOfTheFamily();

                List <Members> memberlist = await members.GetMembersByHouseWise();

                DataTable table = new DataTable();
                table = ToDataTable <Members>(memberlist);

                ReportGenerator.CrystalReport.crptMainPage crpt = new ReportGenerator.CrystalReport.crptMainPage();
                //crpt.Subreports[0].SetDataSource(table);
                crpt.Database.Tables["HeadOfTheHouse"].SetDataSource(headmemberlist);
                crpt.Database.Tables["HouseMembers"].SetDataSource(memberlist);


                crvReport.ViewerCore.ReportSource = crpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }



            //crvReport.ViewerCore.RefreshReport();

            //  string partyType = null;
            //  if (btnBjp.IsChecked==true)
            //  {
            //      PdfCreation pdf = new PdfCreation();
            //      partyType = "BJP";
            //      pdf.GeneratePage(partyType);
            //  }
            //else  if (btnCongress.IsChecked==true)
            //  {
            //      PdfCreation pdf = new PdfCreation();
            //      partyType = "CONGRESS";
            //      pdf.GeneratePage(partyType);
            //  }
            //  else{
            //      MessageBox.Show("Please select Party Type");
            //  }
        }