Пример #1
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for businesses types(CmbBusinessesTypes) is filling
        /// from the businesses types(businesses_types) table.
        /// /// </summary>
        public EditBusinessesTypes()
        {
            InitializeComponent();
            BtnEdit.Hide();
            LblGuide1.Hide();
            TbxEditiBusinessesTypes.Hide();

            CmbBusinessesTypes.DataSource    = DCom.GetData("SELECT * FROM businesses_types");
            CmbBusinessesTypes.DisplayMember = "Type";
            CmbBusinessesTypes.ValueMember   = "Type";
        }
Пример #2
0
        /// <summary>
        /// In forms constructor the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form. Then the combobox for province(comboBoxptovince) is filling with the data from table province.
        /// </summary>
        public EditProvince()
        {
            InitializeComponent();

            TbxProvinceName.Hide();
            labelpro.Hide();
            BtnEdit.Hide();

            comboBoxptovince.DataSource    = DCom.GetData("SELECT * FROM province");
            comboBoxptovince.DisplayMember = "Province_Name";
            comboBoxptovince.ValueMember   = "Province_Name";
        }
Пример #3
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for municipality(CmbMunicipality_Name) is filling
        /// from the municipality(municipality) table.
        /// /// </summary>
        public EditMunicipality()
        {
            InitializeComponent();
            guidelbl.Hide();
            label2.Hide();
            TbxName.Hide();
            CmbProvince.Hide();
            BtnEdit.Hide();

            CmbMunicipality_Name.DataSource    = DCom.GetData("SELECT * FROM municipality");
            CmbMunicipality_Name.DisplayMember = "Municipality_Name";
            CmbMunicipality_Name.ValueMember   = "Municipality_Name";
        }
Пример #4
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for login(CmbUsername) is filling
        /// from the user types(users_types) table.
        /// /// </summary>
        public EditLogin()
        {
            InitializeComponent();
            guidelbl.Hide();
            label2.Hide();
            TbxUsername.Hide();
            TbxPassword.Hide();
            BtnEdit.Hide();

            CmbUsername.DataSource    = DCom.GetData("SELECT * FROM login");
            CmbUsername.DisplayMember = "Username";
            CmbUsername.ValueMember   = "Username";
        }
Пример #5
0
        /// <summary>
        /// In forms constructor the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form. Then the combobox for work hours(CmbWorkHours) is filling with the ID of work hours.
        /// </summary>
        public EditWorkHours()
        {
            InitializeComponent();

            LblDays.Hide();
            LblEndTime.Hide();
            LblStartTime.Hide();
            DtpEndTime.Hide();
            DtpStartTime.Hide();
            CmbDays.Hide();
            BtnEdit.Hide();

            CmbWorkHours.DataSource    = DCom.GetData("SELECT * FROM work_hours");
            CmbWorkHours.DisplayMember = "ID";
            CmbWorkHours.ValueMember   = "ID";
        }
Пример #6
0
        /// <summary>
        /// In forms constructor the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form. Then the combobox for ratings(CmbSelect) is filling with the data of the table.
        /// </summary>
        public EditRatingsForm()
        {
            InitializeComponent();

            LblRatingValue.Hide();
            LblComment.Hide();
            LblUsername.Hide();

            TbxComment.Hide();
            TbxRatingValue.Hide();
            CmbUsername.Hide();

            BtnEdit.Hide();

            CmbSelect.DataSource    = DCom.GetData("SELECT *, CONCAT(Username, ', ', Rating_Value) AS NAME FROM ratings");
            CmbSelect.DisplayMember = "NAME";
            CmbSelect.ValueMember   = "ID";
        }
Пример #7
0
        /// <summary>
        /// In forms constructor the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form. Then the combobox for users(CmbUser) is filling with the usernames and NAMES
        /// from table users.
        /// </summary>
        public EditUser()
        {
            InitializeComponent();
            label1.Hide();
            label2.Hide();
            label3.Hide();
            label4.Hide();
            label5.Hide();
            label6.Hide();
            TbxFirstName.Hide();
            TbxLastName.Hide();
            TbxUsername.Hide();
            TbxTelephone.Hide();
            TbxEmail.Hide();
            CmbTypes.Hide();
            BtnEdit.Hide();

            CmbUser.DataSource    = DCom.GetData("SELECT Username,CONCAT(Last_name,' ' , First_Name) AS NAME FROM users");
            CmbUser.DisplayMember = "NAME";
            CmbUser.ValueMember   = "Username";
        }
Пример #8
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for ratings(CmbSelect) is filling
        /// from the rating(rating) table.
        /// </summary>
        public EditReservationForm()
        {
            InitializeComponent();

            LblBusiness.Hide();
            LblDate.Hide();
            LblPerson.Hide();
            LblUsername.Hide();

            CmbBusiness.Hide();
            CmbUsername.Hide();

            BtnEdit.Hide();

            TbxPerson.Hide();
            DtpDate.Hide();

            CmbSelect.DataSource    = DCom.GetData("SELECT *, CONCAT(Username, ', ', Rating_Value) AS NAME FROM ratings");
            CmbSelect.DisplayMember = "NAME";
            CmbSelect.ValueMember   = "ID";
        }
Пример #9
0
        public void Nav(Form form, Panel panel)
        {
            // changing view for content panel
            form.TopLevel = false;
            form.Size     = panel.Size; // for responsive size
            panel.Controls.Clear();
            panel.Controls.Add(form);
            form.Show();

            // getting name of form that is being viewed, and assigning header title and button text from from that value
            nameOfFormOpen = form.Name;
            string currTitle = "";
            string newTitle  = "";

            // removing value "GUI" from name to be more user friendly
            if (nameOfFormOpen.Contains("GUI"))
            {
                currTitle = nameOfFormOpen.Replace("GUI", "");
                newTitle  = InsertSpaceBeforeUpperCase(currTitle);
            }
            lblNameOfFormOpen.Text = newTitle;

            ChangeButtons(newTitle.ToLower());
            if (nameOfFormOpen.Equals("DashboardGUI") || nameOfFormOpen.Equals("VenuesGUI"))
            {
                //if (nameOfFormOpen.Equals("DashboardGUI")) {
                HideButtons();
            }
            else if (nameOfFormOpen.Equals("ReservationsGUI"))
            {
                BtnCreateNew.Hide();
                BtnEdit.Hide();
                BtnDelete.Show();
            }
            else
            {
                ShowButtons();
            }
        }
Пример #10
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for location(CmbLocation) is filling
        /// from the location(location) table.
        /// </summary>
        public EditLocation()
        {
            InitializeComponent();

            label2.Hide();
            label3.Hide();
            label4.Hide();
            label5.Hide();
            label6.Hide();
            label7.Hide();
            TbxAddressNumber.Hide();
            TbxAdressName.Hide();
            TbxLat.Hide();
            TbxLong.Hide();
            TbxPostalCode.Hide();
            CmbMunicipality.Hide();
            BtnEdit.Hide();

            CmbLocation.DataSource    = DCom.GetData("SELECT ID, CONCAT(Address_Name, ', ', Municipality) AS ADDRESS  FROM location");
            CmbLocation.DisplayMember = "ADDRESS";
            CmbLocation.ValueMember   = "ID";
        }
Пример #11
0
        public EdiBusinessForm()
        {
            InitializeComponent();

            LblBusinessDescription.Hide();
            LblBusinessName.Hide();
            LblCategory.Hide();
            LblPrice.Hide();
            LblRating.Hide();
            LblTelephone.Hide();
            LblUser.Hide();
            LblWebsite.Hide();
            LblWorkHours.Hide();
            LblBusinessType.Hide();
            LblLocation.Hide();

            TbxBusinessName.Hide();
            TbxCategory.Hide();
            TbxDescription.Hide();
            TbxPrice.Hide();
            TbxRating.Hide();
            TbxTelephone.Hide();
            TbxWebsite.Hide();

            CmbLocation.Hide();
            CmbTypes.Hide();
            CmbUser.Hide();
            CmbWorkHours.Hide();

            ChbReservation.Hide();

            BtnEdit.Hide();

            CmbBusinesses.DataSource    = DCom.GetData("SELECT businesses.ID, CONCAT(businesses.Business_Name, ', ', location.Address_Name, ', ', location.Municipality) AS NAME FROM businesses, location WHERE businesses.Location_ID = location.ID");
            CmbBusinesses.DisplayMember = "NAME";
            CmbBusinesses.ValueMember   = "ID";
        }
Пример #12
0
 public void HideButtons()
 {
     BtnCreateNew.Hide();
     BtnEdit.Hide();
     BtnDelete.Hide();
 }