示例#1
0
 public CustomerViewModel()
 {
     CustomerServiceInstance = ClientServiceLocator.Instance().ContractLocator.CustomerServices;
     Refresh();
     View = new CustomerView {
         DataContext = this
     };
     View.ShowDialog();
 }
 public CustomerViewModel()
 {
     CustomerServiceAdapter = new ServiceAdapter <ICustomerService>();
     Refresh();
     View = new CustomerView {
         DataContext = this
     };
     View.ShowDialog();
 }
示例#3
0
        private void CustomerButton_Click(object sender, EventArgs e)
        {
            CustomerView       customerView       = new CustomerView();
            CustomerService    customerService    = new CustomerService();
            IList              customerList       = customerService.getAllCustomers();
            CustomerController customerController = new CustomerController(customerView, customerList);

            customerController.LoadView();
            customerView.ShowDialog();
        }
示例#4
0
 /// <summary>
 /// method for checking username and password and opening the windows
 /// </summary>
 private void SaveExecute()
 {
     if (JmbgValidation(username) && password == "Gost")
     {
         CustomerView customer = new CustomerView(username);
         customer.ShowDialog();
     }
     else if (username == "Zaposleni" && password == "Zaposleni")
     {
         EmployeeView employee = new EmployeeView();
         employee.ShowDialog();
     }
     else
     {
         MessageBox.Show("Wrong username or password, please try again.");
     }
 }
        private void btnCustomerLogin_Click(object sender, RoutedEventArgs e)
        {
            bool success = LoginRegisterViewModel
                           .LoginCustomer
                               (tbCustomerEmailLogin.Text, tbCustomerPasswordLogin.Password);

            if (success && Session.isLogin)
            {
                this.Hide();
                if (Session.role.ToUpper() == "ADMIN")
                {
                    HomeAdminView hav = new HomeAdminView();
                    hav.ShowDialog();
                }
                else
                {
                    CustomerView cv = new CustomerView();
                    cv.ShowDialog();
                }
                Utility.TraverseVisualTree(this);
                this.Show();
            }
        }
示例#6
0
 private void AddCustomer()
 {
     CustomerViewModel cvm = new CustomerViewModel();
     CustomerView dv = new CustomerView();
     dv.DataContext = cvm;
     dv.ShowDialog();
     GetCustomers();
 }
示例#7
0
        private void EditCustomer()
        {
            CustomerViewModel cvm = new CustomerViewModel(this.SelectedCustomer.CustomerId);
            CustomerView cv = new CustomerView();
            cv.DataContext = cvm;
            cv.ShowDialog();

            GetCustomers();
        }
示例#8
0
 public CustomerViewModel()
 {
     View             = new CustomerView();
     View.DataContext = this;
     View.ShowDialog();
 }