Пример #1
0
    /// <summary>
    /// Delete the selected users from DB.
    /// </summary>
    /// <param name="sender">Sender object</param>
    /// <param name="e">Event argument</param>
    protected void UserTable_DeleteClicked(object sender, ZentityGridEventArgs e)
    {
        if (e.EntityIdList != null && e.EntityIdList.Count > 0)
        {
            using (ResourceDataAccess resourceDAL = new ResourceDataAccess(Utility.CreateContext()))
            {
                Utility.ShowMessage(GridErrorLabel, resourceDAL.DeleteUsers(e.EntityIdList, userToken), true);
            }

            FillUserGrid();

            if (!string.IsNullOrEmpty(txtLoginName.Text.Trim()))
            {
                ResetRegistrationForm();
                Response.Redirect(Resources.Resources.UsersPage);
            }
        }
    }