Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Form.Count == 0)
            {
                Response.Write("{沒收到資料}");
                Response.End();
            }
            else
            {
                WebService1 ws = new WebService1();
                String data = ws.select(int.Parse(Request.Form[0].ToString()));
                Response.Clear();
                Response.ContentType = "application/json ; charset =utf-8";
                Response.Write(data);
                Response.End();

            }

            //WebService1 ws = new WebService1();
            //String data = ws.select();
            //Response.Clear();
            //Response.ContentType = "application/json ; charset =utf-8";
            //Response.Write(data);
            //Response.End();
        }
Пример #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //ServiceReference1. webService = new WebService();
            string      FileName = "C:\\Users\\Jimmy\\source\\repos\\WebApplication2\\WebApplication1\\XMLDataTest.XML";
            string      dataXML  = System.IO.File.ReadAllText(FileName);
            XDocument   x        = XDocument.Load(FileName);
            WebService1 ws       = new WebService1();
            int         i        = ws.ParseXML(x);

            //webService.
        }
Пример #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            WebService1 ws = new WebService1();
            String date1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            DateTime convertedDate = DateTime.Parse(date1);
            ws.insert(
                         20577,
                        "M01",
                       date1,
                         "12:00",
                         130,
                         80,
                         90,
                         20577,
                        date1
                         );

            Console.WriteLine("寫入");
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = Session["idn"].ToString();
            WebService1 web      = new WebService1();
            int         idClient = 0;

            DataTable dtc = web.GetSpecificClients(Int32.Parse(Session["idn"].ToString()));

            foreach (DataRow dr in dtc.Rows)
            {
                idClient    = Int32.Parse(dr["idClient"].ToString());
                Label1.Text = dr["name"].ToString() + dr["lastName"].ToString();
            }

            DataTable dt = web.GetSpecificReserve(idClient);


            foreach (DataRow dr in dt.Rows)
            {
                Label2.Text = "el dia de tu reserva es: " + dr["arrivalDate"].ToString() + "el dia de tu salida es: " + dr["finishDate"].ToString() + ". Tu Habitación es: " + dr["typeRoom"].ToString();
            }
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ws = new WebService1();
            //recivir lo que has enviat en el boto del login client en el redirect
            //this.id = String.IsNullOrEmpty(Request.QueryString["id"]) ? "" : Request.QueryString["id"].ToString();
            if (User.Identity.IsAuthenticated)
            {
                this.id = Session["clientId"].ToString();
                int idnClient = -1;
                dtClient = ws.dataClient(Int32.Parse(id));

                foreach (DataRow dr in dtClient.Rows)
                {
                    Label4.Text = dr["name"].ToString();
                    Label6.Text = " " + dr["idn"].ToString();
                    Label5.Text = " " + dr["surname"].ToString();

                    idnClient = Int32.Parse(dr["idn"].ToString());
                }

                dtReserve = ws.dataReserve(idnClient, 0);
                String reserve;

                foreach (DataRow dr in dtReserve.Rows)
                {
                    reserve   = Label4.Text + "\t";
                    dtReserve = ws.dataRecepcionist(Int32.Parse(dr["idRecepcionist"].ToString()));
                    foreach (DataRow dr1 in dtReserve.Rows)
                    {
                        reserve += dr1["name"].ToString() + "\t";
                    }
                    reserve += dr["arrivaldate"].ToString() + "\t";
                    reserve += dr["finishdate"].ToString() + "\t";
                    reserve += dr["typeRoom"].ToString() + "\t";

                    ListBox1.Items.Add(reserve);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (User.Identity.IsAuthenticated)
            {
                ListBox1.Items.Clear();
                listaReservas = new List <Reserve>();
                ws            = new WebService1();


                this.id            = Session["recepcionistId"].ToString();
                datosRecepcionista = ws.dataRecepcionist(Int32.Parse(id));

                foreach (DataRow dr in datosRecepcionista.Rows)
                {
                    Label4.Text = dr["name"].ToString();

                    Label5.Text = " " + dr["surname"].ToString();
                }

                dtR = ws.dataReserve(Int32.Parse(id), 1);
                String reserveString;

                foreach (DataRow dr in dtR.Rows)
                {
                    reserveString  = "";
                    reserveString  = "Reserve id: " + dr["id"].ToString();
                    reserveString += "IDN Client: " + dr["idnClient"].ToString();
                    reserveString += " Arrival Date: " + dr["arrivaldate"].ToString() + "\t";
                    reserveString += " Finish Date: " + dr["finishdate"].ToString() + "\t";
                    reserveString += " Type Room: " + dr["typeRoom"].ToString() + "\t";

                    ListBox1.Items.Add(reserveString);
                    Reserve reserve = new Reserve(Int32.Parse(dr["id"].ToString()), Int32.Parse(id), Int32.Parse(dr["idnClient"].ToString()), dr["arrivaldate"].ToString(), dr["finishdate"].ToString(), dr["typeRoom"].ToString());
                    listaReservas.Add(reserve);
                }
            }
        }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     wes = new WebService1();
 }