Esempio n. 1
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     loginController         = new LoginViewController(this);
     loginModelController    = new LoginModelController(this);
     employeeController      = new EmployeeViewController(this);
     employeeModelController = new EmployeeModelController(this);
     roomController          = new RoomViewController(this);
     roomModelController     = new RoomModelController(this);
     customerController      = new CustomerViewController(this);
     customerModelController = new CustomerModelController(this);
     errLogin = new ErrorProvider();
 }
        public void loadCustomerInformation(String name)
        {
            CustomerModelController modelController = (CustomerModelController)mainForm.getModelController(this.GetType());

            CustomerDataSet.CustomerRow row = modelController.getCustomerByName(name);
            if (row != null)
            {
                mainForm.lblCustomerID.Text   = row.Id.ToString();
                mainForm.lblCustomerName.Text = row.Name;
                mainForm.lblPhoneNumber.Text  = row.Phone_Number;
                mainForm.lblCustomerRoom.Text = row.CurrentRoomNumber;
                mainForm.lblBalance.Text      = formatCurrency(row.BalanceDue);
            }
        }
        public void loadCustomerList()
        {
            resetView();
            CustomerModelController modelController = (CustomerModelController)mainForm.getModelController(this.GetType);
            List <String>           customerNames;

            if (mainForm.radDisplayAllCustomers.Checked)
            {
                customerNames = modelController.getCustomerNames(mainForm.txtFilter.Text);
            }
            else
            {
                customerNames = modelController.getCustomerWithBalance(mainForm.txtFilter);
            }
            foreach (String customerName in customerNames)
            {
                mainForm.lstCustomers.Items.Add(customerNames);
            }
        }