public void PrintList(object obj) { ReportDocument myReport4 = null; if (SelectedMember.LastSubscription == null || SelectedMember.LastSubscription.FacilitySubscription == null) { return; } //if (SelectedMember.LastSubscription.FacilitySubscription.FacilityId == 8) //Full myReport4 = new Reports.MemberID5(); //else if (SelectedMember.LastSubscription.FacilitySubscription.FacilityId == 2) //Gym With Sauna // myReport4 = new Reports.MemberID5(); //else if (SelectedMember.LastSubscription.FacilitySubscription.FacilityId == 6) //Gym and Aerobics // myReport4 = new Reports.MemberID3(); if (myReport4 != null) { myReport4.SetDataSource(GetListDataSet()); //MenuItem menu = obj as MenuItem; //if (menu != null) // new ReportUtility().DirectPrinter(myReport4); //else //{ var report = new ReportViewerCommon(myReport4); report.ShowDialog(); } //} }
private void ExecuteAddCheckCommand(object obj) { try { if (SelectedTransaction != null && SelectedBusinessPartner != null) { if (!string.IsNullOrEmpty(SelectedTransaction.FiscalNumber)) { SelectedTransaction.BusinessPartnerId = SelectedBusinessPartner.Id; _unitOfWork.Repository <TransactionHeaderDTO>().Update(SelectedTransaction); _unitOfWork.Commit(); var myReport = new SingleTransaction(); myReport.SetDataSource(GetListDataSet()); var report = new ReportViewerCommon(myReport); report.Show(); CloseWindow(obj); } else { MessageBox.Show("Fiscal Number can't be empty!"); } } } catch { MessageBox.Show("Got problem while getting Attachment!", "Attachment Problem"); } }
public void PrintTransaction(object obj) { var myReport = new SingleTransaction(); myReport.SetDataSource(GetListDataSet2()); var report = new ReportViewerCommon(myReport); report.Show(); }
public void PrintDelivery(object obj) { var myReport = new DeliveryForm(); myReport.SetDataSource(GetListDataSet()); var report = new ReportViewerCommon(myReport); report.Show(); }
private void Print() { LoadDeposits(); var myDataSet = new ReportDataSet(); var serNo = 1; var selectedCompany = new CompanyService(true).GetCompany(); string datecaption = ReportUtility.GetEthCalendar(FilterStartDate, true) + "(" + FilterStartDate.ToShortDateString() + ")"; if (FilterStartDate.Day != FilterEndDate.Day || FilterStartDate.Month != FilterEndDate.Month || FilterStartDate.Year != FilterEndDate.Year) { datecaption = "ከ " + datecaption + " እስከ " + ReportUtility.GetEthCalendar(FilterEndDate, true) + "(" + FilterEndDate.ToShortDateString() + ")"; } var returned = ""; if (SelectedCpoType.Value != 1) { returned = "የተመለሰበት ቀን"; } foreach (var rentalPaymentDTO in RentDeposits) { var rentee = rentalPaymentDTO.Contrat.Rentee.DisplayName; if (rentee.Length > 20) { rentee = rentee.Substring(0, 18) + "..."; } myDataSet.RentalPayment.Rows.Add( serNo, SelectedCpoType.Display, datecaption, rentalPaymentDTO.DepositedDateStringAmharicFormatted, rentalPaymentDTO.Contrat.Room.Number, rentee, "", 0.0, 0.0, 0.0, 0.0, 0.0, rentalPaymentDTO.TotalDepositAmount, rentalPaymentDTO.ReturnedDateStringAmharicFormatted, 0, 0.0, returned, "", "", "", selectedCompany.Header, null, ""); serNo++; } var myReport4 = new DepositList(); myReport4.SetDataSource(myDataSet); var report = new ReportViewerCommon(myReport4); report.Show(); }
public void PrintList(object obj) { var myReport4 = new TransactionItemsList(); myReport4.SetDataSource(GetListDataSet()); //MenuItem menu = obj as MenuItem; //if (menu != null) // new ReportUtility().DirectPrinter(myReport4); //else //{ var report = new ReportViewerCommon(myReport4); report.ShowDialog(); //} }
public void PrintList(IEnumerable <SubscriptionModel> list, MemberStatusTypes status) { var myReport4 = new Reports.Summary.NumberSummay(); myReport4.SetDataSource(GetNumberListDataSet(list.ToList(), status)); //MenuItem menu = obj as MenuItem; //if (menu != null) // new ReportUtility().DirectPrinter(myReport4); //else //{ var report = new ReportViewerCommon(myReport4); report.Show(); //} }
public void PrintDailySummaryList2(IEnumerable <SubscriptionModel> list) { var myReport4 = new Reports.MembersListLandscape(); var dSet = GetSummaryDataSet2(list); if (dSet == null) { return; } myReport4.SetDataSource(dSet); var report = new ReportViewerCommon(myReport4); report.Show(); }
public void GetAttachment(object obj) { var myReport = new SingleTransaction(); var dSet = GetAttachmentDataSet(); if (dSet == null) { MessageBox.Show("No Data found to display!"); } else { myReport.SetDataSource(dSet); var report = new ReportViewerCommon(myReport); report.Show(); } }
public void ExcuteViewDocumentCommand(object obj) { try { AttachmentDTO attachment = null; switch (SelectedTabItem.Name) { case "TabAgreement": attachment = SelectedRequiredDocument.AgreementAttachment; break; case "TabPassport": attachment = SelectedRequiredDocument.PassportAttachment; break; case "TabIdCard": attachment = SelectedRequiredDocument.IdCardAttachment; break; case "TabContactIdCard": attachment = SelectedRequiredDocument.ContactIdCardAttachment; break; case "TabFingerPrint": attachment = SelectedRequiredDocument.FingerPrintAttachment; break; case "TabMedical": attachment = SelectedRequiredDocument.MedicalAttachment; break; case "TabPreDeparture": attachment = SelectedRequiredDocument.PreDepartureAttachment; break; case "TabGradeEight": attachment = SelectedRequiredDocument.GradeEightAttachment; break; case "TabCoc": attachment = SelectedRequiredDocument.CocAttachment; break; case "TabInsurance": attachment = SelectedRequiredDocument.InsuranceAttachment; break; } if (attachment != null && attachment.AttachedFile != null) { if (SelectedTabItem.Name == "TabAgreement") { var pdfFilePath = Environment.SpecialFolder.MyDocuments + attachment.Id + ".pdf"; System.IO.File.WriteAllBytes(pdfFilePath, attachment.AttachedFile); System.Diagnostics.Process.Start(pdfFilePath); } else { var myDataSet = new ReportsDataSet(); myDataSet.LetterHeads.Rows.Add("1", attachment.AttachedFile, null, null, "", ""); var myReport = new AttachedDocument(); myReport.SetDataSource(myDataSet); var report = new ReportViewerCommon(myReport); report.ShowDialog(); } } } catch { } }
public void PrintSummaryList(object obj) { switch (ReportType) { case ReportTypes.PenalityOnly: case ReportTypes.ServiceOnly: case ReportTypes.RentOnly: case ReportTypes.PaymentList: { #region Payment List var selectedCompany = new CompanyService(true).GetCompany(); var datecaption = ReportUtility.GetDateCaption(FilterStartDate, FilterEndDate); var myDataSet = new ReportDataSet(); #region Criteria var criteria = new SearchCriteria <RentalPaymentDTO>(); if (FilterStartDate.Year > 2000 && FilterEndDate.Year > 2000) { criteria.CurrentUserId = Singleton.User.UserId; criteria.BeginingDate = FilterStartDate; criteria.EndingDate = FilterEndDate; } if (ReportType == ReportTypes.PaymentList) { criteria.FiList.Add(p => p.Type != PaymentTypes.ServiceWithRent); } if (ReportType == ReportTypes.RentOnly) { criteria.FiList.Add(p => p.Type == PaymentTypes.Rent); } if (ReportType == ReportTypes.ServiceOnly) { criteria.FiList.Add( p => p.Type == PaymentTypes.Service || p.Type == PaymentTypes.ServiceWithRent); } if (ReportType == ReportTypes.PenalityOnly) { criteria.FiList.Add(p => p.TotalPenalityAmount > 0); } #endregion var payments = new RentalPaymentService(true).GetAll(criteria).OrderBy(p => p.ReceiptDate).ToList(); var serNo = 1; #region For All Payments if (ReportType == ReportTypes.PaymentList) { foreach (var rentalPaymentDTO in payments) { var rentee = rentalPaymentDTO.Contrat.Rentee.DisplayName; if (rentee.Length > 20) { rentee = rentee.Substring(0, 18) + "..."; } myDataSet.RentalPayment.Rows.Add( serNo, "አጠቃላይ ከቤት ኪራይ,ከአገልግሎት,ከቅጣት የተሰበሰበ ገቢ", datecaption, rentalPaymentDTO.ReceiptDateStringAmharicFormatted, rentalPaymentDTO.Contrat.Room.Number, rentee, "", rentalPaymentDTO.TotalAmountRequiredBeforeVat, 0.0, 0.0, rentalPaymentDTO.TotalAmountRequiredVatAmount, 0.0, rentalPaymentDTO.TotalAmountRequired, rentalPaymentDTO.ReceiptNumber, 0 , 0.0, "", "", "", "", selectedCompany.Header, null, ""); serNo++; } } #endregion #region For Rent/Service Only Payments if (ReportType == ReportTypes.RentOnly || ReportType == ReportTypes.ServiceOnly) { foreach (var rentalPaymentDTO in payments) { var rentee = rentalPaymentDTO.Contrat.Rentee.DisplayName; if (rentee.Length > 20) { rentee = rentee.Substring(0, 18) + "..."; } myDataSet.RentalPayment.Rows.Add( serNo, "አጠቃላይ ከ" + EnumUtil.GetEnumDesc(ReportType) + " የተሰበሰበ ገቢ", datecaption, rentalPaymentDTO.ReceiptDateStringAmharicFormatted, rentalPaymentDTO.Contrat.Room.Number, rentee, "", rentalPaymentDTO.AmountRequiredBeforeVat, 0.0, 0.0, rentalPaymentDTO.AmountRequiredVatAmount, 0.0, rentalPaymentDTO.AmountRequired, rentalPaymentDTO.ReceiptNumber, 0 , 0.0, "", "", "", "", selectedCompany.Header, null, ""); serNo++; } } #endregion #region Penality Only if (ReportType == ReportTypes.PenalityOnly) { foreach (var rentalPaymentDTO in payments) { var rentee = rentalPaymentDTO.Contrat.Rentee.DisplayName; if (rentee.Length > 20) { rentee = rentee.Substring(0, 18) + "..."; } myDataSet.RentalPayment.Rows.Add( serNo, "አጠቃላይ ከ" + EnumUtil.GetEnumDesc(ReportType) + " የተሰበሰበ ገቢ", datecaption, rentalPaymentDTO.ReceiptDateStringAmharicFormatted, rentalPaymentDTO.Contrat.Room.Number, rentee, "", rentalPaymentDTO.TotalPenalityAmountBeforeVat, 0.0, 0.0, rentalPaymentDTO.TotalPenalityAmountVatAmount, 0.0, rentalPaymentDTO.TotalPenalityAmount, rentalPaymentDTO.ReceiptNumber, 0 , 0.0, "", "", "", "", selectedCompany.Header, null, ""); serNo++; } } #endregion var myReport4 = new PaymentList(); myReport4.SetDataSource(myDataSet); var report = new ReportViewerCommon(myReport4); report.Show(); #endregion } break; case ReportTypes.Discontinued: { #region Discontinued var criteria = new SearchCriteria <RentalContratDTO>(); if (FilterStartDate.Year > 2000 && FilterEndDate.Year > 2000) { criteria.BeginingDate = FilterStartDate; criteria.EndingDate = FilterEndDate; } var myDataSet = new ReportDataSet(); var serNo = 1; var selectedCompany = new CompanyService(true).GetCompany(); var payments = new RentalContratService(true).GetAll(criteria).ToList(); if (payments.Count == 0) { MessageBox.Show("No data found on the givenn duration"); return; } string datecaption = ReportUtility.GetEthCalendar(FilterStartDate, true) + "(" + FilterStartDate.ToShortDateString() + ")"; if (FilterStartDate.Day != FilterEndDate.Day || FilterStartDate.Month != FilterEndDate.Month || FilterStartDate.Year != FilterEndDate.Year) { datecaption = "ከ " + datecaption + " እስከ " + ReportUtility.GetEthCalendar(FilterEndDate, true) + "(" + FilterEndDate.ToShortDateString() + ")"; } foreach (var contratDTO in payments) { var rentee = contratDTO.Rentee.DisplayName; if (rentee.Length > 20) { rentee = rentee.Substring(0, 18) + "..."; } myDataSet.RentalPayment.Rows.Add( serNo, "የተቋረጡ ውሎች ዝርዝር", datecaption, contratDTO.LastContractDiscontinuedDateStringAmharic, contratDTO.Room.Number, rentee, "", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, "", 0 , 0.0, "", "", "", "", selectedCompany.Header, null, ""); serNo++; } var myReport4 = new ContractDiscontinued(); myReport4.SetDataSource(myDataSet); var report = new ReportViewerCommon(myReport4); report.Show(); #endregion } break; case ReportTypes.NotPaid: { #region NotPaid var criteria = new SearchCriteria <RoomDTO>(); criteria.FiList.Add(r => r.LastRentalPayment != null); var endDate = FilterEndDate.AddDays(-1); criteria.FiList.Add(p => p.LastRentalPayment.EndDate < endDate || (p.LastServicePayment != null && p.LastServicePayment.EndDate < endDate)); var myDataSet = new ReportDataSet(); var serNo = 1; var selectedCompany = new CompanyService(true).GetCompany(); var rooms = new RoomService(true).GetAll(criteria).ToList(); string datecaption = ReportUtility.GetEthCalendar(FilterStartDate, true) + "(" + FilterStartDate.ToShortDateString() + ")"; if (FilterStartDate.Day != FilterEndDate.Day || FilterStartDate.Month != FilterEndDate.Month || FilterStartDate.Year != FilterEndDate.Year) { datecaption = "ከ " + datecaption + " እስከ " + ReportUtility.GetEthCalendar(FilterEndDate, true) + "(" + FilterEndDate.ToShortDateString() + ")"; } foreach (var roomDTO in rooms) { var rentee = roomDTO.LastRentee.DisplayName; if (rentee.Length > 20) { rentee = rentee.Substring(0, 18) + "..."; } var overdueMonths = CommonUtility.GetMonthsFromDays(roomDTO.LastRentalPayment.EndDate, endDate); var fee = overdueMonths * roomDTO.RentalFee; if (roomDTO.LastServicePayment != null) { overdueMonths = CommonUtility.GetMonthsFromDays(roomDTO.LastServicePayment.EndDate, endDate); fee += overdueMonths * roomDTO.ServiceFee; } myDataSet.RentalPayment.Rows.Add( serNo, "መክፈል ሲገባቸው ያልከፈሉ", datecaption, roomDTO.LastRentalPayment.EndDateStringAmharic, roomDTO.Number, rentee, "", fee / (decimal)1.15, 0.0, 0.0, (fee / (decimal)1.15) * (decimal)0.15, 0.0, fee, roomDTO.LastRentalPayment.ReceiptNumber, 0 , 0.0, "", "", "", "ያበቃበት ቀን", selectedCompany.Header, null, ""); serNo++; } var myReport4 = new PaymentList2(); myReport4.SetDataSource(myDataSet); var report = new ReportViewerCommon(myReport4); report.Show(); #endregion } break; } }
public void AttendanceList(object obj) { var criteria = new SearchCriteria <MemberAttendanceDTO> { BeginingDate = FilterStartDate, EndingDate = FilterEndDate, IncludePhoto = false }; //if (SelectedMember != null && SelectedMember.Id != -1) // criteria.FiList.Add(f => f.MemberSubscription.MemberId == SelectedMember.Id); //if (SelectedFacility != null && SelectedFacility.Id != -1) // criteria.FiList.Add(f => f.MemberSubscription.FacilitySubscription.FacilityId == SelectedFacility.Id); //if (SelectedSubscription != null && SelectedSubscription.Id != -1) // criteria.FiList.Add( // f => f.MemberSubscription.FacilitySubscription.SubscriptionId == SelectedSubscription.Id); if (SelectedShiftType != null && SelectedShiftType.Value != 0) { if (SelectedShiftType.Value == 1) { criteria.Shift = ShiftTypes.Morning; } else if (SelectedShiftType.Value == 2) { criteria.Shift = ShiftTypes.Afternoon; } } IEnumerable <MemberAttendanceDTO> attendanceList = new MemberAttendanceService(true).GetAll(criteria).OrderBy(i => i.Id).ToList(); var cri = new SearchCriteria <PervisitSubscriptionDTO> { BeginingDate = FilterStartDate, EndingDate = FilterEndDate }; if (SelectedShiftType != null && SelectedShiftType.Value != 0) { if (SelectedShiftType.Value == 1) { cri.Shift = ShiftTypes.Morning; } else if (SelectedShiftType.Value == 2) { cri.Shift = ShiftTypes.Afternoon; } } var pervisitAttendanceList = new PervisitSubscriptionService(true).GetAll(cri).OrderBy(i => i.Id).ToList(); ReportDocument myReport4; var summary = new SummaryUtility(FilterStartDate, FilterEndDate, SelectedShiftType.Value); if (ReportType == ReportTypes.AttendanceList) { myReport4 = new Reports.AttendanceListGrouped(); myReport4.SetDataSource(summary.GetAttendanceListDataSet(attendanceList.ToList(), pervisitAttendanceList.ToList())); } else { myReport4 = new Reports.AttendanceList(); myReport4.SetDataSource(summary.GetAttendanceListSummarizedDataSet(attendanceList.ToList(), pervisitAttendanceList.ToList())); } var report = new ReportViewerCommon(myReport4); report.Show(); }