Exemple #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");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Main();
            //datedoc = odb.GetTemp();
            //orderid = Convert.ToInt32(odb.GetTemp2());
            DateTime doc = new DateTime();
            doc = Convert.ToDateTime(datedoc);

            List<turist.App_Code.Order> ordl = odb.GetAllOrders();
            foreach (turist.App_Code.Order ore in ordl)
            {
                if (ore.OrderID == orderid)
                {
                    ord = ore;
                }
            }

            List<turist.App_Code.t_baza> tbdl = tdb.GetAllTurs();
            foreach (turist.App_Code.t_baza tbz in tbdl)
            {
                if (tbz.T_bazaID == ord.T_bazaID)
                {
                    tb = tbz;
                }
            }

            List<turist.App_Code.tpeople> ppl = pdb.GetAllPeoples();
            foreach (turist.App_Code.tpeople pplz in ppl)
            {
                if (pplz.PeopleID == ord.ClientIDppl)
                {
                    tp = pplz;
                }
            }

            //tb = tdb.GetTur(ord.T_bazaID);

            //tp = pdb.GetPeople(ord.ClientIDppl);
            int count = pdb.CountPeopleOrder(orderid);

            setnametur = tb.Name;
                       setclient = tp.Fio;
            numbdoc.Text = datedoc;
            setcolvo = Convert.ToString(count);
            List<turist.App_Code.cervice> list = odb.GetServiceOrder(orderid);
            foreach (turist.App_Code.cervice a in list)
            {
                serv.Items.Add(a.Name);
                costs = costs + a.Cost;
            }
            double costa = ((Convert.ToDouble(tb.Agent) / 100) * Convert.ToDouble(costs));
            costs += (costa);
            setcost = Convert.ToString(costs);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Main();
            //datedoc = odb.GetTemp();
            //orderid = Convert.ToInt32(odb.GetTemp2());
            DateTime doc = new DateTime();
            doc = Convert.ToDateTime(datedoc);

            List<turist.App_Code.Order> ordl = odb.GetAllOrders();
            foreach (turist.App_Code.Order ore in ordl)
            {
                if (ore.OrderID == orderid)
                {
                    ord = ore;
                }
            }

            List<turist.App_Code.t_baza> tbdl = tdb.GetAllTurs();
            foreach (turist.App_Code.t_baza tbz in tbdl)
            {
                if (tbz.T_bazaID == ord.T_bazaID)
                {
                    tb = tbz;
                }
            }

            List<turist.App_Code.tpeople> ppl = pdb.GetAllPeoples();
            foreach (turist.App_Code.tpeople pplz in ppl)
            {
                if (pplz.PeopleID == ord.ClientIDppl)
                {
                    tp = pplz;
                }
            }

            //tb = tdb.GetTur(ord.T_bazaID);

            //tp = pdb.GetPeople(ord.ClientIDppl);
            int count = pdb.CountPeopleOrder(orderid);

            setchdoc = Convert.ToString(doc.Day);
            setmdoc = Convert.ToString(doc.Month);
            setbirth = tp.Birthday;
            setnametur = tb.Name;
            fioc.Text = tp.Fio;
            setclient = tp.Fio;
            setndoc = ord.Numbdogov;
            setnpasp = tp.Numberpasp;
            setphone = tp.Phone;
            setemail = tp.Email;
            setdin = ord.Datein;
            setdout =ord.Dateout;
            setfaktadr = tb.About;
            setspasp = tp.Seriapasp;
            setturtip = tb.Way.Substring(0, tb.Way.Length-1)+"у";
            setwherepasp = tp.Wherepasp;
            setwhopasp = tp.Whopasp;
            setcolvo = Convert.ToString(count);
            List<turist.App_Code.cervice> list = odb.GetServiceOrder(orderid);
            int countl = list.Count;
            foreach (turist.App_Code.cervice a in list)
            {
                listserv.Items.Add(a.Name);

                costs = costs + a.Cost;
            }
            double costa = ((Convert.ToDouble(tb.Agent) / 100) * Convert.ToDouble(costs));
            costs += (costa);
            setcost = Convert.ToString(costs);
            setcostmin = Convert.ToString(costs * 0.5);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Main();
            //datedoc = odb.GetTemp();
            //orderid = Convert.ToInt32(odb.GetTemp2());
            DateTime doc = new DateTime();
            doc = Convert.ToDateTime(datedoc);
            date1.Text = Convert.ToString(doc);
            date2.Text = Convert.ToString(doc);

            date3.Text = Convert.ToString(doc);
            List<turist.App_Code.Order> ordl = odb.GetAllOrders();
            foreach (turist.App_Code.Order ore in ordl)
            {
                if (ore.OrderID == orderid)
                {
                    ord = ore;
                }
            }

            List<turist.App_Code.t_baza> tbdl = tdb.GetAllTurs();
            foreach (turist.App_Code.t_baza tbz in tbdl)
            {
                if (tbz.T_bazaID == ord.T_bazaID)
                {
                    tb = tbz;
                }
            }

            List<turist.App_Code.tpeople> ppl = pdb.GetAllPeoples();
            foreach (turist.App_Code.tpeople pplz in ppl)
            {
                if (pplz.PeopleID == ord.ClientIDppl)
                {
                    tp = pplz;
                }
            }

            //tb = tdb.GetTur(ord.T_bazaID);

            //tp = pdb.GetPeople(ord.ClientIDppl);
            int count = pdb.CountPeopleOrder(orderid);

            setnametur = tb.Name;

            setndoc = ord.Numbdogov;
            setclientfio = tp.Fio;
            setturfio = tb.Name;
            setdin = ord.Datein;
            setdout = ord.Dateout;
            setturfio = tb.Fio;
            DateTime di = Convert.ToDateTime(ord.Datein);
            DateTime dou = Convert.ToDateTime(ord.Dateout);
            string dl = Convert.ToString(dou.Day-di.Day);
            dlin.Text = dl;
            setcolvo = Convert.ToString(count);
            List<turist.App_Code.cervice> list = odb.GetServiceOrder(orderid);
            foreach (turist.App_Code.cervice a in list)
            {

                costs = costs + a.Cost;
            }
            double costa = ((Convert.ToDouble(tb.Agent) / 100) * Convert.ToDouble(costs));
            costs += (costa);
            setcost = Convert.ToString(costs);
            //setcostmin = Convert.ToString(costs * 0.5);
        }