示例#1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string filterStudent     = "";
            string filterSalesPerson = "";

            HelpFilter hp = new HelpFilter();

            if (!this.txtStudent.Text.Trim().Equals(""))
            {
                filterStudent = "a.SStudentId = '" + this.txtStudent.Text.Trim() + "'";
            }
            else
            {
                filterStudent = hp.Get_Filter("a.SStudentId", DS_StudentRight);
            }

            if (!this.txtRepCode.Text.Trim().Equals(""))
            {
                filterSalesPerson = "e.SRepCode = '" + this.txtRepCode.Text.Trim() + "'";
            }
            else
            {
                filterSalesPerson = hp.Get_Filter("e.SRepCode", DS_SalesPersonRight);
            }

            //validate
            if (!filterStudent.Trim().Equals(""))
            {
                filterStudent = " and " + filterStudent;
            }

            if (!filterSalesPerson.Trim().Equals(""))
            {
                filterSalesPerson = " and " + filterSalesPerson;
            }

            string filterDate = " where a.DDate>='" + txtDateFrom.Value.ToShortDateString() + "' and a.DDate <= '" + txtDateTo.Value.ToShortDateString() + "'";

            DatabaseConnection dbCon  = new DatabaseConnection();
            string             cQuery = "Select a.SRefNo,a.DAddDate as DDate,c.SName,iif(SRepName is null,'NONE',SRepName) as SRepName,b.NAlloAmount,"
                                        + " a.SAddUser from File_PaymentH a "
                                        + " inner join File_PaymentD b on a.SRefNo = b.SRefNo inner join File_Student c on a.SStudentId = c.SStudentId "
                                        + " left join File_InvoiceH e on b.SInvNo = e.SRefNo left join File_SalesPerson d on d.SRepCode = e.SRepCode "
                                        + filterDate + " " + filterStudent + " " + filterSalesPerson;

            DataSet Payment_ListingDataSet = dbCon.Get_ReportData(cQuery, "DT_PaymentListing");

            Report_View newReport = new Report_View(GlobalVariables.ReportPath + "Rpt_Payment_Listing.rpt", Payment_ListingDataSet, "Payment Listing");

            if (Payment_ListingDataSet.Tables[0].Rows.Count > 0)
            {
                newReport.ShowInTaskbar = false;
                newReport.ShowDialog();
            }
            else
            {
                MessageBox.Show("No Data To Print");
            }
        }
示例#2
0
 public SendEmail(string FileName, Report_View NewReport, string studentId)
 {
     InitializeComponent();
     StartPosition             = FormStartPosition.CenterParent;
     newReport                 = NewReport;
     fileName                  = FileName;
     this.labelAttachment.Text = FileName;
     this.studentId            = studentId;
 }
示例#3
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DatabaseConnection dbCon          = new DatabaseConnection();
            DataSet            Report_DataSet = dbCon.Get_ReportData("Select * from File_Profile", "DT_Profile");

            try
            {
                Report_View openReport = new Report_View(GlobalVariables.ReportPath + "Rpt_CompanyProfile.rpt", Report_DataSet, "Profile");
                openReport.ShowInTaskbar = false;
                openReport.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void ReportViewLogin()
 {
     if (EmployeeName_TextBox.Text == "" && DMPID_TextBox.Text == "")
     {
         ListBox.Items.Add("Please Enter Your Name and DMP ID to Login");
     }
     else if (EmployeeName_TextBox.Text == "")
     {
         ListBox.Items.Add("Enter Employee Name to Login");
     }
     else if (DMPID_TextBox.Text == "")
     {
         ListBox.Items.Add("Enter DMP ID to Login");
     }
     else if (EmployeeName_TextBox.Text != "" && DMPID_TextBox.Text != "")
     {
         try
         {
             SqlConnection ReportLogin   = new SqlConnection(SQL_Connection);
             SqlCommand    Login_Command = new SqlCommand("Select * from [dbo].[Admin] where EmployeeName=@EmployeeName and DMPID=@DMPID", ReportLogin);
             Login_Command.Parameters.AddWithValue("@EmployeeName", EmployeeName_TextBox.Text);
             Login_Command.Parameters.AddWithValue("@DMPID", DMPID_TextBox.Text);
             ReportLogin.Open();
             SqlDataAdapter adapt = new SqlDataAdapter(Login_Command);
             DataSet        ds    = new DataSet();
             adapt.Fill(ds);
             LoginGridView.DataSource = ds.Tables[0];
             ReportLogin.Close();
             int count = ds.Tables[0].Rows.Count;
             if (count == 1)
             {
                 Report_View ReportView = new Report_View();
                 ReportView.User_TextBox.Text  = EmployeeName_TextBox.Text;
                 ReportView.Clock_TextBox.Text = Clock_TextBox.Text;
                 ReportView.DMPID_TextBox.Text = DMPID_TextBox.Text;
                 ListBox.Items.Clear();
                 ReportView.Show();
                 ReportView.Focus();
                 OpenNewForm();
             }
         }
         catch (Exception)
         {
             ListBox.Items.Add("Access to Report View Denied.");
         }
     }
 }
示例#5
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            HelpFilter hp = new HelpFilter();

            string filterStudent     = "";
            string filterCourse      = "";
            string filterSalesPerson = "";

            if (!this.txtStudent.Text.Trim().Equals(""))
            {
                filterStudent = "a.SStudentId = '" + this.txtStudent.Text.Trim() + "'";
            }
            else
            {
                filterStudent = hp.Get_Filter("a.SStudentId", DS_StudentRight);
            }

            if (!this.txtCourse.Text.Trim().Equals(""))
            {
                filterCourse = "b.SCourseCode = '" + this.txtCourse.Text.Trim() + "'";
            }
            else
            {
                filterCourse = hp.Get_Filter("b.SCourseCode", DS_CourseRight);
            }

            if (!this.txtRepCode.Text.Trim().Equals(""))
            {
                filterSalesPerson = "e.SRepCode = '" + this.txtRepCode.Text.Trim() + "'";
            }
            else
            {
                filterSalesPerson = hp.Get_Filter("e.SRepCode", DS_SalesPersonRight);
            }

            //validate
            if (!filterStudent.Trim().Equals(""))
            {
                filterStudent = " and " + filterStudent;
            }

            if (!filterCourse.Trim().Equals(""))
            {
                filterCourse = " and " + filterCourse;
            }

            if (!filterSalesPerson.Trim().Equals(""))
            {
                filterSalesPerson = " and " + filterSalesPerson;
            }

            DatabaseConnection dbCon  = new DatabaseConnection();
            string             cQuery = "select a.SRefNo,a.DDate,a.SStudentId,d.SName,b.SCourseCode,c.SCourseName,b.NAmount,"
                                        + "b.NDiscount,iif(SRepName is null, 'NONE', SRepName) as SRepName,a.SAddUser,a.DAddDate from "
                                        + " File_InvoiceH a inner join File_InvoiceD b on a.SRefNo = b.SRefNo inner join File_Course c on "
                                        + "b.SCourseCode = c.SCourseCode inner join File_Student d on d.SStudentId = a.SStudentId "
                                        + "left join File_SalesPerson e on e.SRepCode = a.SRepCode where a.DDate>='" + txtDateFrom.Value.ToShortDateString() + "' "
                                        + " and a.DDate<='" + txtDateTo.Value.ToShortDateString() + "' " + filterStudent + "  "
                                        + filterCourse + "  " + filterSalesPerson;

            DataSet Invoice_ListingDataSet = dbCon.Get_ReportData(cQuery, "DT_InvoiceListing");

            if (Invoice_ListingDataSet.Tables[0].Rows.Count > 0)
            {
                Report_View newReport = new Report_View(GlobalVariables.ReportPath + "Rpt_Invoice_Listing.rpt", Invoice_ListingDataSet, "Invoice Listing");
                newReport.ShowInTaskbar = false;
                newReport.ShowDialog();
            }
            else
            {
                MessageBox.Show("No Data To Print");
            }
        }
示例#6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            HelpFilter hp = new HelpFilter();

            string filterStudent = "";
            string filterCourse  = "";

            if (!this.txtStudent.Text.Trim().Equals(""))
            {
                filterStudent = "a.SStudentId = '" + this.txtStudent.Text.Trim() + "'";
            }
            else
            {
                filterStudent = hp.Get_Filter("a.SStudentId", DS_StudentRight);
            }

            if (!this.txtCourse.Text.Trim().Equals(""))
            {
                filterCourse = "c.SCourseCode = '" + this.txtCourse.Text.Trim() + "'";
            }
            else
            {
                filterCourse = hp.Get_Filter("c.SCourseCode", DS_CourseRight);
            }

            //validate
            if (!filterStudent.Trim().Equals(""))
            {
                filterStudent = " and " + filterStudent;
            }

            if (!filterCourse.Trim().Equals(""))
            {
                filterCourse = " and " + filterCourse;
            }

            string filterDate = " and a.DDate>='" + txtDateFrom.Value.ToShortDateString() + "' and a.DDate <= '" + txtDateTo.Value.ToShortDateString() + "'";

            DatabaseConnection dbCon = new DatabaseConnection();
            string             cQuery;

            if (this.radioButton1.Checked)
            {
                cQuery = "Select c.SCourseCode,SCourseName,a.SStudentId,SName,STelNo,SMobileNo,SEmail "
                         + " from File_InvoiceH a,File_InvoiceD e, File_Student b,File_Course c  where "
                         + " a.SStudentId = b.SStudentId and c.SCourseCode = e.SCourseCode and a.SRefNo = e.SRefNo "
                         + " and a.NBalanceAmount > 0 " + filterDate + " " + filterStudent + " " + filterCourse;
            }
            else
            {
                cQuery = "Select c.SCourseCode,SCourseName,a.SStudentId,SName,STelNo,SMobileNo,SEmail "
                         + " from File_InvoiceH a,File_InvoiceD e, File_Student b,File_Course c  where "
                         + " a.SStudentId = b.SStudentId and c.SCourseCode = e.SCourseCode and a.SRefNo = e.SRefNo "
                         + filterDate + " " + filterStudent + " " + filterCourse;
            }

            DataSet Student_CourseDataSet = dbCon.Get_ReportData(cQuery, "DT_StudentCourse");

            Report_View newReport = new Report_View(GlobalVariables.ReportPath + "Rpt_Student_Course.rpt", Student_CourseDataSet, "Invoice Listing");

            if (Student_CourseDataSet.Tables[0].Rows.Count > 0)
            {
                newReport.ShowInTaskbar = false;
                newReport.ShowDialog();
            }
            else
            {
                MessageBox.Show("No Valid Data To Print");
            }
        }
示例#7
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            HelpFilter hp = new HelpFilter();

            string filterStudent = "";
            string filterCourse  = "";

            if (!this.txtStudent.Text.Trim().Equals(""))
            {
                filterStudent = "a.SStudentId = '" + this.txtStudent.Text.Trim() + "'";
            }
            else
            {
                filterStudent = hp.Get_Filter("a.SStudentId", DS_StudentRight);
            }

            if (!this.txtCourse.Text.Trim().Equals(""))
            {
                filterCourse = "c.SCourseCode = '" + this.txtCourse.Text.Trim() + "'";
            }
            else
            {
                filterCourse = hp.Get_Filter("c.SCourseCode", DS_CourseRight);
            }

            //validate
            if (!filterStudent.Trim().Equals(""))
            {
                filterStudent = " and " + filterStudent;
            }

            if (!filterCourse.Trim().Equals(""))
            {
                filterCourse = " and " + filterCourse;
            }

            string filterDate = " and a.DDate='" + txtDateFrom.Value.ToShortDateString() + "' ";

            DatabaseConnection dbCon  = new DatabaseConnection();
            string             cQuery = "Select SRefNo,DDate,SName,SMobileNo from File_PaymentH a,File_Student b "
                                        + " where a.SStudentId = b.SStudentId  " + filterDate + filterStudent + filterCourse;

            DataSet Student_PaymentDataSet = dbCon.Get_ReportData(cQuery, "DT_StudentPayment");

            Report_View newReport = new Report_View(GlobalVariables.ReportPath + "Rpt_Student_Payment.rpt", Student_PaymentDataSet, "Student Payment Listing");

            if (Student_PaymentDataSet.Tables[0].Rows.Count > 0)
            {
                newReport.ShowInTaskbar = false;
                newReport.ShowDialog();

                //Email
                DialogResult dRes = MessageBox.Show("Do You Want To Email This Report?", "Confirm", MessageBoxButtons.YesNo);
                if (dRes == DialogResult.Yes)
                {
                    string    studentId = this.txtStudent.Text.Trim();
                    SendEmail newMail   = new SendEmail("Rpt_Student_Payment.pdf", newReport, studentId);
                    newMail.ShowInTaskbar = false;
                    newMail.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("No Valid Data To Print");
            }
        }