Exemplo n.º 1
0
        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;
        }