public void DenyAccess() { string TellCommand = ""; string myUserName = ""; string myDeviceName = ""; string myServerName = ""; DataRow myRow = UsersGrid.GetDataRow(UsersGrid.FocusedRowIndex); try { myUserName = myRow["UserName"].ToString(); Session["myUserName"] = myUserName; myServerName = myRow["ServerName"].ToString(); Session["myServerName"] = myServerName; myDeviceName = myRow["DeviceID"].ToString(); Session["myDeviceName"] = myDeviceName; TellCommand = "Tell Traveler Security flagsAdd lock " + myDeviceName + " " + myUserName; Session["TellCommand"] = TellCommand; } catch (Exception) { myUserName = ""; } msgPopupControl.ShowOnPageLoad = true; msgLabel.Text = "Are you sure you want to deny access to " + myUserName + " on device " + myDeviceName + "?"; }
public void ChangeApprove() { string TellCommand = ""; string myUserName = ""; string myDeviceName = ""; string myServerName = ""; DataRow myRow = UsersGrid.GetDataRow(UsersGrid.FocusedRowIndex); try { myUserName = myRow["UserName"].ToString(); // Session["myUserName"] = myUserName; myServerName = myRow["ServerName"].ToString(); // Session["myServerName"] = myServerName; myDeviceName = myRow["DeviceID"].ToString(); // Session["myDeviceName"] = myDeviceName; TellCommand = "Tell Traveler Security approval approve " + myDeviceName + " " + myUserName; // Session["TellCommand"] = TellCommand; VSWebBL.DashboardBL.LotusTravelerHealthBLL.Ins.SENDTravelerConsoleCommand(myServerName, TellCommand, myUserName); } catch (Exception) { myUserName = ""; } }
protected override void OnLoad(EventArgs e) { if (!Page.IsPostBack) { SqlServer server = SqlServer.CurrentServer; try { server.Connect(); } catch (System.Exception ex) { //Response.Redirect("Error.aspx?errorPassCode=" + 2002); Response.Redirect(String.Format("error.aspx?errormsg={0}&stacktrace={1}", Server.UrlEncode(ex.Message), Server.UrlEncode(ex.StackTrace))); } SqlDatabase database = SqlDatabase.CurrentDatabase(server); UsersGrid.DataSource = database.Users; UsersGrid.DataBind(); CreateUserLink.NavigateUrl = "CreateDatabaseUser.aspx?database=" + Server.UrlEncode(database.Name); server.Disconnect(); } base.OnLoad(e); }
void SetThread(InstaDirectInboxThread thread) { try { if (thread != null) { UsersGrid.Children.Clear(); AddUsers(thread.Users); if (thread.ThreadId.Contains("FAKETHREAD")) { Title = thread.Users[0].UserName; FullName = thread.Users[0].FullName; } else { Title = thread.Title; } if (thread.Users == null || thread.Users?.Count == 0) { if (thread.Inviter != null) { thread.Users.Add(thread.Inviter.ToUserShortFriendship()); if (string.IsNullOrEmpty(thread.Title)) { thread.Title = thread.Inviter.UserName.ToLower(); } } } } } catch { } UsersGrid.UpdateLayout(); }
public void LogCreate() { string TellCommand = ""; string myUserName = ""; string myDeviceName = ""; string myServerName = ""; DataRow myRow = UsersGrid.GetDataRow(UsersGrid.FocusedRowIndex); try { myUserName = myRow["UserName"].ToString(); Session["myUserName"] = myUserName; myServerName = myRow["ServerName"].ToString(); Session["myServerName"] = myServerName; myDeviceName = myRow["DeviceID"].ToString(); Session["myDeviceName"] = myDeviceName; TellCommand = "Tell Traveler Dump " + myUserName; Session["TellCommand"] = TellCommand; } catch (Exception) { myUserName = ""; } msgPopupControl.ShowOnPageLoad = true; msgLabel.Text = "Create a dump file " + myUserName + "?"; }
void Sets(InstaDirectInboxThread thread) { try { if (thread != null) { UsersGrid.Children.Clear(); AddUsers(thread.Users); if (thread.Users == null || thread.Users?.Count == 0) { if (thread.Inviter != null) { thread.Users.Add(thread.Inviter.ToUserShortFriendship()); if (string.IsNullOrEmpty(thread.Title)) { thread.Title = thread.Inviter.UserName.ToLower(); } } } if (thread.Items?.LastOrDefault() != null) { UpdateItem(thread.Items.LastOrDefault()); } } } catch { } UsersGrid.UpdateLayout(); }
private void UsersPanel_VisibleChanged(object sender, EventArgs e) { if (this.Visible) { if (myServer.dataRefreshInterval != 0) { UserRefreshTimer.Interval = myServer.dataRefreshInterval; UserRefreshTimer.Start(); } nested = 0; RefreshUsers(); UsersGrid.AutoResizeColumns(); this.CancelButton.Hide(); this.BackButton.Hide(); this.DetailsButton.Show(); } else { if (myServer.dataRefreshInterval != 0) { UserRefreshTimer.Stop(); } } }
protected void ShowUsers(object sender, EventArgs e) { myDAL objmyDAl = new myDAL(); DataTable DT = new DataTable(); int found; found = objmyDAl.AllUsers(ref DT); if (found != 1) { Message.Text = "There was some error"; } else { if (DT.Rows.Count > 0) { Message.Text = "Following Users are found"; UsersGrid.DataSource = DT; UsersGrid.DataBind(); } else { Message.Text = "No Users Found"; } } }
public void ClearWipe() { string TellCommand = ""; string myUserName = ""; string myDeviceName = ""; string myServerName = ""; string myDeviceTitle = ""; DataRow myRow = UsersGrid.GetDataRow(UsersGrid.FocusedRowIndex); try { myUserName = myRow["UserName"].ToString(); Session["myUserName"] = myUserName; myServerName = myRow["ServerName"].ToString(); Session["myServerName"] = myServerName; myDeviceName = myRow["DeviceID"].ToString(); // Session["myDeviceName"] = myDeviceName; myDeviceTitle = myRow["DeviceID"].ToString(); // Session["myDeviceTitle"] = myDeviceName; TellCommand = "Tell Traveler Security flagsRemove all " + myDeviceName + " " + myUserName; Session["TellCommand"] = TellCommand; } catch (Exception) { myUserName = ""; } msgPopupControl.ShowOnPageLoad = true; msgLabel.Text = "Try to restore access to " + myUserName + " on device " + myDeviceTitle + "?" + "\n" + "Note that this will ONLY work if the device has not already been wiped."; }
public void LogEnable() { string TellCommand = ""; string myUserName = ""; string myDeviceName = ""; string myServerName = ""; DataRow myRow = UsersGrid.GetDataRow(UsersGrid.FocusedRowIndex); try { myUserName = myRow["UserName"].ToString(); Session["myUserName"] = myUserName; myServerName = myRow["ServerName"].ToString(); Session["myServerName"] = myServerName; myDeviceName = myRow["DeviceID"].ToString(); // Session["myDeviceName"] = myDeviceName; TellCommand = "Tell Traveler Log RemoveUser " + myUserName; Session["TellCommand"] = TellCommand; } catch (Exception) { myUserName = ""; } msgPopupControl.ShowOnPageLoad = true; msgLabel.Text = "Disable finest logging level for " + myUserName + "?"; }
public void FillUserGridFromSession() { if (Session["Fillgid"] != "" && Session["Fillgid"] != null) { UsersGrid.DataSource = (DataTable)Session["Fillgid"]; UsersGrid.DataBind(); } }
//********************************************************************* // // The BindProjects method retrieves the list of projects the current user // can view based on their role and then databinds them to the ProjectsGrid // //********************************************************************* private void BindUsers() { ITUserCollection userList = ITUser.GetAllUsers(); // Call method to sort the data before databinding SortGridData(userList, SortField, SortAscending); UsersGrid.DataSource = userList; UsersGrid.DataBind(); }
/// <summary> /// Заполнения списка пользователей /// </summary> private void FillGrid() { ListEx <UserProfile> users = UserProfile.GetList(PageFilter); int totalRecords = users.TotalRecords; ToolsContainerControl.CheckForceFilterShow(totalRecords); PagingControl.SetTotalRecords(totalRecords); UsersGrid.DataSource = users; UsersGrid.DataBind(); UsersNumberLbl.Text = String.Format(UsersNumberTemplate, Membership.GetNumberOfUsersOnline(), totalRecords); }
protected void PermissionsTree_CustomCallback(object sender, DevExpress.Web.ASPxTreeList.TreeListCustomCallbackEventArgs e) { PermissionsTree.UnselectAll(); if (UsersGrid.FocusedRowIndex > -1) { new Permission().ListUserPermissions((long)UsersGrid.GetRowValues(UsersGrid.FocusedRowIndex, "ID")).ForEach(p => { PermissionsTree.FindNodeByKeyValue(p.ID.ToString()).Selected = true; }); } }
/// <summary> /// 数据绑定 /// </summary> private void BindGrid() { string sortField = UsersGrid.Columns[UsersGrid.SortColumnIndex].SortField; string sortDirection = UsersGrid.SortDirection; DataTable table = GetUserInfoDateTable(); DataView TableView = table.DefaultView; TableView.Sort = String.Format("{0} {1}", sortField, sortDirection); UsersGrid.DataSource = TableView; UsersGrid.DataBind(); }
protected void UsersGrid_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e) { UsersGrid.Selection.UnselectAll(); if (RolesGrid.FocusedRowIndex > -1) { Master.UserObject.ListRoleUsers((int)RolesGrid.GetRowValues(RolesGrid.FocusedRowIndex, "ID")).ForEach(u => { UsersGrid.Selection.SelectRow(UsersGrid.FindVisibleIndexByKeyValue(u.ID.ToString())); }); } }
protected void RolesGrid_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e) { RolesGrid.Selection.UnselectAll(); if (UsersGrid.FocusedRowIndex > -1) { new Role().ListUserRoles((long)UsersGrid.GetRowValues(UsersGrid.FocusedRowIndex, "ID")).ForEach(r => { RolesGrid.Selection.SelectRow(RolesGrid.FindVisibleIndexByKeyValue(r.ID.ToString())); }); } }
public DataTable SetGrid(int lastmin, int agomin) { DataTable dt = VSWebBL.DashboardBL.LotusTravelerHealthBLL.Ins.SetGrid(lastmin, agomin); UsersGrid.DataSource = dt; UsersGrid.DataBind(); Session["Fillgid"] = dt; return(dt); }
public override void DataBind() { string[] users = Users.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); if (ShowUsers) { DataTable userTable = new DataTable(); userTable.Locale = CultureInfo.InvariantCulture; userTable.Columns.Add(new DataColumn("UserId", typeof(int))); userTable.Columns.Add(new DataColumn("Details", typeof(string))); foreach (string s in users) { int userId = int.Parse(s, CultureInfo.InvariantCulture); string details = String.Empty; if (!Mediachase.IBN.Business.Calendar.CheckUserCalendar(userId)) { details = LocRM.GetString("NoCalendar"); } DataRow dr = userTable.NewRow(); dr["UserId"] = userId; dr["Details"] = details; userTable.Rows.Add(dr); } UsersGrid.DataSource = userTable.DefaultView; UsersGrid.DataBind(); } ImageHeight = users.Length * ResourceChart.ItemHeight; // +ResourceChart.HeaderHeight; divImg.Style.Add(HtmlTextWriterStyle.Height, (ImageHeight + ResourceChart.HeaderHeight).ToString() + "px"); LinkToGraph.Value = String.Format(CultureInfo.InvariantCulture, "{0}?Users={1}&Vast={2}&StartDate={3}&CurDate={4}&ObjectTypes={5}&HObjects={6}&HTypes={7}", ResolveClientUrl("~/Projects/ResourceChartImage.aspx"), Users, IntervalDuration == 7, StartDate.ToString("yyyy-MM-dd"), Server.UrlEncode(CurDate.ToString("yyyy-MM-dd HH:mm")), ObjectTypes, HObjects, HTypes); base.DataBind(); }
protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e) { if (!IsPostBack) { SetGraphForDeviceType(""); } else { int index = UsersGrid.FocusedRowIndex; if (index > -1) { value = UsersGrid.GetRowValues(index, "DeviceName").ToString(); Session["value"] = value; SetGraphForDeviceType(value); } } }
protected void btnDastor_Click(object sender, EventArgs e) { if (txte7em.Text == "akeel") { var gUsers = from u in new zlnkDC().usrs select u; UsersGrid.DataSource = gUsers; UsersGrid.DataBind(); var gZlinks = from z in new zlnkDC().zlnks select z; zlinksGrid.DataSource = gZlinks; zlinksGrid.DataBind(); } }
protected override void OnLoad(EventArgs e) { if (!Page.IsPostBack) { SqlServer server = SqlServer.CurrentServer; server.Connect(); SqlDatabase database = SqlDatabase.CurrentDatabase(server); UsersGrid.DataSource = database.Users; UsersGrid.DataBind(); CreateUserLink.NavigateUrl = "CreateDatabaseUser.aspx?database=" + database.Name; server.Disconnect(); } base.OnLoad(e); }
void Save() { StringBuilder sb = new StringBuilder(); sb.Append("<data>") .AppendFormat("<user_id>{0}</user_id>", UsersGrid.GetRowValues(UsersGrid.FocusedRowIndex, "ID")) .Append("<roles>"); RolesGrid.GetSelectedFieldValues("ID").ToList().ForEach(r => sb.AppendFormat("<role><id>{0}</id></role>", r)); sb.Append("</roles><permissions>"); PermissionsTree.GetSelectedNodes().ForEach(n => sb.AppendFormat("<permission><id>{0}</id></permission>", n.Key)); sb.Append("</permissions></data>"); //System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "file.xml", xml); Master.UserObject.TX_UM(0, sb.ToString()); if (Master.UserObject.IsError) { throw new Exception(General.Utilities.GetMessage("Abort")); } }
public void BindDetails() { using (SqlConnection connection = conn) { connection.Open(); SqlCommand cmdSelectBooks = new SqlCommand("Select * from DS_Library.[dbo].Books;", connection); SqlCommand cmdSelectUsers = new SqlCommand("Select Name, Email, Address from DS_Library.[dbo].Users;", connection); SqlCommand cmdSelectBooksAndUsers = new SqlCommand("select a.Name, a.Email,a.Address, c.Title FROM DS_Library.[dbo].[Users] a Inner JOIN DS_Library.[dbo].[Rentals] b ON a.Email = b.UserEmail Inner JOIN DS_Library.[dbo].[Books] c ON b.BookID = c.BookID; ", connection); using (SqlCommand command = cmdSelectBooks) { //Command 1 using (SqlDataReader reader = command.ExecuteReader()) { BooksGrid.DataSource = reader; BooksGrid.DataBind(); } } using (SqlCommand command = cmdSelectUsers) { //Command 2 using (SqlDataReader reader = command.ExecuteReader()) { UsersGrid.DataSource = reader; UsersGrid.DataBind(); } } using (SqlCommand command = cmdSelectBooksAndUsers) { //Command 3 using (SqlDataReader reader = command.ExecuteReader()) { UserRent.DataSource = reader; UserRent.DataBind(); } } } }
public UsersGrid GetGrid(UsersGridRequest model) { UsersGrid singleItem = new UsersGrid(); DataProvider.ExecuteCmd("dbo.UserBase_Grid" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@DisplayLength", model.DisplayLength); paramCollection.AddWithValue("@DisplayStart", model.DisplayStart); paramCollection.AddWithValue("@SortCol", model.SortCol); paramCollection.AddWithValue("@SortDir", model.SortDir); paramCollection.AddWithValue("@Search", model.Search); } , singleRecordMapper : delegate(IDataReader reader, short set) { switch (set) { case 0: singleItem.recordsTotal = reader.GetSafeInt32(0); break; case 1: singleItem.recordsFiltered = reader.GetSafeInt32(0); break; case 2: Users u = Mapper(reader); if (singleItem.data == null) { singleItem.data = new List <Users>(); } singleItem.data.Add(u); break; default: singleItem = null; break; } }); return(singleItem); }
protected void Grid_PageIndexChanged(object source, DataGridPageChangedEventArgs e) { DataSet myDataSet = GetViewState(); DataTable myDataTable = myDataSet.Tables[0]; DataView _dataView = SortDataTable(myDataTable, true); UsersGrid.DataSource = _dataView; UsersGrid.CurrentPageIndex = e.NewPageIndex; UsersGrid.DataBind(); // Rebind the sorted data into ViewState DataTable dt = new DataTable(); DataSet ds = new DataSet(); dt = _dataView.ToTable(); ds.Merge(dt); SetViewState(ds); //Grid.CurrentPageIndex = e.NewPageIndex; //LoadPortalUserAccounts(); }
//This is invoked when the grid column is Clicked for Sorting, //Clicking again will Toggle Descending/Ascending through the Sort Expression protected void Grid_SortCommand(object sender, DataGridSortCommandEventArgs e) { DataSet myDataSet = GetViewState(); DataTable myDataTable = myDataSet.Tables[0]; GridViewSortExpression = e.SortExpression; //Gets the Pageindex of the GridView. int iPageIndex = UsersGrid.CurrentPageIndex; DataView _dataView = SortDataTable(myDataTable, false); UsersGrid.DataSource = _dataView; UsersGrid.DataBind(); UsersGrid.CurrentPageIndex = iPageIndex; // Rebind the sorted data into ViewState DataTable dt = new DataTable(); DataSet ds = new DataSet(); dt = _dataView.ToTable(); ds.Merge(dt); SetViewState(ds); }
async Task DeleteConfirmation(UserDetailsDto user) { bool ok = (await DialogService.Confirm("Are you sure to delete user?", "Delete User", new ConfirmOptions() { OkButtonText = "Yes", CancelButtonText = "No" })).GetValueOrDefault(); if (ok) { var result = await AuthenticationApiService.DeleteUserAsync(user.Id); if (result.IsSuccessful) { ApplicationUsers.Remove(user); await UsersGrid.Reload(); } else { UtilityServices.ShowNotification(NotificationSeverity.Error, "Delete User failed", result.Errors.ToArray()); NavigationManager.NavigateTo("/users", true); } } }
protected void UsersGrid_OnPreRowDataBound(object sender, FineUI.GridPreRowEventArgs e) { LinkButtonField lbf = UsersGrid.FindColumn("userdelete") as LinkButtonField; LinkButtonField wf = UsersGrid.FindColumn("useredit") as LinkButtonField; DataRowView row = e.DataItem as DataRowView; string loginid = row[1].ToString(); string usertype = row[2].ToString(); if (loginid == "admin" || loginid == "user" || loginid == "reader") { lbf.Enabled = false; lbf.Icon = FineUI.Icon.Lock; lbf.ToolTip = "默认用户锁定操作"; wf.Enabled = false; wf.Icon = FineUI.Icon.Lock; wf.ToolTip = "默认用户锁定操作"; } else { lbf.Enabled = true; lbf.Icon = FineUI.Icon.Delete; lbf.ToolTip = "删除用户"; //if (usertype == "读者") //{ // wf.Enabled = false; // wf.Icon = FineUI.Icon.Lock; // wf.ToolTip = "读者锁定操作"; //} //else //{ wf.Enabled = true; wf.Icon = FineUI.Icon.Pencil; wf.ToolTip = "编辑用户"; wf.OnClientClick = WindowEdit.GetShowReference("UserEdit.aspx?flag=edit&id=" + loginid + "", "用户编辑"); //} } }
protected void Submit_Click(object sender, EventArgs e) { if (Page.IsValid) { string firstName = FirstName.Text; string lastName = LastName.Text; string userName = UserName.Text; string emailAddress = EmailAddress.Text; string confirmEmail = ConfirmEmail.Text; string password = Password.Text; string confirmPassword = ConfirmPassword.Text; bool terms = Terms.Checked; Message.Text = firstName + lastName + userName + emailAddress + confirmEmail + password + confirmPassword; if (terms) // this means if terms == true, aka is the checkbox checked { // do webgrid processing here UserClass theUserRegistration = new UserClass(firstName, lastName, userName, emailAddress, confirmEmail, password, confirmPassword); // add this instance to the list of entries userRegistrations.Add(theUserRegistration); // attach the collection of entries to the GridView control // we need to create the GridView in the .aspx page first. UsersGrid.DataSource = userRegistrations; // userRegistrations is the name of the List<T> we created above UsersGrid.DataBind(); } else { Message.Text = "You did not agree to the terms!"; } } }
public Index() { Users = new UsersGrid(); }