예제 #1
0
        public manage(String CU)
        {
            this.CurrentUser = CU;

            InitializeComponent();
            _instance = this;

            labelCU.Text           = "Logged In : " + this.CurrentUser;
            labelDate.Text         = "Date " + DateTime.Now.ToString("yyyy-M-dd");
            comboBoxResTo.Enabled  = false;
            comboBoxResCab.Enabled = false;
            labelResAmount.Text    = "";
            labelResKm.Text        = "";


            DBL.User ust = new DBL.User();
            ust.Username1 = this.CurrentUser;
            if (ust.IsHeadOfficeUser(ust))
            {
                groupBoxUsers.Enabled   = true;
                groupBoxTours.Enabled   = true;
                groupBoxDrivers.Enabled = true;

                labelUser.Text   = "User Management";
                labelDriver.Text = "Driver Management";
                labelTour.Text   = "Tour Management";
            }
            else
            {
                groupBoxUsers.Enabled   = false;
                groupBoxTours.Enabled   = false;
                groupBoxDrivers.Enabled = false;

                labelUser.Text   = "User Management (Only for Head Ofiice)";
                labelDriver.Text = "Driver Management (Only for Head Ofiice)";
                labelTour.Text   = "Tour Management (Only for Head Ofiice)";

                dataGridViewUsers.Enabled = false;
                dataGridViewTour.Enabled  = false;
                dataGridViewCab.Enabled   = false;
            }

            allTourTable();
            allUserTable();
            allCabTable();
            allClientTable();
            curResTable();
            comboboxes();

            this.FormClosing += new FormClosingEventHandler(manage_FormClosing);
            this.WindowState  = FormWindowState.Maximized;
        }