protected void btnRegister_Click(object sender, EventArgs e)
        {
            LicenseManagementSystemWebServiceSoapClient wsClient = new LicenseManagementSystemWebServiceSoapClient();

            if (Page.IsValid && wsClient.Registration(txtEmail.Text, txtPassword.Text))
            {
                Response.Redirect("/Login.aspx?message=Your account was created successfully.");
            }
            else
            {
                lblMessage.Visible = true;
                lblMessage.Text    = $"A user with {txtEmail.Text} name already exists.";
            }
        }
        // Instance methods
        /// <summary>
        /// Binds a portion of licenses recived from  LicenseManagementSystemWebService client.
        /// </summary>
        /// <param name="wsClient">LicenseManagementSystemWebService client.</param>
        /// <param name="user">A user with permission to read licenses data.</param>
        /// <param name="pageNumber">A number of current page displayed in GridView.</param>
        /// <param name="columnToSort">A number of column to sort.</param>
        /// <param name="typeOfSorting">True - ascending, false - descending.</param>
        /// <param name="rowsOnPage">A number of rows displayed on one page.</param>
        public void LicensesDataBind(LicenseManagementSystemWebServiceSoapClient wsClient, User user, int pageNumber, int columnToSort, bool typeOfSorting, int rowsOnPage)
        {
            // Get Licenses data from a database.
            LicensesContainer result = wsClient.GetLicensesData(user.UserEmail, user.UserAccessNumber, pageNumber, columnToSort, rowsOnPage, typeOfSorting);

            // Set number of rows to display in gridview
            gridView.PageSize = rowsOnPage;

            // Bind the data
            gridView.DataSource = result.LicensesDataSet;
            gridView.DataBind();

            // Bind a page numbers.
            repeaterDataBind(pageNumber, result.NumberOfAllLicenses, int.Parse(dropDownList.SelectedItem.Value));
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            LicenseManagementSystemWebServiceSoapClient wsClient = new LicenseManagementSystemWebServiceSoapClient();
            User loggedUser = wsClient.Login(txtEmail.Text, txtPassword.Text);

            if (Page.IsValid && loggedUser.UserAccessNumber != Guid.Empty)
            {
                Session["loggedUsersAccessNumber"] = loggedUser.UserAccessNumber;
                FormsAuthentication.RedirectFromLoginPage(txtEmail.Text, cbxRememberMe.Checked);
            }
            else
            {
                lblMessage.Visible = true;
                lblMessage.Text    = "Wrong user name or/and password";
            }
        }