private void CarregaDados() { SuspeitasFornecedor suspeitas = new SuspeitasFornecedor(); suspeitas.CarregaGrid(GridView); Session["Suspeitas"] = GridView.DataSource; Session["SuspeitasSortExpression"] = "Suspeita"; Session["SuspeitasSortDirection"] = "DESC"; }
protected void GridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { Int32 index = Convert.ToInt32(e.CommandArgument); SuspeitasFornecedor suspeitas = new SuspeitasFornecedor(); if (suspeitas.DefineUsuario(System.Web.HttpContext.Current.User.Identity.Name, GridView.Rows[index].Cells[3].Text) == true) { CarregaDados(); } } else if (e.CommandName == "Desfazer") { Int32 index = Convert.ToInt32(e.CommandArgument); SuspeitasFornecedor suspeitas = new SuspeitasFornecedor(); if (suspeitas.RemoveUsuario(System.Web.HttpContext.Current.User.Identity.Name, GridView.Rows[index].Cells[3].Text) == true) { CarregaDados(); } } }
protected void ButtonSuspeitas_Click(object sender, EventArgs e) { SuspeitasFornecedor suspeitas = new SuspeitasFornecedor(); suspeitas.CarregaSuspeitas(); }