private void btnEditBooking_Click_1(object sender, EventArgs e) { coboCountry.Items.Clear(); coboSalesRep.Items.Clear(); txtDeliveryDate.Visible = false; txtRetrievalDate.Visible = false; dtpDeliveryDate.Visible = true; dtpRetrievalDate.Visible = true; int bookingID = BookingIDs; int i = 0; List <string> getDates = CC.GetDates(bookingID); List <DateTimePicker> Dates = new List <DateTimePicker> { dtpDeliveryDate, dtpRetrievalDate }; foreach (DateTimePicker dtp in Dates) { dtp.Text = getDates[i]; i++; } List <string> SalesRep = new List <string>(); CC.GetAllSalesRep(SalesRep); foreach (string s in SalesRep) { coboSalesRep.Items.Add(s); } coboSalesRep.Enabled = true; coboSalesRep.DropDownStyle = ComboBoxStyle.DropDownList; coboSalesRep.Text = CC.GetOneSalesRep(bookingID); coboCountry.Items.Add("Denmark"); coboCountry.Items.Add("Sweden"); coboCountry.Enabled = true; coboCountry.DropDownStyle = ComboBoxStyle.DropDownList; coboCountry.Text = CC.GetCountry(bookingID); lblShowBooking.Text = "Edit booking"; btnBackToBooking.Visible = false; btnSaveBooking.Visible = true; btnEditBooking.Visible = false; btnCancel.Visible = true; List <TextBox> textBoxList = new List <TextBox> { txtName1, txtName2, txtATT, txtAdresss, txtZipCode, txtCity, txtPhone, txtDeliveryDate, txtRetrievalDate, txtCarrier, txtMessageToWorkshop, txtDeliveryNote, txtConfigs }; foreach (TextBox t in textBoxList) { t.ReadOnly = false; } rbtnYes.Enabled = true; rbtnNo.Enabled = true; }
private void Demo_Maskiner_Load(object sender, EventArgs e) { coboCountry.DropDownStyle = ComboBoxStyle.DropDownList; coboSalesRep.DropDownStyle = ComboBoxStyle.DropDownList; List <string> Demos = CTRC.DropDownDemoLoad(); List <string> AllSalesRep = new List <string>(); foreach (string X in Demos) { coboDemoMachines.Items.Add(X); } rbtnNo.Checked = true; coboCountry.Items.Add("Denmark"); coboCountry.Items.Add("Sweden"); CTRC.GetAllSalesRep(AllSalesRep); foreach (string s in AllSalesRep) { coboSalesRep.Items.Add(s); } }