// Constructor
 public EditCustomerForm(int selectionID, Consultant editingUser)
 {
     InitializeComponent();
     workingCustomer_edit.customerID = selectionID;
     loggedConsultant_EC             = editingUser;
     WindowStartupLocation           = System.Windows.WindowStartupLocation.CenterScreen;
 }
 // Constructor
 public EditAppointmentForm(int selectionID, Consultant editingUser)
 {
     InitializeComponent();
     workingAppointment.appointmentID = selectionID;
     loggedConsultant_EA   = editingUser;
     WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
 }
        // Fill Label Fields
        private void FillLabel(string selectionName)
        {
            Consultant selectedConsultant = new Consultant();

            selectedConsultant.consultantName = selectionName;

            ConsultantIDLabel.Content   = $"Consultant ID: { selectedConsultant.LookupConsultant() }";
            ConsultantNameLabel.Content = $"Name: { selectedConsultant.consultantName }";

            if (selectedConsultant.activeConsultant == true)
            {
                ConsultantStatus.Content = "Status: Active";
            }
            else
            {
                ConsultantStatus.Content = "Status: Inactive";
            }

            FillConsultantTable(selectedConsultant.consultantID);
        }
Exemplo n.º 4
0
        // Authenticate Consultant
        private void AuthenticateConsultant()
        {
            Consultant authCandidate = new Consultant();

            authCandidate.geoCode        = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
            authCandidate.consultantName = ConsultantNameInput.Text;
            authCandidate.LookupConsultant();

            if (authCandidate.consultantID == 0)
            {
                if (timeZoneOffset == 2)
                {
                    MessageBox.Show("Bruker Ikke Funnet");
                }
                else
                {
                    MessageBox.Show("User Not Found");
                }
            }
            else if (authCandidate.consultantPass != ConsultantPassInput.Password)
            {
                if (timeZoneOffset == 2)
                {
                    MessageBox.Show("Ugyldig Passord");
                }
                else
                {
                    MessageBox.Show("Invalid Password");
                }
            }
            else
            {
                Log newLog = new Log(ConsultantNameInput.Text);
                newLog.LoginRecord();

                Dashboard consultantDashboard = new Dashboard(authCandidate);
                consultantDashboard.Show();

                this.Close();
            }
        }
        // Build New Consultant
        public void BuildConsultant()
        {
            Validator addConsultantValidator = new Validator();

            if (addConsultantValidator.CheckIfExists(NewConsultantNameInput.Text, "userName", "user") == true)
            {
                MessageBox.Show("Name Taken - Please Select Different User Name");
            }
            else
            {
                Consultant addedConsultant = new Consultant();
                addedConsultant.consultantName = NewConsultantNameInput.Text;
                addedConsultant.consultantPass = InitPassInput.Password;
                addedConsultant.AddConsultant();

                MessageBox.Show("Registered Successfully");

                MainWindow successfulRegister = new MainWindow();
                successfulRegister.Show();

                this.Close();
            }
        }
Exemplo n.º 6
0
 // Constructor
 public AddCustomerForm(Consultant loggedUser)
 {
     InitializeComponent();
     loggedConsultant_AC   = loggedUser;
     WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
 }
Exemplo n.º 7
0
 // Constructor
 public CustomerView(Consultant viewer)
 {
     InitializeComponent();
     viewingConsultant_CV  = viewer;
     WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
 }
 // Consultant
 public ConsultantView(Consultant viewer)
 {
     InitializeComponent();
     loggedUser            = viewer;
     WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
 }
Exemplo n.º 9
0
 public AddAppointmentForm(Consultant loggedUser)
 {
     InitializeComponent();
     loggedConsultant_AA   = loggedUser;
     WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
 }
Exemplo n.º 10
0
 // Constructor
 public Dashboard(Consultant passedCons)
 {
     InitializeComponent();
     loggedConsultant      = passedCons;
     WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
 }
Exemplo n.º 11
0
 // Constructor
 public AppointmentView(Consultant viewer)
 {
     InitializeComponent();
     viewingConsultant_AV  = viewer;
     WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
 }