protected void gvUsers_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteItem") { DeleteUserModal.Show(); int rowIndex = Utils.ParseInt(e.CommandArgument.ToString(), 0); var accountId = Utils.ParseInt(gvUsers.DataKeys[rowIndex][0], 0); var accountType = (ExchangeAccountType)gvUsers.DataKeys[rowIndex][1]; chkEnableForceArchiveMailbox.Visible = false; Session["delAccId"] = accountId; } if (e.CommandName == "OpenMailProperties") { int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_settings", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } if (e.CommandName == "OpenBlackBerryProperties") { int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_blackberry_user", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } if (e.CommandName == "OpenCRMProperties") { int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_settings", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } if (e.CommandName == "OpenUCProperties") { string[] Tmp = e.CommandArgument.ToString().Split('|'); int accountId = Utils.ParseInt(Tmp[0], 0); if (Tmp[1] == "True") { Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_ocs_user", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } if (Tmp[2] == "True") { Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_lync_user", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } else if (Tmp[3] == "True") { Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_sfb_user", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } } }
protected void gvUsers_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteItem") { int rowIndex = Utils.ParseInt(e.CommandArgument.ToString(), 0); var accountId = Utils.ParseInt(gvUsers.DataKeys[rowIndex][0], 0); var accountType = (ExchangeAccountType)gvUsers.DataKeys[rowIndex][1]; if (Utils.CheckQouta(Quotas.ORGANIZATION_DELETED_USERS, cntx) && accountType != ExchangeAccountType.User) { chkEnableForceArchiveMailbox.Visible = true; var account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, accountId); var mailboxPlan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, account.MailboxPlanId); chkEnableForceArchiveMailbox.Checked = mailboxPlan.EnableForceArchiveDeletion; chkEnableForceArchiveMailbox.Enabled = !mailboxPlan.EnableForceArchiveDeletion; } else { chkEnableForceArchiveMailbox.Visible = false; } hdAccountId.Value = accountId.ToString(); DeleteUserModal.Show(); } if (e.CommandName == "OpenMailProperties") { int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_settings", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } if (e.CommandName == "OpenBlackBerryProperties") { int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_blackberry_user", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } if (e.CommandName == "OpenCRMProperties") { int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_settings", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } if (e.CommandName == "OpenUCProperties") { string[] Tmp = e.CommandArgument.ToString().Split('|'); int accountId = Utils.ParseInt(Tmp[0], 0); if (Tmp[1] == "True") { Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_ocs_user", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } else if (Tmp[2] == "True") { Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_lync_user", "AccountID=" + accountId, "ItemID=" + PanelRequest.ItemID)); } } }