Ejemplo n.º 1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            using (var db = new LetranIntegratedSystemEntities())
            {
                var period    = Convert.ToInt32(cbPeriod.SelectedValue);
                var sem       = Convert.ToInt32(cbSemester.SelectedValue);
                var rt        = Convert.ToInt32(cbReportType.SelectedValue);
                var educlevel = Convert.ToInt32(cbEducLevel.SelectedValue);
                var sy        = Convert.ToInt32(cbSchoolYear.SelectedValue);
                var reportID  = Convert.ToInt32(cbReportType.SelectedValue);

                //var periodid = db.Periods.Where(m => m.SchoolYearID == sy && m.EducLevelID == educlevel).FirstOrDefault();
                // var periodkey = periodid.PeriodID;

                if (educlevel == 4 || educlevel == 3)
                {
                    if (reportID == 4)
                    {
                        PrintWindow x = new PrintWindow();
                        x.rptid  = 33;
                        x.period = period;
                        x.ShowDialog();
                    }
                    else if (reportID == 3 || reportID == 2)
                    {
                        PrintWindow x = new PrintWindow();
                        x.rptid  = 31;
                        x.period = period;
                        x.ShowDialog();
                    }
                    else if (reportID == 5)
                    {
                        PrintWindow x = new PrintWindow();
                        x.rptid  = 34;
                        x.period = period;
                        x.ShowDialog();
                    }
                }
                //if (reportID == 1)
                //{
                //  PrintWindow x = new PrintWindow();

                //x.rptid = 32;
                //x.period = period;
                //x.sem = sem;
                //x.ShowDialog();

                //}
                // else if (reportID == 2 || reportID == 3)
                //{
                //   PrintWindow x = new PrintWindow();

                //  x.rptid = 31;
                // x.period = period;

                // x.ShowDialog();
                //  }
            }
        }
Ejemplo n.º 2
0
        private void btnprint_Click(object sender, RoutedEventArgs e)
        {
            var         x  = ((HRiSClass.PostTrainingList)dgPostTraining.SelectedItem);
            PrintWindow pw = new PrintWindow();

            pw.rptid  = 24;
            pw.PostID = x.PostTrainingID;
            pw.ShowDialog();
        }
Ejemplo n.º 3
0
        private void btnprint_Click(object sender, RoutedEventArgs e)
        {
            var         x  = ((HRiSClass.OffCampusActivityList)dgOffCampus.SelectedItem);
            PrintWindow pw = new PrintWindow();

            pw.rptid = 23;
            pw.OffID = x.OffCampusActivityID;
            pw.ShowDialog();
        }
Ejemplo n.º 4
0
        private void btnprint_Click(object sender, RoutedEventArgs e)
        {
            var         x  = ((HRiSClass.NoticeOfAbscenceList)dgNoticeOfAbscence.SelectedItem);
            PrintWindow pw = new PrintWindow();

            pw.rptid = 20;
            pw.NOAID = x.NoticeAbsenceID;
            pw.ShowDialog();
        }
Ejemplo n.º 5
0
        private void btnprint_Click(object sender, RoutedEventArgs e)
        {
            var         x  = ((HRiSClass.SubstituteClassList)dgSubstitute.SelectedItem);
            PrintWindow pw = new PrintWindow();

            pw.rptid = 26;
            pw.SubID = x.SubstituteClassID;
            pw.ShowDialog();
        }
Ejemplo n.º 6
0
        private void btnprint_Click(object sender, RoutedEventArgs e)
        {
            var         x  = ((HRiSClass.OvertimeRequestList)dgOTReq.SelectedItem);
            PrintWindow pw = new PrintWindow();

            pw.rptid      = 21;
            pw.OvertimeID = x.OTID;
            pw.ShowDialog();
        }
Ejemplo n.º 7
0
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            var         x  = ((HRiSClass.LeaveCancellationList)dgLeaveCancel.SelectedItem);
            PrintWindow pw = new PrintWindow();

            pw.rptid = 18;
            pw.LeaveCancellationID = x.LeaveCancelID;
            pw.ShowDialog();
        }
Ejemplo n.º 8
0
        private void btnprint_Click(object sender, RoutedEventArgs e)
        {
            var         x  = ((HRiSClass.MakeUpClassList)dgMakeUp.SelectedItem);
            PrintWindow pw = new PrintWindow();

            pw.rptid    = 25;
            pw.MakeupID = x.MakeUpClassID;
            pw.ShowDialog();
        }
Ejemplo n.º 9
0
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            var         x  = ((HRiSClass.ChangeVacationLeaveList)dgChangeVL.SelectedItem);
            PrintWindow pw = new PrintWindow();

            pw.rptid      = 19;
            pw.ChangeVLID = x.VLID;
            pw.ShowDialog();
        }
Ejemplo n.º 10
0
 private void btnPrintRpt_Click(object sender, RoutedEventArgs e)
 {
     if (EGList.Count > 0)
     {
         PrintWindow x = new PrintWindow();
         x.rptid    = 15;
         x.Report15 = EGList;
         x.ShowDialog();
     }
     else
     {
         MessageBox.Show("List cannot be empty.", "System Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
 private void btnPrintRpt_Click(object sender, RoutedEventArgs e)
 {
     if (SEPSList.Count > 0)
     {
         PrintWindow x = new PrintWindow();
         x.rptid           = 16;
         x.SisPerSchedList = SEPSList;
         x.SisComList      = SCList;
         x.ShowDialog();
     }
     else
     {
         MessageBox.Show("List cannot be empty.", "System Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
 public void PrintApplicant(int appid)
 {
     try
     {
         using (var db = new LetranIntegratedSystemEntities())
         {
             PrintWindow pw = new PrintWindow();
             pw.rptid         = 27;
             pw.ApplicationID = appid;
             pw.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Something went wrong.", "System Error!", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Ejemplo n.º 13
0
        private void btnPrint_Click_1(object sender, RoutedEventArgs e)
        {
            Mouse.OverrideCursor = Cursors.Wait;


            if (dpStartDate.SelectedDate == null || dpEndDate.SelectedDate == null)
            {
                MessageBox.Show("Date fields cannot be empty.", "System Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                Mouse.OverrideCursor = Cursors.Arrow;
                return;
            }

            if (rbDesignation.IsChecked == false && rbDepartment.IsChecked == false && rbEmployeeName.IsChecked == false)
            {
                MessageBox.Show("Date fields cannot be empty.", "System Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                Mouse.OverrideCursor = Cursors.Arrow;
                return;
            }

            using (var db = new LetranIntegratedSystemEntities())
            {
                var startDate     = dpStartDate.SelectedDate.Value.ToShortDateString();
                var endDate       = dpEndDate.SelectedDate.Value.ToShortDateString();
                var reporttype    = cbReportType.Text;
                var empid         = Convert.ToInt32(cbEmployee.SelectedValue);
                var deptid        = Convert.ToInt32(cbDepartment.SelectedValue);
                var designationid = Convert.ToInt32(cbDesignation.SelectedValue);
                List <Model.Employee>        employees = new List <Model.Employee>();
                List <GetEmployeeDTR_Result> lresult   = new List <GetEmployeeDTR_Result>();

                var    department = db.AcademicDepartments.Where(m => m.AcaDeptID == deptid).FirstOrDefault();
                string dept;
                if (department == null)
                {
                    dept = cbDesignation.Text;
                }
                else
                {
                    dept = department.AcaDepartmentName;
                }
                if (rbDepartment.IsChecked == true)
                {
                    employees = db.Employees.Where(m => m.EmployeeDepartmentID == deptid && m.EmployeeDepartmentID != null && m.bioid != null && m.Archive == false).ToList();
                }
                else if (rbEmployeeName.IsChecked == true)
                {
                    employees = db.Employees.Where(m => m.EmployeeID == empid).ToList();
                }
                else if (rbDesignation.IsChecked == true)
                {
                    employees = db.Employees.Where(m => m.EmployeeDesignation == designationid).ToList();
                }


                if (reporttype == "DTR")
                {
                    foreach (var emp in employees)
                    {
                        var qry = from a in db.GetEmployeeDTR(startDate, endDate, emp.bioid)
                                  select a;
                        lresult.AddRange(qry);
                    }

                    Mouse.OverrideCursor = Cursors.Arrow;
                    PrintWindow x = new PrintWindow();

                    x.rptid = 29;

                    x.startDate = dpStartDate.SelectedDate.Value.ToString("MM/dd/yy");
                    x.endDate   = dpEndDate.SelectedDate.Value.ToString("MM/dd/yy");

                    x.Report29 = lresult;
                    x.ShowDialog();
                }

                else if (reporttype == "Attendance Report")
                {
                    foreach (var emp in employees)
                    {
                        var qry = from a in db.GetEmployeeDTR(startDate, endDate, emp.bioid)
                                  select a;
                        lresult.AddRange(qry);
                    }

                    Mouse.OverrideCursor = Cursors.Arrow;
                    PrintWindow x = new PrintWindow();

                    x.rptid     = 30;
                    x.startDate = dpStartDate.SelectedDate.Value.ToString("MM/dd/yy");
                    x.endDate   = dpEndDate.SelectedDate.Value.ToString("MM/dd/yy");

                    x.department = dept;
                    x.Report30   = lresult;
                    x.ShowDialog();
                }
            }
        }