protected void grdClassificacao_RowCommand(object sender, GridViewCommandEventArgs e) { if (string.IsNullOrEmpty(e.CommandName)) { return; } bool found = false; for (int c = 0; c < this.DataSelected.Count; c++) { if (string.Compare(this.DataSelected[c].UserName, e.CommandName, true) == 0) { found = true; break; } } if (!found) { Model.Boloes.BolaoMembros newEntry = new Model.Boloes.BolaoMembros(e.CommandName); newEntry.FullName = e.CommandArgument.ToString(); //this.DataSelected.Add(newEntry); Business.Boloes.Support.Bolao bolao = new BolaoNet.Business.Boloes.Support.Bolao(base.UserName); bolao.Nome = BolaoUserBasePage.CurrentBolao.Nome; bolao.InsertGrupoMembro(new Framework.Security.Model.UserData(base.UserName), newEntry); } BindSelected(); }
protected void grdClassificacao_RowDataBound(object sender, GridViewRowEventArgs e) { //Se não é registro if (e.Row.RowType != DataControlRowType.DataRow) { return; }//endif registro //Buscando o valor do registro Model.Boloes.BolaoMembros entry = (Model.Boloes.BolaoMembros)e.Row.DataItem; //Buscando os objetos da tela Image imgLastPos = (Image)e.Row.FindControl("imgLastPos"); Label lblLastPos = (Label)e.Row.FindControl("lblLastPos"); LinkButton button = (LinkButton)e.Row.FindControl("lnkAdd"); if (button != null) { button.CommandName = entry.UserName; button.CommandArgument = entry.FullName; } //Se tem informação encontrada if (imgLastPos != null && lblLastPos != null) { int diferenca = entry.LastPosicao - entry.Posicao; //Se continua na mesma posição if (diferenca == 0) { lblLastPos.Text = ""; imgLastPos.ImageUrl = "~/Images/quadrado.gif"; } //Se subiu posições else if (diferenca > 0) { lblLastPos.Text = diferenca.ToString(); imgLastPos.ImageUrl = "~/Images/seta_cima.gif"; } //se Desceu posições else { imgLastPos.ImageUrl = "~/Images/seta_baixo.gif"; lblLastPos.Text = (diferenca * -1).ToString(); } //endif diferenças } //endif informação encontrada }
public bool DeleteGrupoMembro(Framework.Security.Model.UserData usuario, Model.Boloes.BolaoMembros usuarioSelecionado) { int errorNumber = 0; string errorDescription = null; bool result = _daoBase.DeleteGrupoMembro( _currentLogin, this, usuario, usuarioSelecionado, out errorNumber, out errorDescription); if (errorNumber != 0 || !string.IsNullOrEmpty(errorDescription)) { return(false); } return(result); }
protected void grdSelecionados_RowDataBound(object sender, GridViewRowEventArgs e) { //Se não é registro if (e.Row.RowType != DataControlRowType.DataRow) { return; }//endif registro LinkButton lnkRemove = (LinkButton)e.Row.FindControl("lnkRemove"); Model.Boloes.BolaoMembros entry = (Model.Boloes.BolaoMembros)e.Row.DataItem; lnkRemove.CommandArgument = entry.UserName; }
public static Model.Boloes.BolaoMembros ConvertUserPontosToObject(DataRow row) { string nome = ""; if (row.Table.Columns.Contains("UserName") && !Convert.IsDBNull(row["UserName"])) { nome = Convert.ToString(row["UserName"]); } Model.Boloes.BolaoMembros entry = new Model.Boloes.BolaoMembros(nome); if (row.Table.Columns.Contains("FullName") && !Convert.IsDBNull(row["FullName"])) { entry.FullName = Convert.ToString(row["FullName"]); } if (row.Table.Columns.Contains("Posicao") && !Convert.IsDBNull(row["Posicao"])) { entry.Posicao = Convert.ToInt32(row["Posicao"]); } if (row.Table.Columns.Contains("LastPosicao") && !Convert.IsDBNull(row["LastPosicao"])) { entry.LastPosicao = Convert.ToInt32(row["LastPosicao"]); } if (row.Table.Columns.Contains("totalPontos") && !Convert.IsDBNull(row["totalPontos"])) { entry.TotalPontos = Convert.ToInt32(row["totalPontos"]); } if (row.Table.Columns.Contains("totalEmpate") && !Convert.IsDBNull(row["totalEmpate"])) { entry.TotalEmpate = Convert.ToInt32(row["totalEmpate"]); } if (row.Table.Columns.Contains("totalVitoria") && !Convert.IsDBNull(row["totalVitoria"])) { entry.TotalVitoria = Convert.ToInt32(row["totalVitoria"]); } if (row.Table.Columns.Contains("totalGolsGanhador") && !Convert.IsDBNull(row["totalGolsGanhador"])) { entry.TotalGolsGanhador = Convert.ToInt32(row["totalGolsGanhador"]); } if (row.Table.Columns.Contains("totalGolsPerdedor") && !Convert.IsDBNull(row["totalGolsPerdedor"])) { entry.TotalGolsPerdedor = Convert.ToInt32(row["totalGolsPerdedor"]); } if (row.Table.Columns.Contains("totalResultTime1") && !Convert.IsDBNull(row["totalResultTime1"])) { entry.TotalResultTime1 = Convert.ToInt32(row["totalResultTime1"]); } if (row.Table.Columns.Contains("totalResultTime2") && !Convert.IsDBNull(row["totalResultTime2"])) { entry.TotalResultTime2 = Convert.ToInt32(row["totalResultTime2"]); } if (row.Table.Columns.Contains("totalVDE") && !Convert.IsDBNull(row["totalVDE"])) { entry.TotalVDE = Convert.ToInt32(row["totalVDE"]); } if (row.Table.Columns.Contains("totalErro") && !Convert.IsDBNull(row["totalErro"])) { entry.TotalErro = Convert.ToInt32(row["totalErro"]); } if (row.Table.Columns.Contains("totalGolsGanhadorFora") && !Convert.IsDBNull(row["totalGolsGanhadorFora"])) { entry.TotalGolsGanhadorFora = Convert.ToInt32(row["totalGolsGanhadorFora"]); } if (row.Table.Columns.Contains("totalGolsGanhadorDentro") && !Convert.IsDBNull(row["totalGolsGanhadorDentro"])) { entry.TotalGolsGanhadorDentro = Convert.ToInt32(row["totalGolsGanhadorDentro"]); } if (row.Table.Columns.Contains("totalPerdedorFora") && !Convert.IsDBNull(row["totalPerdedorFora"])) { entry.TotalPerdedorFora = Convert.ToInt32(row["totalPerdedorFora"]); } if (row.Table.Columns.Contains("totalPerdedorDentro") && !Convert.IsDBNull(row["totalPerdedorDentro"])) { entry.TotalPerdedorDentro = Convert.ToInt32(row["totalPerdedorDentro"]); } if (row.Table.Columns.Contains("totalGolsEmpate") && !Convert.IsDBNull(row["totalGolsEmpate"])) { entry.TotalGolsEmpate = Convert.ToInt32(row["totalGolsEmpate"]); } if (row.Table.Columns.Contains("totalGolsTime1") && !Convert.IsDBNull(row["totalGolsTime1"])) { entry.TotalGolsTime1 = Convert.ToInt32(row["totalGolsTime1"]); } if (row.Table.Columns.Contains("totalGolsTime2") && !Convert.IsDBNull(row["totalGolsTime2"])) { entry.TotalGolsTime2 = Convert.ToInt32(row["totalGolsTime2"]); } if (row.Table.Columns.Contains("totalPlacarCheio") && !Convert.IsDBNull(row["totalPlacarCheio"])) { entry.TotalPlacarCheio = Convert.ToInt32(row["totalPlacarCheio"]); } if (row.Table.Columns.Contains("totalApostaExtra") && !Convert.IsDBNull(row["totalApostaExtra"])) { entry.TotalApostaExtra = Convert.ToInt32(row["totalApostaExtra"]); } return(entry); }