Ejemplo n.º 1
0
        private async void AddEmployee_Click(object sender, RoutedEventArgs e)
        {
            Saving.IsActive = true;
            DatabaseHelperClass Db_Helper = new DatabaseHelperClass();//Creating object for DatabaseHelperClass.cs from ViewModel/DatabaseHelperClass.cs

            if (NametxtBx.Text != "" & PhonetxtBx.Text != "" & PositiontxtBx.Text != "" & AddresstxtBx.Text != "" & AgetxtBx.Text != "" & RatetxtBx.Text != "")
            {
                Db_Helper.Insert(new Employees(NametxtBx.Text, PhonetxtBx.Text, PositiontxtBx.Text, AddresstxtBx.Text, AgetxtBx.Text, RatetxtBx.Text));

                ReadAllEmployeesList dbAtte = new ReadAllEmployeesList();
                DB_Employees = dbAtte.GetAllEmployees();
                newAtte.GenerateAttendance(NametxtBx.Text);

                Employees.EmployeeAdded = true; //reference that the navigation came from adding employee
                if (fromMainPage != "firstEmployee")
                {
                    Frame.BackStack.RemoveAt(Frame.BackStackDepth - 1); //removing the back button's previous history
                }
                Frame.Navigate(typeof(EmployeeBuddy));                  //after adding Employee redirect to EmployeeBuddy page
            }
            else
            {
                MessageDialog messageDialog = new MessageDialog("Please fill all the fields");//Text should not be empty
                await messageDialog.ShowAsync();

                Saving.IsActive = false;
            }
        }
Ejemplo n.º 2
0
        private void MyEmployee_Loaded(object sender, RoutedEventArgs e)
        {
            ReadAllEmployeesList dbEmployees = new ReadAllEmployeesList();

            DB_EmployeeList         = dbEmployees.SetSalary();                               //Get all DB Employees
            ListPayroll.ItemsSource = DB_EmployeeList.OrderByDescending(i => i.Id).ToList(); //Binding DB data to LISTBOX and Latest Employee ID can Display first.
        }
Ejemplo n.º 3
0
        private void SalaryBuddy_Loaded(object sender, RoutedEventArgs e)
        {
            prevImg.Source = new BitmapImage(new Uri("ms-appx:///Assets/bmp_previous.png"));
            nextImg.Source = new BitmapImage(new Uri("ms-appx:///Assets/bmp_next.png"));


            ReadAllEmployeesList dbEmployees = new ReadAllEmployeesList();

            DB_EmployeeList        = dbEmployees.SetSalary();                               //Get all DB Employees
            listBoxobj.ItemsSource = DB_EmployeeList.OrderByDescending(i => i.Id).ToList(); //Binding DB data to LISTBOX and Latest Employee ID can Display first.
        }
Ejemplo n.º 4
0
        private void EmployeeBuddy_Loaded(object sender, RoutedEventArgs e)
        {
            ReadAllEmployeesList dbEmployees = new ReadAllEmployeesList();

            DB_EmployeeList = dbEmployees.GetAllEmployees();//Get all DB Employees
            if (DB_EmployeeList.Count > 0)
            {
                Btn_Delete.IsEnabled = true;
            }
            listBoxobj.ItemsSource = DB_EmployeeList.OrderByDescending(i => i.Id).ToList();//Binding DB data to LISTBOX and Latest Employee ID can Display first.
        }
Ejemplo n.º 5
0
        private void AttendanceBuddy_Loaded(object sender, RoutedEventArgs e)
        {
            ReadAllEmployeesList dbEmployees = new ReadAllEmployeesList();
            DatabaseHelperClass  dbAttHelper = new DatabaseHelperClass();

            if (DateTime.Now.Day <= 15)
            {
                for (int i = 0; i <= (DateTime.Now.Day - 1); i++)
                {
                    GeneratedDays.Add(new AttendanceMenuGenerator(DaysGenerator.AttendanceDate(DateTime.Now.Month.ToString(), (i + 1).ToString(), DateTime.Now.Year.ToString())));
                }
            }
            else
            {
                for (int i = 0; (i + 16) <= DateTime.Now.Day; i++)
                {
                    GeneratedDays.Add(new AttendanceMenuGenerator(DaysGenerator.AttendanceDate(DateTime.Now.Month.ToString(), (i + 16).ToString(), DateTime.Now.Year.ToString())));
                }
            }

            listBoxobj.ItemsSource = GeneratedDays;
            CrntDate.Text          = DateTime.Now.ToString("MMMM dd yyyy");
        }