/// <summary> /// Finally when the client made the changes that he wants the program checks if all the fields /// all fields are fill. If all fields are fill then the program exec the apropriate querry for the /// update of the rating, else show a error message. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSelect_Click(object sender, EventArgs e) { LblRatingValue.Show(); LblComment.Show(); LblUsername.Show(); TbxComment.Show(); TbxRatingValue.Show(); CmbUsername.Show(); BtnEdit.Show(); LblSelect.Hide(); CmbSelect.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbSelect.SelectedValue)); TbxRatingValue.Text = SelectedData.Rows[0]["Rating_Value"].ToString(); TbxComment.Text = SelectedData.Rows[0]["Comment"].ToString(); CmbUsername.DataSource = DCom.GetData("SELECT * FROM users"); CmbUsername.DisplayMember = "Username"; CmbUsername.ValueMember = "Username"; }
private void BtnSelect_Click(object sender, EventArgs e) { LblBusinessDescription.Show(); LblBusinessName.Show(); LblCategory.Show(); LblPrice.Show(); LblRating.Show(); LblTelephone.Show(); LblUser.Show(); LblWebsite.Show(); LblWorkHours.Show(); LblBusinessType.Show(); LblLocation.Show(); TbxBusinessName.Show(); TbxCategory.Show(); TbxDescription.Show(); TbxPrice.Show(); TbxRating.Show(); TbxTelephone.Show(); TbxWebsite.Show(); CmbLocation.Show(); CmbTypes.Show(); CmbUser.Show(); CmbWorkHours.Show(); ChbReservation.Show(); BtnEdit.Show(); LblSelect.Hide(); CmbBusinesses.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbBusinesses.SelectedValue)); TbxBusinessName.Text = (string)SelectedData.Rows[0]["Business_Name"]; TbxCategory.Text = (string)SelectedData.Rows[0]["Category"]; TbxDescription.Text = (string)SelectedData.Rows[0]["Description"]; TbxPrice.Text = SelectedData.Rows[0]["Price_Range"].ToString(); TbxRating.Text = (string)SelectedData.Rows[0]["Rating"].ToString(); TbxTelephone.Text = (string)SelectedData.Rows[0]["Telephone"]; TbxWebsite.Text = (string)SelectedData.Rows[0]["Website"]; CmbLocation.DataSource = DCom.GetData("SELECT ID,CONCAT(Address_Name, ', ', Address_Number) AS NAME FROM location"); CmbLocation.DisplayMember = "NAME"; CmbLocation.ValueMember = "ID"; CmbTypes.DataSource = DCom.GetData("SELECT * FROM businesses_types"); CmbTypes.DisplayMember = "Type"; CmbTypes.ValueMember = "Type"; CmbUser.DataSource = DCom.GetData("SELECT * FROM users"); CmbUser.DisplayMember = "Username"; CmbUser.ValueMember = "Username"; CmbWorkHours.DataSource = DCom.GetData("SELECT * FROM work_hours"); CmbWorkHours.DisplayMember = "ID"; CmbWorkHours.ValueMember = "ID"; }
/// <summary> /// When the client select the user 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 user. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSelect_Click(object sender, EventArgs e) { Guidelbl.Hide(); CmbUser.Hide(); BtnSelect.Hide(); label1.Show(); label2.Show(); label3.Show(); label4.Show(); label5.Show(); label6.Show(); TbxFirstName.Show(); TbxLastName.Show(); TbxUsername.Show(); TbxTelephone.Show(); TbxEmail.Show(); CmbTypes.Show(); BtnEdit.Show(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbUser.SelectedValue)); TbxFirstName.Text = (string)SelectedData.Rows[0]["First_Name"]; TbxLastName.Text = (string)SelectedData.Rows[0]["Last_Name"]; TbxUsername.Text = (string)SelectedData.Rows[0]["Username"]; TbxEmail.Text = (string)SelectedData.Rows[0]["Email"]; TbxTelephone.Text = (string)SelectedData.Rows[0]["Telephone"]; DataTable GetUserType = DCom.GetData(String.Format("SELECT users_types.Type FROM users, users_types WHERE users.Username='******' and users.Type=users_types.Type", CmbUser.SelectedValue)); CmbTypes.DataSource = DCom.GetData("SELECT * FROM users_types"); CmbTypes.DisplayMember = "Type"; CmbTypes.ValueMember = "Type"; CmbTypes.Text = (string)GetUserType.Rows[0]["Type"]; }
/// <summary> /// When the client select the user 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 user. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSelect_Click(object sender, EventArgs e) { label2.Show(); label3.Show(); label4.Show(); label5.Show(); label6.Show(); label7.Show(); TbxAddressNumber.Show(); TbxAdressName.Show(); TbxLat.Show(); TbxLong.Show(); TbxPostalCode.Show(); CmbMunicipality.Show(); BtnEdit.Show(); label1.Hide(); CmbLocation.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbLocation.SelectedValue)); TbxAdressName.Text = SelectedData.Rows[0]["Address_Name"].ToString(); TbxAddressNumber.Text = SelectedData.Rows[0]["Address_Number"].ToString(); TbxLat.Text = SelectedData.Rows[0]["Lat"].ToString(); TbxLong.Text = SelectedData.Rows[0]["Long"].ToString(); TbxPostalCode.Text = SelectedData.Rows[0]["Postal_Code"].ToString(); CmbMunicipality.DataSource = DCom.GetData("SELECT * FROM municipality"); CmbMunicipality.DisplayMember = "Municipality_Name"; CmbMunicipality.ValueMember = "Municipality_Name"; CmbMunicipality.Text = SelectedData.Rows[0]["Municipality"].ToString(); }
/// <summary> /// When the client select the rating 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 rating. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSelect_Click(object sender, EventArgs e) { LblBusiness.Show(); LblDate.Show(); LblPerson.Show(); LblUsername.Show(); CmbBusiness.Show(); CmbUsername.Show(); BtnEdit.Show(); TbxPerson.Show(); DtpDate.Show(); LblSelect.Hide(); CmbSelect.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbSelect.SelectedValue)); TbxPerson.Text = SelectedData.Rows[0]["Persons"].ToString(); CmbBusiness.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"); CmbBusiness.DisplayMember = "NAME"; CmbBusiness.ValueMember = "ID"; CmbUsername.DataSource = DCom.GetData("SELECT * FROM users"); CmbUsername.DisplayMember = "Username"; CmbUsername.ValueMember = "Username"; CmbUsername.Text = SelectedData.Rows[0]["User"].ToString(); CmbBusiness.Text = SelectedData.Rows[0]["BusinessID"].ToString(); }
private void BtnSelect_Click(object sender, EventArgs e) { TbxDays.Show(); BtnEdit.Show(); label2.Show(); label3.Hide(); CmbDays.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbDays.SelectedValue)); TbxDays.Text = (string)SelectedData.Rows[0]["Name"]; }
/// <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"]; }
/// <summary> /// When the client select the privince 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 province. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnselect_Click(object sender, EventArgs e) { label2.Hide(); comboBoxptovince.Hide(); TbxProvinceName.Hide(); btnselect.Hide(); labelpro.Show(); TbxProvinceName.Show(); BtnEdit.Show(); SelectedData = DCom.GetData(String.Format(SqlExec, comboBoxptovince.SelectedValue)); TbxProvinceName.Text = (string)SelectedData.Rows[0]["Province_Name"]; }
/// <summary> /// When the client select the login 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 login. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSelect_Click(object sender, EventArgs e) { guidelbl.Show(); label2.Show(); TbxUsername.Show(); TbxPassword.Show(); BtnEdit.Show(); label1.Hide(); CmbUsername.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbUsername.SelectedValue)); TbxUsername.Text = (string)SelectedData.Rows[0]["Username"]; TbxPassword.Text = (string)SelectedData.Rows[0]["Password"]; }
/// <summary> /// When the client select the minicipality 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 municipality. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSelect_Click(object sender, EventArgs e) { label2.Show(); TbxName.Show(); CmbProvince.Show(); guidelbl.Show(); BtnEdit.Show(); label1.Hide(); CmbMunicipality_Name.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbMunicipality_Name.SelectedValue)); TbxName.Text = (string)SelectedData.Rows[0]["Municipality_Name"]; CmbProvince.DataSource = DCom.GetData("SELECT * FROM province"); CmbProvince.DisplayMember = "Province_Name"; CmbProvince.ValueMember = "Province_Name"; CmbProvince.Text = (string)SelectedData.Rows[0]["Province"];; }
/// <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(); }
public void ShowButtons() { BtnCreateNew.Show(); BtnEdit.Show(); BtnDelete.Show(); }