private void grdDistributorList_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int num = (int)this.grdDistributorList.DataKeys[rowIndex].Value; Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.SettingsManager.GetSiteSettings(num); if (e.CommandName == "StopCooperation") { if (siteSettings != null && !siteSettings.Disabled) { this.ShowMsg("请先暂停该分销商的站点", false); return; } if (DistributorHelper.Delete(num)) { this.DeleteDistributorFile(num); this.BindDistributors(); this.ShowMsg("成功的清除了该分销商及该分销商下的所有数据", true); return; } this.ShowMsg("清除去失败", false); } }
private void grdDistributorList_RowCommand(object serder, GridViewCommandEventArgs e) { int rowIndex = ((GridViewRow)((Control)e.CommandSource).NamingContainer).RowIndex; int distributorUserId = (int)grdDistributorList.DataKeys[rowIndex].Value; SiteSettings siteSettings = SettingsManager.GetSiteSettings(distributorUserId); if (e.CommandName == "StopCooperation") { if (!((siteSettings == null) || siteSettings.Disabled)) { ShowMsg("请先暂停该分销商的站点", false); } else if (DistributorHelper.Delete(distributorUserId)) { DeleteDistributorFile(distributorUserId); BindDistributors(); ShowMsg("成功的清除了该分销商及该分销商下的所有数据", true); } else { ShowMsg("清除去失败", false); } } }