コード例 #1
0
        //Functionality to Set Room Reservation

        protected void gvtwo_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (((Button)e.CommandSource).CommandName)
            {
            case "Reserve":

                String s = e.CommandArgument.ToString();
                int    RoomID;
                int.TryParse(s, out RoomID);

                QMRServiceReference.qmrserviceSoapClient client = new QMRServiceReference.qmrserviceSoapClient();

                client.ReserveRoom(RoomID, true);


                gvtwo.DataSource = client.GetListRooms();
                gvtwo.DataBind();


                Label1.Text = RoomID.ToString();
                break;

            default:

                break;
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] == null)
            {
                Response.Redirect("~/Login.aspx", true);
            }
            else
            {
                if (!IsPostBack)
                {
                    QMRServiceReference.qmrserviceSoapClient client = new QMRServiceReference.qmrserviceSoapClient();

                    gvtwo.DataSource = client.GetListRooms();
                    gvtwo.DataBind();
                }
            }
        }