public ucPrintSearchedViolationTicket(MainWindow mainWnd, ViolationTicket violtnTickt, bool is_from_vio, Object usercont) { InitializeComponent(); m_MainWindow = mainWnd; violationTicketDetials = violtnTickt; Is_Violation_Listing = is_from_vio; this.user_Control_Old = usercont; }
private void btnPrintRecipt_Click_1(object sender, RoutedEventArgs e) { try { if (grdViolationDetails.SelectedItem == null) return; DisplayObject selcted_Violation_data = (DisplayObject)grdViolationDetails.SelectedItem; if (selcted_Violation_data == null) return; ViolationTicket vioaltion_ticket_data = new ViolationTicket(); vioaltion_ticket_data.ViolationID = selcted_Violation_data.ViolationID; // vioaltion_ticket_data.vi = selcted_Violation_data.ViolationSeverityAr; vioaltion_ticket_data.DateTime = selcted_Violation_data.IssueDate; vioaltion_ticket_data.LocaitonAr = ((VSDApp.com.rta.vsd.hh.data.Violation)(selcted_Violation_data)).Inspection_locationAr; vioaltion_ticket_data.Location = ((VSDApp.com.rta.vsd.hh.data.Violation)(selcted_Violation_data)).Inspection_location; vioaltion_ticket_data.VehicleDetials = selcted_Violation_data.VehicleDetail; vioaltion_ticket_data.VehicleDetailsAr = selcted_Violation_data.VehicleDetail; vioaltion_ticket_data.DefectDetails = selcted_Violation_data.DefectDetails; vioaltion_ticket_data.DriverLicNo = selcted_Violation_data.DriverLicNo; vioaltion_ticket_data.RtaEmpNo = selcted_Violation_data.RtaEmpID; vioaltion_ticket_data.ViolationAdviceAr = selcted_Violation_data.ViolationCommentsAr; vioaltion_ticket_data.PlateNumber = selcted_Violation_data.PlateNumber; vioaltion_ticket_data.PlateCode = selcted_Violation_data.PlateCode; vioaltion_ticket_data.PlateCategory = selcted_Violation_data.PlateCategory; string[] info; info = ((IViolation)ViolationManager.GetInstance()).GetConfigurationDataForSeverity(selcted_Violation_data.ViolationSeverity, vioaltion_ticket_data.DefectDetails.Length); if (info != null) { vioaltion_ticket_data.ViolationAdvice = info[4]; vioaltion_ticket_data.ViolationAdviceAr = info[5]; } /////////////////////////////////// /* string violation_id = selcted_Violation_data.ViolationID; string violation_severity = selcted_Violation_data.ViolationSeverity; string violation_severityAr = selcted_Violation_data.ViolationSeverityAr; string date_time = selcted_Violation_data.IssueDate; string inspection_LocationAr = ((VSDApp.com.rta.vsd.hh.data.Violation)(selcted_Violation_data)).Inspection_locationAr; string inspection_Location = ((VSDApp.com.rta.vsd.hh.data.Violation)(selcted_Violation_data)).Inspection_location; string vehicle_detials = selcted_Violation_data.VehicleDetail; string defect_code = selcted_Violation_data.DefectDetails[0].DefectCode; // selcted_Violation_data.DefectDetails[0]._defecNameAr string defect_name = selcted_Violation_data.DefectDetails[0].DefectName; string defect_nameAr = selcted_Violation_data.DefectDetails[0].DefectNameAr; string defect_severity = selcted_Violation_data.DefectDetails[0].DefectSeverity; string defect_severityAr = selcted_Violation_data.DefectDetails[0].DefectSeverityAr; string defect_coments = selcted_Violation_data.DefectDetails[0].DefectValue; */ this.m_MainWindow.MainContentControl.Content = null; this.m_MainWindow.MainContentControl.Content = new ucPrintSearchedViolationTicket(this.m_MainWindow, vioaltion_ticket_data, true, this); // this.grdViolationDetails.ItemsSource = violationData_Saved; } catch (Exception ex) { CommonUtils.WriteLog(ex.StackTrace); WPFMessageBox.Show(new CommonUtils().GetStringValue("Exception"), ex.Message, ex.StackTrace, WPFMessageBoxButtons.OK, WPFMessageBoxImage.Error); } }
private void btnPrintRecipt_Click_1(object sender, RoutedEventArgs e) { if (grdViolationDetails.SelectedItem == null) return; DisplayObject selcted_Violation_data = (DisplayObject)grdViolationDetails.SelectedItem; if (selcted_Violation_data == null) return; ViolationTicket vioaltion_ticket_data = new ViolationTicket(); vioaltion_ticket_data.ViolationID = selcted_Violation_data.ViolationID; // vioaltion_ticket_data.vi = selcted_Violation_data.ViolationSeverityAr; vioaltion_ticket_data.DateTime = selcted_Violation_data.IssueDate; vioaltion_ticket_data.LocaitonAr = ((VSDApp.com.rta.vsd.hh.data.Violation)(selcted_Violation_data)).Inspection_locationAr; vioaltion_ticket_data.Location = ((VSDApp.com.rta.vsd.hh.data.Violation)(selcted_Violation_data)).Inspection_location; vioaltion_ticket_data.VehicleDetials = selcted_Violation_data.VehicleDetail; vioaltion_ticket_data.VehicleDetailsAr = selcted_Violation_data.VehicleDetail; vioaltion_ticket_data.DefectDetails = selcted_Violation_data.DefectDetails; vioaltion_ticket_data.DriverLicNo = selcted_Violation_data.DriverLicNo; vioaltion_ticket_data.RtaEmpNo = selcted_Violation_data.RtaEmpID; vioaltion_ticket_data.ViolationAdviceAr = selcted_Violation_data.ViolationCommentsAr; vioaltion_ticket_data.PlateNumber = selcted_Violation_data.PlateNumber; vioaltion_ticket_data.PlateCode = selcted_Violation_data.PlateCode; vioaltion_ticket_data.PlateCategory = selcted_Violation_data.PlateCategory; string[] info; info = ((IViolation)ViolationManager.GetInstance()).GetConfigurationDataForSeverity(selcted_Violation_data.ViolationSeverity, vioaltion_ticket_data.DefectDetails.Length); if (info != null) { vioaltion_ticket_data.ViolationAdvice = info[4]; vioaltion_ticket_data.ViolationAdviceAr = info[5]; } this.m_mainWindow.MainContentControl.Content = null; this.m_mainWindow.MainContentControl.Content = new ucPrintSearchedViolationTicket(this.m_mainWindow, vioaltion_ticket_data, false, this); }