Esempio n. 1
0
        /// <summary>
        /// When the client select the work hour that wants to edit the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form and then the neccesarily labels, tetxboxes and comboboxes are pop up. Then fills all the fields with
        /// the data of the selected work hour.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            LblDays.Show();
            LblEndTime.Show();
            LblStartTime.Show();
            DtpEndTime.Show();
            DtpStartTime.Show();
            CmbDays.Show();
            BtnEdit.Show();

            label1.Hide();
            CmbWorkHours.Hide();
            BtnSelect.Hide();

            SelectedData      = DCom.GetData(String.Format(SqlExec, CmbWorkHours.SelectedValue));
            DtpEndTime.Text   = SelectedData.Rows[0]["End_Time"].ToString();
            DtpStartTime.Text = SelectedData.Rows[0]["Start_Time"].ToString();

            CmbDays.DataSource    = DCom.GetData("SELECT * FROM days");
            CmbDays.DisplayMember = "NAME";
            CmbDays.ValueMember   = "NAME";
            CmbDays.Text          = SelectedData.Rows[0]["Day"].ToString();
        }
Esempio n. 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";
        }