コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Business.Campeonatos.Support.Campeonato business =
                    new Business.Campeonatos.Support.Campeonato(base.UserName, CurrentCampeonato);

                this.cboTime.DataSource     = business.LoadTimes();
                this.cboTime.DataTextField  = "Nome";
                this.cboTime.DataValueField = "Nome";
                this.cboTime.DataBind();



                business.Nome = CurrentCampeonato.Nome;

                this.cboGrupo.DataSource     = business.LoadGrupos();
                this.cboGrupo.DataTextField  = "Nome";
                this.cboGrupo.DataValueField = "Nome";
                this.cboGrupo.DataBind();


                this.cboFase.DataSource     = business.LoadFases();
                this.cboFase.DataTextField  = "Nome";
                this.cboFase.DataValueField = "Nome";
                this.cboFase.DataBind();
            }

            BindChart();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Business.Campeonatos.Support.Campeonato campeonato =
                    new Business.Campeonatos.Support.Campeonato(base.UserName, CurrentCampeonato);

                this.cboTime.DataSource     = campeonato.LoadTimes();
                this.cboTime.DataTextField  = "Nome";
                this.cboTime.DataValueField = "Nome";
                this.cboTime.DataBind();
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Business.Campeonatos.Support.Campeonato business =
                    new Business.Campeonatos.Support.Campeonato(base.UserName, CurrentCampeonato.Nome);

                IList <Framework.DataServices.Model.EntityBaseData> list = business.LoadTimes();

                ViewState["Times"] = list;

                BindGrid();
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Business.Campeonatos.Support.Campeonato business =
                    new Business.Campeonatos.Support.Campeonato(base.UserName, CurrentCampeonato.Nome);

                #region Buscando os times
                IList <Framework.DataServices.Model.EntityBaseData> list = business.LoadTimes();
                ViewState["Times"] = list;
                #endregion

                #region Atualizando as apostas extras

                Business.Boloes.Support.ApostaExtra businessExtra =
                    new Business.Boloes.Support.ApostaExtra(base.UserName);

                IList <Framework.DataServices.Model.EntityBaseData> listExtra = businessExtra.SelectAll("NomeBolao='" + CurrentBolao.Nome + "'");

                ViewState["Grid"] = listExtra;

                this.grdApostas.DataSource = ViewState["Grid"];
                this.grdApostas.DataBind();


                #endregion

                #region Buscando a classificação do campeonato
                Business.Boloes.Support.Bolao     businessBolao     = new BolaoNet.Business.Boloes.Support.Bolao(base.UserName, CurrentBolao.Nome);
                IList <Model.Boloes.BolaoMembros> listClassificacao = businessBolao.LoadClassificacao(0);
                #endregion

                #region Criando a lista de usuários

                List <Model.Boloes.Simulation.ApostasExtrasBolaoMembros> listSimulation = new List <Model.Boloes.Simulation.ApostasExtrasBolaoMembros>();

                foreach (Model.Boloes.BolaoMembros entry in listClassificacao)
                {
                    Model.Boloes.Simulation.ApostasExtrasBolaoMembros extraUser = new BolaoNet.Model.Boloes.Simulation.ApostasExtrasBolaoMembros();
                    extraUser.Copy((Model.Boloes.BolaoMembros)entry);
                    extraUser.LastPontos  = extraUser.TotalPontos;
                    extraUser.LastPosicao = extraUser.Posicao;

                    listSimulation.Add(extraUser);
                }
                #endregion

                #region Buscando as apostas extras dos usuários

                Business.Boloes.Support.ApostaExtraUsuario businessExtraUser = new BolaoNet.Business.Boloes.Support.ApostaExtraUsuario(base.UserName);
                businessExtra.Bolao = CurrentBolao;


                foreach (Model.Boloes.ApostaExtra entry in listExtra)
                {
                    IList <Framework.DataServices.Model.EntityBaseData> listPos = businessExtraUser.SelectByPosicao(CurrentBolao, entry.Posicao, null);

                    foreach (Model.Boloes.ApostaExtraUsuario modelExtraUser in listPos)
                    {
                        for (int c = 0; c < listSimulation.Count; c++)
                        {
                            if (string.Compare(listSimulation[c].UserName, modelExtraUser.UserName, true) == 0)
                            {
                                listSimulation[c].ListApostasExtras.Add(modelExtraUser);
                                break;
                            }
                        }
                    }
                }

                Classificacao = listSimulation;
                #endregion


                BindUsers();
            }
        }