コード例 #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>
        /// When the client select the user type that wants to edit the not necessarily labels and comboboxes are hiding
        /// from the form and then the neccesarily labels and tetxboxes are pop up. Then fills all the fields with
        /// the data of the selected user type.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            BtnEdit.Show();
            LblGuide1.Show();
            TbxEditiBusinessesTypes.Show();
            BtnSelect.Hide();
            CmbBusinessesTypes.Hide();
            LblGuide.Hide();

            SelectedData = DCom.GetData(String.Format(SqlExec, CmbBusinessesTypes.SelectedValue));
            TbxEditiBusinessesTypes.Text = (string)SelectedData.Rows[0]["Type"];
        }