Exemplo n.º 1
0
        private void btnPrint_Click(object sender, System.EventArgs e)
        {
            DoProcessCourseTabChanging(true);
               // doSaveEvents(GetCurrentEventID((TabPage)pnlEvent.Parent));
              //  SaveEventData(ref _eventid_Initial);
            #region Intializing Values to Lists
            ArrayList arrLabel = new ArrayList();

            ArrayList arrLabel1 = new ArrayList();

            ArrayList arrValue1 = new ArrayList();
            ArrayList arrValue2 = new ArrayList();
            ArrayList arrValue3 = new ArrayList();
            ArrayList arrValue4 = new ArrayList();

            arrLabel.Add("------");
            arrLabel.Add("Name");
            arrLabel.Add("Name Phonetic");
            arrLabel.Add("Name Romaji");
            arrLabel.Add("Abbreviated Name");
            arrLabel.Add("Class Event");
            arrLabel.Add("Client");
            arrLabel.Add("Department");
            arrLabel.Add("Program");
            arrLabel.Add("Job Type");
            arrLabel.Add("Status");
            arrLabel.Add("------");
            arrLabel.Add("Test Initial");
            arrLabel.Add("Test Mid-term");
            arrLabel.Add("Test Final");
            arrLabel.Add("------");
            arrLabel.Add("Break Minutes");
            arrLabel.Add("No. of Students");
            arrLabel.Add("Homework Minutes");
            arrLabel.Add("Test Initial Form");
            arrLabel.Add("Test Mid-term Form");
            arrLabel.Add("Test Final Form");

            arrLabel.Add("------");
            arrLabel.Add("Description");
            arrLabel.Add("------");
            arrLabel.Add("Special Remarks");
            arrLabel.Add("------");
            arrLabel.Add("Curriculum");

            ArrayList arrValues = new ArrayList();
            arrValues.Add("------");
            arrValues.Add(txtCourseName.Text);
            arrValues.Add(txtNamePhonetic.Text);
            arrValues.Add(txtNameRomaji.Text);
            arrValues.Add(txtNickName.Text);
            arrValues.Add(llblEvent.Text);
            arrValues.Add(cmbClient.Text);
            arrValues.Add(cmbDept.Text);
            arrValues.Add(cmbProgram.Text);
            arrValues.Add(cmbCourseType.Text);
            arrValues.Add(cmbStatus.Text);
            arrValues.Add("------");
            arrValues.Add(llblInitialEvt.Text);
            arrValues.Add(llblMidEvt.Text);
            arrValues.Add(llblFinalEvt.Text);
            arrValues.Add("------");

            arrValues.Add(textBoxBreakDuration.Text);
            arrValues.Add(txtNumberStudents.Text);
            arrValues.Add(txtHomeWorkMinutes.Text);

            arrValues.Add(txtInitialForm.Text);
            arrValues.Add(txtMidtermForm.Text);
            arrValues.Add(txtFinalForm.Text);

            arrValues.Add("RICHTEXT");
            arrValues.Add(txtDescription.Text);
            arrValues.Add("RICHTEXT");
            arrValues.Add(txtRemarks.Text);
            arrValues.Add("RICHTEXT");
            arrValues.Add(txtCurriculam.Text);

            //Event//
            arrLabel1.Add("------");
            arrLabel1.Add("Name");
            arrLabel1.Add("Name Phonetic");
            arrLabel1.Add("Name Romaji");
            arrLabel1.Add("Start Date");
            arrLabel1.Add("End Date");
            //arrLabel1.Add("Recurrence");
            arrLabel1.Add("Location");
            arrLabel1.Add("Block");
            arrLabel1.Add("Room No.");
            arrLabel1.Add("Is Holiday");
            arrLabel1.Add("Date Completed");
            arrLabel1.Add("Status");
            arrLabel1.Add("Scheduled Instructor");
            arrLabel1.Add("Real Instructor");
            arrLabel1.Add("Instructor Change Reason");
            arrLabel1.Add("Exception Reason");
            arrLabel1.Add("Description");
            arrLabel1.Add("Note");

            //get the event data
            if(eventid[0]>0)
            {
                //SaveAllEvents(eventid[0]);
                LoadEvent(eventid[0], ref arrValue1);

            }
            if(eventid[1]>0)
            {
                //SaveAllEvents(eventid[1]);
                LoadEvent(eventid[1], ref arrValue2);
            }
            if(eventid[2]>0)
            {
                //SaveAllEvents(eventid[2]);
                LoadEvent(eventid[2], ref arrValue3);
            }
            if(eventid[3]>0)
            {
                //SaveAllEvents(eventid[3]);
                LoadEvent(eventid[3], ref arrValue4);
            }

            #endregion
            //nm = new NormalPrinting(arrLabel, arrValues, arrLabel1, arrValue1, arrValue2, arrValue3, arrValue4, printDocument1);
            devNormalPrinting = new DevNormalPrinting(arrLabel, arrValues, arrLabel1, arrValue1, arrValue2, arrValue3, arrValue4, printingSystem);
            devNormalPrinting.Label1ForeColor = label1.ForeColor;
            //xtraPrinting = new DevExpressPrinting(arrLabel, arrValues, arrLabel1, arrValue1, arrValue2, arrValue3, arrValue4, printingSystem);

            //classPrinting = new DevExpressClassPrinting(printingSystem,arrLabel, arrValues, arrLabel1, arrValue1, arrValue2, arrValue3, arrValue4);
             //   nm.PageNumber = 1;
            devNormalPrinting.PageNumber = 1;
            //xtraPrinting.PageNumber = 1;
            devNormalPrinting.RowCount = 0;
            //nm.RowCount = 0;
            //xtraPrinting.
               //xtraPrinting.DrawClass
            //classPrinting.label1ForeColor = label1.ForeColor;
            //classPrinting.ShowPreview();
            devNormalPrinting.RTitle = "Class Information";
            devNormalPrinting.PaperKind = PaperKind.A4;
            devNormalPrinting.CreateDocument();
            devNormalPrinting.PrintingSystem.PreviewFormEx.ShowDialog();
               // PrintClassDetails();
            //printingSystem.
            //printingSystem.PreviewFormEx.Show();
            //Helpers.PreviewRibbonForm frm = new Scheduler.Helpers.PreviewRibbonForm();
            //frm.MyPrintingSystem = printingSystem;
            //frm.Show();

               // this.printPreviewDialog1.ShowDialog();
            //if (this.printPreviewDialog1.ShowDialog() == DialogResult.OK)
            {
            }
        }
Exemplo n.º 2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            #region Initializaing Values
            ArrayList arrLabel = new ArrayList();

            ArrayList arrLabel1 = new ArrayList();
            ArrayList arrLabel2 = new ArrayList();
            ArrayList arrLabel3 = new ArrayList();

            ArrayList arrValue1 = new ArrayList();
            ArrayList arrValue2 = new ArrayList();
            ArrayList arrValue3 = new ArrayList();

            arrLabel.Add("------");
            arrLabel.Add("Name");
            arrLabel.Add("Name Phonetic");
            arrLabel.Add("Name Romaji");
            arrLabel.Add("Abbreviated Name");
            arrLabel.Add("Client");
            arrLabel.Add("Department");
            arrLabel.Add("Contact1");
            arrLabel.Add("Contact2");
            arrLabel.Add("Billing");
            arrLabel.Add("Status");
            arrLabel.Add("------");
            arrLabel.Add("Test Initial");
            arrLabel.Add("Test Initial Form");
            arrLabel.Add("Test Mid-term");
            arrLabel.Add("Test Mid-term Form");
            arrLabel.Add("Test Final");
            arrLabel.Add("Test Final Form");
            arrLabel.Add("------");
            arrLabel.Add("Report Attendance");
            arrLabel.Add("Evaluation Mid-term Form");
            arrLabel.Add("Evaluation Final Form");
            arrLabel.Add("Questionnaire Mid-term Form");
            arrLabel.Add("Questionnaire Final Form");
            arrLabel.Add("------");
            arrLabel.Add("Description");
            arrLabel.Add("------");
            arrLabel.Add("Special Remarks");

            ArrayList arrValues = new ArrayList();
            arrValues.Add("------");
            arrValues.Add(txtProgramName.Text);
            arrValues.Add(txtNamePhonetic.Text);
            arrValues.Add(txtNameRomaji.Text);
            arrValues.Add(txtNickName.Text);
            arrValues.Add(cmbClient.Text);
            arrValues.Add(cmbDept.Text);
            arrValues.Add(cmbContact1.Text);
            arrValues.Add(cmbContact2.Text);
            arrValues.Add(cmbBilling.Text);
            arrValues.Add(cmbStatus.Text);
            arrValues.Add("------");
            arrValues.Add(llblInitialEvt.Text);
            arrValues.Add(txtInitialForm.Text);
            arrValues.Add(llblMidEvt.Text);
            arrValues.Add(txtMidtermForm.Text);
            arrValues.Add(llblFinalEvt.Text);
            arrValues.Add(txtFinalForm.Text);
            arrValues.Add("------");

            string sReportAttendance = string.Empty;
            if (rbtnNone.Checked)
                sReportAttendance = "None";
            else if (rbtnWeekly.Checked)
                sReportAttendance = "Weekly";
            else if (rbtnMonthly.Checked)
                sReportAttendance = "Monthly";
            else if (rbtnEnd.Checked)
                sReportAttendance = "End";
            else
                sReportAttendance = "None";

            arrValues.Add(sReportAttendance);
            arrValues.Add(txtEvaluationMidtermForm.Text);
            arrValues.Add(txtEvaluationFinalForm.Text);
            arrValues.Add(txtQuestionaireMidtermForm.Text);
            arrValues.Add(txtQuestionaireFinalForm.Text);
            arrValues.Add("RICHTEXT");
            arrValues.Add(txtDescription.Text);
            arrValues.Add("RICHTEXT");
            arrValues.Add(txtRemarks.Text);

            //Event//
            arrLabel1.Add("------");
            /*
            arrLabel1.Add("Name");
            arrLabel1.Add("Name Phonetic");
            arrLabel1.Add("Name Romaji");
            arrLabel1.Add("Start Date");
            arrLabel1.Add("End Date");
            //arrLabel1.Add("Recurrence");
            arrLabel1.Add("Location");
            arrLabel1.Add("Block");
            arrLabel1.Add("Room No.");
            arrLabel1.Add("Is Holiday");
            arrLabel1.Add("Date Completed");
            arrLabel1.Add("Billing");
            arrLabel1.Add("Status");
            arrLabel1.Add("Scheduled Instructor");
            arrLabel1.Add("Real Instructor");
            arrLabel1.Add("Instructor Change Reason");
            arrLabel1.Add("Exception Reason");
            arrLabel1.Add("Description");
            arrLabel1.Add("Note");
            */

            foreach (string s in arrLabel1)
            {
                arrLabel2.Add(s);
                arrLabel3.Add(s);
            }
            #endregion
            //get the event data
            /*
            if (eventid[0] > 0)
                LoadEvent(eventid[0], ref arrValue1);
            if (eventid[1] > 0)
                LoadEvent(eventid[1], ref arrValue2);
            if (eventid[2] > 0)
                LoadEvent(eventid[2], ref arrValue3);

            */
            //nm = new NormalPrinting(arrLabel, arrValues, arrLabel1, arrValue1, arrValue2, arrValue3, printDocument1);
               // printingSystem1 = new DevExpress.XtraPrinting.PrintingSystem();

            xnm = new DevNormalPrinting(arrLabel, arrValues, arrLabel1, arrValue1, arrValue2, arrValue3, printingSystem1);

            //nm.PageNumber = 1;
            //nm.RowCount = 0;

            xnm.PageNumber = 1;
            xnm.RowCount = 0;
            xnm.PaperKind = PaperKind.A4;
            xnm.RTitle = "Program Information";
            xnm.PrintingSystem.PageMargins.Top = 100;
            xnm.PrintingSystem.PageSettings.TopMargin = 100;
            xnm.PrintingSystem.PageSettings.Margins.Top = 100;

            xnm.CreateDocument();
            xnm.PrintingSystem.PreviewFormEx.ShowDialog();
            //if (printPreviewDialog1.ShowDialog() == DialogResult.OK) {}
        }