Ejemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            turist.App_Code.Order ord = new turist.App_Code.Order();

            turist.App_Code.OrderDB odb = new App_Code.OrderDB();
            turist.App_Code.PeopleDB pdb = new App_Code.PeopleDB();
            turist.App_Code.serviceDB sdb = new turist.App_Code.serviceDB();
            ord.Numbdogov = numberdoc.Text;
            ord.ClientIDppl = Convert.ToInt32(Clients.SelectedValue);
            ord.Datein = Convert.ToString(D_in.SelectedDate.Day) + "." + Convert.ToString(D_in.SelectedDate.Month) + "." + Convert.ToString(D_in.SelectedDate.Year); ;
            ord.Dateout = Convert.ToString(D_out.SelectedDate.Day) + "." + Convert.ToString(D_out.SelectedDate.Month) + "." + Convert.ToString(D_out.SelectedDate.Year); ;
            ord.OrderID = 1;
            ord.T_bazaID = Convert.ToInt32(Turs.SelectedValue);

            ordern = odb.InsertOrder(ord);
            List<turist.App_Code.tpeople> ltp = new List<App_Code.tpeople>();
            if (Turist1.Text != Turist4.Text)
            {
                pdb.InsertPeopleInOrder(Convert.ToInt32(Turist1.SelectedValue), ordern);
            }
            if (Turist2.Text != Turist4.Text)
            {
                pdb.InsertPeopleInOrder(Convert.ToInt32(Turist2.SelectedValue), ordern);
            }
            if (Turist3.Text != Turist4.Text)
            {
                pdb.InsertPeopleInOrder(Convert.ToInt32(Turist3.SelectedValue), ordern);
            }
            if ( Turist4.Text != "")
            {
                pdb.InsertPeopleInOrder(Convert.ToInt32(Turist4.SelectedValue), ordern);
            }
            for (int i = 0; i <= CheckBoxList1.Items.Count-1; i++)
            {
                if (CheckBoxList1.Items[i].Selected)
                {
                    sdb.InsertServiceInOrder(Convert.ToInt32(CheckBoxList1.Items[i].Value),ordern);
                }
            }
            ResolveUrl("neworderpeople.aspx");
        }
Ejemplo n.º 2
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     turist.App_Code.OrderDB odb = new App_Code.OrderDB();
     if (odb.ClearTable() == 1)
     {
         Button3.Text = "YES";
     }
 }