private long GetTotal(Model.Boloes.JogoUsuario.TypeAposta aposta, Model.Boloes.JogoUsuario.TypeAutomatico typeAutomatico) { DateTime dataInicial = DateTime.MinValue; DateTime dataFinal = DateTime.MinValue; int rodada = 0; if (this.rdoPeriodo.Checked) { dataInicial = Convert.ToDateTime(this.txtDataInicial.Text); dataFinal = Convert.ToDateTime(this.txtDataFinal.Text); } else if (this.rdoRodada.Checked) { rodada = Convert.ToInt32(this.cboRodadas.Text); } Business.Boloes.Support.JogoUsuario jogoUsuario = new BolaoNet.Business.Boloes.Support.JogoUsuario(base.UserName); return(jogoUsuario.SelectCountByPeriodo( base.BaseCurrentBolao, base.UserName, rodada, dataInicial, dataFinal, aposta, typeAutomatico, "")); }
private void Save() { if (!Page.IsValid) { return; } DateTime dataInicial = DateTime.MinValue; DateTime dataFinal = DateTime.MaxValue; int random1 = 0; int random2 = 0; int time1 = 0; int time2 = 0; int rodada = 0; bool random = false; string nomeTime = null; Model.Boloes.JogoUsuario.TypeAposta typeAposta = Model.Boloes.JogoUsuario.TypeAposta.Nao_Apostados; Model.Boloes.JogoUsuario.TypeAutomatico typeAutomatico = Model.Boloes.JogoUsuario.TypeAutomatico.Automatico; if (this.rdoDefault.Checked) { } else if (this.rdoPeriodo.Checked) { dataInicial = Convert.ToDateTime(this.txtDataInicial.Text); dataFinal = Convert.ToDateTime(this.txtDataFinal.Text); } else if (this.rdoRodada.Checked) { rodada = Convert.ToInt32(this.cboRodadas.Text); } if (this.rdoFixo.Checked) { time1 = Convert.ToInt32(this.txtTimeCasa.Text); time2 = Convert.ToInt32(this.txtTimeFora.Text); random = false; } else if (this.rdoAleatorio.Checked) { random1 = Convert.ToInt32(this.txtValorInicial.Text); random2 = Convert.ToInt32(this.txtValorFinal.Text); random = true; } if (this.rdoTodasApostas.Checked) { typeAposta = BolaoNet.Model.Boloes.JogoUsuario.TypeAposta.Todos; typeAutomatico = BolaoNet.Model.Boloes.JogoUsuario.TypeAutomatico.Todos; } else if (this.rdoNaoApostados.Checked) { typeAposta = BolaoNet.Model.Boloes.JogoUsuario.TypeAposta.Nao_Apostados; typeAutomatico = BolaoNet.Model.Boloes.JogoUsuario.TypeAutomatico.Todos; } else if (this.rdoApostados.Checked) { typeAposta = BolaoNet.Model.Boloes.JogoUsuario.TypeAposta.Apostados; if (this.rdoApostadoTodos.Checked) { typeAutomatico = BolaoNet.Model.Boloes.JogoUsuario.TypeAutomatico.Todos; } else if (this.rdoApostadoAuto.Checked) { typeAutomatico = BolaoNet.Model.Boloes.JogoUsuario.TypeAutomatico.Automatico; } else if (this.rdoApostadoManual.Checked) { typeAutomatico = BolaoNet.Model.Boloes.JogoUsuario.TypeAutomatico.Manual; } } Business.Boloes.Support.JogoUsuario business = new BolaoNet.Business.Boloes.Support.JogoUsuario(base.UserName); IList <Framework.DataServices.Model.EntityBaseData> list = business.InsertApostasAuto( CurrentBolao, base.UserName, typeAposta, typeAutomatico, dataInicial, dataFinal, rodada, random, time1, time2, random1, random2, nomeTime); Session["Apostas"] = list; Response.Redirect("~/Apostas/ApostasAutoResultado.aspx"); }