protected void grdDistributorSites_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "open") { int num = Convert.ToInt32(e.CommandArgument); int userId = Convert.ToInt32(this.grdDistributorSites.DataKeys[num].Value); Literal literal = (Literal)this.grdDistributorSites.Rows[num].FindControl("litState"); if (literal.Text == "开启") { if (!DistributorHelper.CloseEtao(userId)) { this.ShowMsg("暂停失败", false); } } else if (!DistributorHelper.OpenEtao(userId)) { this.ShowMsg("开启失败", false); } } this.BindRequests(); }