예제 #1
0
        private void buttonFormCustomer_Click(object sender, EventArgs e)
        {
            FormCustomer purchase = new FormCustomer();

            purchase.StartPosition = FormStartPosition.CenterScreen;
            purchase.Show();
        }
        //constructor
        public ControllerMain(FormMain view) : base(null, null)
        {
            //connect controller to its view
            this.view                 = view;
            list_customers            = new ArrayList();
            list_networks             = new ArrayList();
            list_networkInventories   = new ArrayList();
            list_allAvailableLicenses = new ArrayList();
            list_licenseInventories   = new ArrayList();
            list_systems              = new ArrayList();
            list_systemInventories    = new ArrayList();
            list_Audits               = new ArrayList();

            //initialising by database
            list_customers            = db.GetCustomers();
            list_allAvailableLicenses = db.GetLicenses();
            list_networks             = db.GetNetworks();
            list_networkInventories   = db.GetNetworkInventories();
            list_licenseInventories   = db.GetLicenseInventories();
            list_systems           = db.GetClientSystems();
            list_systemInventories = db.GetSystemInventories();
            list_Audits            = db.GetAudits();

            //Creating Forms
            fAudit                   = new FormAudit();
            fChanges                 = new FormChange();
            fCustomer                = new FormCustomer();
            fLicense                 = new FormLicense();
            fNetwork                 = new FormNetwork();
            fSystemInventory         = new FormSystemInventory();
            fAudit.Visible           = false;
            fChanges.Visible         = false;
            fCustomer.Visible        = false;
            fLicense.Visible         = false;
            fNetwork.Visible         = false;
            fSystemInventory.Visible = false;

            //Creating Controllers and connect data
            cAudit           = new ControllerAudit(this, fAudit, list_customers, list_licenseInventories, list_systemInventories, list_Audits, list_allAvailableLicenses);
            cChanges         = new ControllerChanges(this, fChanges, list_customers, list_networks, list_networkInventories, list_licenseInventories, list_allAvailableLicenses, list_systems);
            cCustomer        = new ControllerCustomer(this, fCustomer, list_customers);
            cLicense         = new ControllerLicense(this, fLicense, list_customers, list_allAvailableLicenses, list_licenseInventories);
            cNetwork         = new ControllerNetwork(this, fNetwork, list_customers, list_networks, list_networkInventories);
            cSystemInventory = new ControllerSystemInventory(this, fSystemInventory, list_customers, list_networks,
                                                             list_networkInventories, list_systems, list_systemInventories, list_allAvailableLicenses);

            //Connect Controller to View
            fAudit.Currentcontroller           = cAudit;
            fChanges.Currentcontroller         = cChanges;
            fCustomer.Currentcontroller        = cCustomer;
            fLicense.Currentcontroller         = cLicense;
            fNetwork.Currentcontroller         = cNetwork;
            fSystemInventory.Currentcontroller = cSystemInventory;

            //Update View with Information initialised by Database
            UpdateView(true);
        }
예제 #3
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            FormCustomer formCustomer = new FormCustomer();

            formCustomer.TopLevel = false;
            metroPanelMain.Controls.Add(formCustomer);

            formCustomer.Dock = DockStyle.Fill;
            formCustomer.Show();
            timerPanel.Start();
        }
예제 #4
0
 private void bunifuImageButton3_Click(object sender, EventArgs e)
 {
     if (cus == null)
     {
         cus             = new FormCustomer();
         cus.RefreshDgv += new FormCustomer.DoEvent(updatecus);
         cus.Show();
     }
     else
     {
         cus.WindowState = FormWindowState.Normal;
         cus.Focus();
     }
 }
예제 #5
0
        private void BtLoginC_Click(object sender, EventArgs e)
        {
            var       List = HelperCustomer.GetCustomerList();
            Customers cus  = HelperCustomer.Item(List, tbUserC.Text, tbPwC.Text);

            if (cus != null)
            {
                FormCustomer f2 = new FormCustomer(cus.customerID);
                f2.Show();
                this.Hide();
            }
            else
            {
                tbUserC.Clear(); tbPwC.Clear();
                lblWrongC.Visible = true;
            }
        }
예제 #6
0
 void updatecus()
 {
     cus = null;
 }
예제 #7
0
 //Constructor
 public ControllerCustomer(ControllerParent calling, FormCustomer view, ArrayList list_customers) : base(calling, list_customers)
 {
     //connect controller to its view
     this.view = view;
 }
예제 #8
0
        private void btnKhachHang_Click(object sender, EventArgs e)
        {
            FormCustomer f = new FormCustomer();

            f.Show();
        }