private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varObject = new
            {
                LoansCount              = LoansCountLabel.Content,
                LoansAmount             = LoansAmountLabel.Content,
                PayedLoansCount         = PayedLoansCountLabel.Content,
                PayedLoansAmount        = PayedLoansAmountLabel.Content,
                InstallmentsCount       = InstallmentsCountLabel.Content,
                InstallmentsAmount      = InstallmentsAmountLabel.Content,
                PayedInstallmentsCount  = PayedInstallmentsCountLabel.Content,
                PayedInstallmentsAmount = PayedInstallmentsAmountLabel.Content,
            };

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.FundBalanceReport);

            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("FundBalance", Utility.CurrentFund.Balance.ToRialStringFormat());

            oStiReport.RegBusinessObject("MemberBalance", varObject);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();

            oStiReport.DoAction(action: reportType, fileName: "تراز مالی " + Utility.CurrentMember.FullName.ToString());
        }
Пример #2
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList = (InstallmentPerLoanGridControl.ItemsSource as System.Collections.Generic.List <ViewModels.InstallmentViewModel>)
                          .Select(current => new
            {
                current.AmountRialFormat,
                current.PersianInstallmentDate,
                current.PersianPaymentDate,
                current.IsPayedDescription,
            })
                          .ToList();

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.InstallmentListReport);

            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("MemberName", Utility.CurrentLoan.Member.FullName.ToString());
            oStiReport.Dictionary.Variables.Add("LoanAmount", (new ViewModels.LoanViewModel {
                LoanAmount = Utility.CurrentLoan.LoanAmount
            }).LoanAmountRialFormat);
            oStiReport.Dictionary.Variables.Add("RefundAmount", (new ViewModels.LoanViewModel {
                RefundAmount = Utility.CurrentLoan.RefundAmount
            }).RefundAmountRialFormat);

            oStiReport.RegBusinessObject("InstallmentsList", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();
            oStiReport.DoAction(action: reportType, fileName: "گزارش لیست اقساط");
        }
Пример #3
0
        public static void DoAction(this Stimulsoft.Report.StiReport report, Infrastructure.Report.ExportType action, string fileName = null)
        {
            switch (action)
            {
            case Infrastructure.Report.ExportType.Print:
            {
                report.Print();
                break;
            }

            case Infrastructure.Report.ExportType.ExportToPDF:
            {
                report.ExportToPdf(fileName);
                break;
            }

            case Infrastructure.Report.ExportType.SaveAsImage:
            {
                report.ExportToImage(fileName);
                break;
            }

            case Infrastructure.Report.ExportType.Show:
            {
                report.ShowWithWpfRibbonGUI();
                break;
            }

            default:
                break;
            }
        }
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList =
                (GridControl.ItemsSource as System.Collections.Generic.List <ViewModels.MemberTransactionViewModel>)
                .OrderBy(current => current.Date)
                .Select(current => new
            {
                current.AmountRialFormat,
                current.PersianDate,
                current.TransactionDescription,
            })
                .ToList();

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.MemberTransactionsReport);
            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("MemberName", Utility.CurrentMember.FullName.ToString());
            oStiReport.RegBusinessObject("Transactions", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();
            oStiReport.DoAction(action: reportType, fileName: "گزارش واریز اعضا");
        }
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            DAL.UnitOfWork oUnitOfWork = null;

            try
            {
                oUnitOfWork = new DAL.UnitOfWork();

                var varList = oUnitOfWork.UserRepository
                              .Get()
                              .OrderBy(current => current.Username)
                              .Select(current => new ViewModels.UserViewModel()
                {
                    Id                = current.Id,
                    Username          = current.Username,
                    RegisterationDate = current.RegisterationDate,
                    IsAdmin           = current.IsAdmin,
                    LastLoginTime     = current.LastLoginTime,
                })
                              .ToList();

                var varListToReport = varList
                                      .OrderBy(current => current.Username)
                                      .Select(current => new
                {
                    Username = current.Username,
                    PersianRegisterationDate = current.PersianRegisterationDate,
                    IsAdminDescription       = current.IsAdminDescription,
                    PersianLastLoginTime     = current.PersianLastLoginTime,
                })
                                      .ToList();

                Stimulsoft.Report.StiReport usersReport = new Stimulsoft.Report.StiReport();

                usersReport.Load(Properties.Resources.UsersViewReport);
                usersReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
                usersReport.RegBusinessObject("Users", varListToReport);
                usersReport.Compile();
                usersReport.RenderWithWpf();

                usersReport.DoAction(reportType, "گزارش کاربران");

                oUnitOfWork.Save();
            }
            catch (System.Exception ex)
            {
                Infrastructure.MessageBox.Show(ex.Message);
            }
            finally
            {
                if (oUnitOfWork != null)
                {
                    oUnitOfWork.Dispose();
                    oUnitOfWork = null;
                }
            }
        }
Пример #6
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            DAL.UnitOfWork oUnitOfWork = null;

            try
            {
                oUnitOfWork = new DAL.UnitOfWork();

                var varList = oUnitOfWork.InstallmentRepository
                              .Get()
                              .Where(current => current.Loan.Member.FundId == Utility.CurrentFund.Id)
                              .Where(current => current.IsPayed == false)
                              .GroupBy(current => current.Loan.MemberId)
                              .Select(installment => new ViewModels.DebtorViewModel()
                {
                    DebtAmount = installment
                                 .Sum(current => current.PaymentAmount),

                    FullName = installment
                               .Select(current => current.Loan.Member.FullName)
                               .FirstOrDefault(),

                    NextPaymentDate = installment
                                      .Where(current => current.InstallmentDate >= System.DateTime.Now)
                                      .OrderBy(current => current.InstallmentDate)
                                      .Select(current => current.InstallmentDate)
                                      .FirstOrDefault(),

                    InstallmentCount = installment
                                       .Count(),
                })
                              .Select(current => new
                {
                    DebtAmount      = current.DebtAmount.ToRialStringFormat(),
                    FullName        = current.FullName.ToString(),
                    LastPaymentDate = ((System.DateTime)current.NextPaymentDate).ToPersianDate(),
                    current.InstallmentCount,
                })
                              .ToList();

                oUnitOfWork.Save();
            }
            catch (System.Exception ex)
            {
                System.Windows.MessageBox.Show(ex.Message);
            }
            finally
            {
                if (oUnitOfWork != null)
                {
                    oUnitOfWork.Dispose();
                    oUnitOfWork = null;
                }
            }
        }
Пример #7
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList = (MembersLoanGridControl.ItemsSource as System.Collections.Generic.List <ViewModels.LoanViewModel>)
                          .OrderBy(current => current.StartDate)
                          .Select(current => new
            {
                current.LoanAmountRialFormat,
                current.RefundAmountRialFormat,
                current.PersianEndDate,
                current.PersianStartDate,
                current.InstallmentsCount,
                current.IsPayedDescrption,
                current.Description,
            })
                          .ToList();

            if (varList.Count == 0)
            {
                Infrastructure.MessageBox.Show
                (
                    caption: Infrastructure.MessageBox.Caption.Error,
                    text: "اطلاعاتی برای تهیه گزارش در جدول موجود نمی‌باشد. "
                );

                return;
            }

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.MembersLoansListReport);

            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("MemberName", Utility.CurrentMember.FullName.ToString());
            oStiReport.Dictionary.Variables.Add("LoanStatus", LoanStatusComboBox.Text);
            oStiReport.RegBusinessObject("Loans", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();

            string fileName = string.Format("گزارش {0} {1}", LoanStatusComboBox.Text, Utility.CurrentMember.FullName.ToString());

            oStiReport.DoAction(action: reportType, fileName: fileName);
        }
Пример #8
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList = (LoansGridControl.ItemsSource as System.Collections.Generic.List <Models.Loan>)
                          .OrderBy(current => current.StartDate)
                          .Select(current => new ViewModels.LoanViewModel()
            {
                IsPayed           = current.IsPayed,
                IsActive          = current.IsActive,
                LoanAmount        = current.LoanAmount,
                RefundAmount      = current.RefundAmount,
                EndDate           = current.EndDate,
                StartDate         = current.StartDate,
                InstallmentsCount = current.InstallmentsCount,
                MemberId          = current.MemberId,
            })
                          .Select(current => new
            {
                current.LoanAmountRialFormat,
                current.RefundAmountRialFormat,
                current.PersianEndDate,
                current.PersianStartDate,
                current.InstallmentsCount,
                current.IsPayedDescrption,
                FullName = current.FullName.ToString(),
            })
                          .ToList();

            ;


            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.ConfirmedLoansListReport);

            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.RegBusinessObject("Loans", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();

            oStiReport.DoAction(action: reportType, fileName: "گزارش وام‌های پرداختی");
        }
Пример #9
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList =
                (GridControl.ItemsSource as System.Collections.Generic.List <ViewModels.TransactionViewModel>)
                .OrderBy(current => current.Date)
                .Select(current => new
            {
                current.AmountRialFormat,
                current.BalanceRialFormat,
                current.PersianDate,
                current.TransactionDescription,
                MemberFullName = current.MemberFullName.ToString(),
            })
                .ToList();

            if (varList.Count == 0)
            {
                Infrastructure.MessageBox.Show
                (
                    caption: Infrastructure.MessageBox.Caption.Error,
                    text: "اطلاعاتی برای تهیه گزارش در جدول موجود نمی‌باشد. " + System.Environment.NewLine + "لطفا بازه زمانی دیگری را انتخاب نمایید."
                );

                return;
            }

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.TransactionsReport);
            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("FromDate", varList.Select(current => current.PersianDate).FirstOrDefault());
            oStiReport.Dictionary.Variables.Add("ToDate", varList.Select(current => current.PersianDate).LastOrDefault());
            oStiReport.RegBusinessObject("Transactions", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();
            oStiReport.DoAction(action: reportType, fileName: "گزارش ریز حساب صندوق");
        }
Пример #10
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            DAL.UnitOfWork oUnitOfWork = null;

            try
            {
                oUnitOfWork = new DAL.UnitOfWork();

                var varList = oUnitOfWork.MemberRepository
                              .MembersToReport()
                              .ToList();

                Stimulsoft.Report.StiReport oReport = new Stimulsoft.Report.StiReport();

                oReport.Load(Properties.Resources.MembersViewReport);
                oReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
                oReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
                oReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
                oReport.RegBusinessObject("Members", varList);
                oReport.Compile();
                oReport.RenderWithWpf();
                oReport.DoAction(reportType, string.Format("گزارش اعضا ({0}) ", Utility.CurrentFund.Name));

                oUnitOfWork.Save();
            }
            catch (System.Exception ex)
            {
                Infrastructure.MessageBox.Show(ex.Message);
            }
            finally
            {
                if (oUnitOfWork != null)
                {
                    oUnitOfWork.Dispose();
                    oUnitOfWork = null;
                }
            }
        }
Пример #11
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            DAL.UnitOfWork oUnitOfWork = null;

            try
            {
                oUnitOfWork = new DAL.UnitOfWork();

                Models.Member oMember = oUnitOfWork.MemberRepository
                                        .GetById(CurrentId);

                ViewModels.MembershipCardViewModel oViewModel =
                    new ViewModels.MembershipCardViewModel();

                oViewModel.FirstName      = oMember.FullName.FirstName;
                oViewModel.LastName       = oMember.FullName.LastName;
                oViewModel.FatherName     = oMember.FatherName;
                oViewModel.Gender         = oMember.Gender;
                oViewModel.NationalCode   = oMember.NationalCode;
                oViewModel.EmailAddress   = oMember.EmailAddress;
                oViewModel.FundName       = oMember.Fund.Name;
                oViewModel.PhoneNumber    = oMember.PhoneNumber;
                oViewModel.MembershipDate = oMember.MembershipDate;

                if (oMember.Picture != null)
                {
                    System.IO.MemoryStream oMemoryStream = new System.IO.MemoryStream(oMember.Picture);
                    System.Drawing.Image   oImage        = System.Drawing.Image.FromStream(oMemoryStream);
                    oViewModel.Picture = oImage;
                }
                else
                {
                    System.Drawing.Image oImage = Properties.Resources.ImageNull;
                    oViewModel.Picture = oImage;
                }

                var varData =
                    new
                {
                    FirstName             = oViewModel.FirstName,
                    LastName              = oViewModel.LastName,
                    Picture               = oViewModel.Picture,
                    FatherName            = oViewModel.FatherName,
                    GenderDescription     = oViewModel.GenderDescription,
                    FundName              = oViewModel.FundName,
                    PhoneNumber           = oViewModel.PhoneNumber,
                    PersianMembershipDate = oViewModel.PersianMembershipDate,
                    EmailAddress          = oViewModel.EmailAddress,
                    NationalCode          = oViewModel.NationalCode,
                };

                oStiReport.Load(Properties.Resources.MembershipCardReport);
                oStiReport.RegBusinessObject("MembershipCard", varData);
                oStiReport.Compile();
                oStiReport.RenderWithWpf();

                oStiReport.DoAction(reportType, string.Format("{0} {1}", "کارت عضویت", oMember.FullName.FirstName + "" + oMember.FullName.LastName));

                oUnitOfWork.Save();
            }
            catch (System.Exception ex)
            {
                Infrastructure.MessageBox.Show(ex.Message);;
            }
            finally
            {
                if (oUnitOfWork != null)
                {
                    oUnitOfWork.Dispose();
                    oUnitOfWork = null;
                }
            }
        }
Пример #12
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            DAL.UnitOfWork oUnitOfWork = null;

            try
            {
                oUnitOfWork = new DAL.UnitOfWork();

                var varList = (MembersGridControl.ItemsSource as System.Collections.Generic.List <Models.Member>)
                              .Where(current => current.FundId == Utility.CurrentFund.Id)
                              .OrderBy(current => current.FullName.LastName)
                              .ThenBy(current => current.FullName.FirstName)
                              .Select(current => new ViewModels.MemberViewModel()
                {
                    Id             = current.Id,
                    EmailAddress   = current.EmailAddress,
                    FatherName     = current.FatherName,
                    FullName       = current.FullName,
                    Gender         = current.Gender,
                    MembershipDate = current.MembershipDate,
                    NationalCode   = current.NationalCode,
                    PhoneNumber    = current.PhoneNumber,
                    Picture        = current.Picture,
                })
                              .ToList();

                var varMembersToReport = varList
                                         .Select(current => new
                {
                    FullName = current.MemberName,
                    Gender   = current.GenderDescription,
                    current.FatherName,
                    MembershipDate = current.PersianMembershipDate,
                    current.NationalCode,
                    current.PhoneNumber,
                    current.EmailAddress,
                    current.Image,
                })
                                         .ToList();

                Stimulsoft.Report.StiReport oReport = new Stimulsoft.Report.StiReport();

                string genderTitle = (GenderComboBox.SelectedIndex == 2) ? "اعضای خانم صندوق" : (GenderComboBox.SelectedIndex == 1) ? "اعضای آقا عضو صندوق" : "همه اعضای صندوق";

                oReport.Load(Properties.Resources.MembersListReport);
                oReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
                oReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
                oReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
                oReport.Dictionary.Variables.Add("Gender", genderTitle);
                oReport.RegBusinessObject("Members", varMembersToReport);
                oReport.Compile();
                oReport.RenderWithWpf();
                oReport.DoAction(reportType, string.Format("گزارش اعضا ({0}) ", Utility.CurrentFund.Name));

                oUnitOfWork.Save();
            }
            catch (System.Exception ex)
            {
                Infrastructure.MessageBox.Show(ex.Message);
            }
            finally
            {
                if (oUnitOfWork != null)
                {
                    oUnitOfWork.Dispose();
                    oUnitOfWork = null;
                }
            }
        }
 private void ShowReport(Infrastructure.Report.ExportType reportType)
 {
 }