//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 loginbutton_Click(object sender, EventArgs e)
        {
            QMRServiceReference.qmrserviceSoapClient client = new QMRServiceReference.qmrserviceSoapClient();

            string loginSuccess = client.Login(txtUsername.Text, txtPassword.Text);

            if (loginSuccess == "Success")
            {
                Session.Add("user", txtUsername.Text);
                Response.Redirect("~/default.aspx", true);
            }
        }
        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();
                }
            }
        }