Пример #1
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";
        }
Пример #2
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";
        }