public void ConviteMusico(string idE, string idM) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); var evento = new EventoVM(); int idMusico = int.MinValue; int.TryParse(idM, out idMusico); int idEvento = int.MinValue; int.TryParse(idE, out idEvento); if (idEvento > 0) { var e = this.Estabelecimento.GetEventoByID(idEvento); if (e != null) { evento = new EventoVM(e); } evento.ToggleSetMusico(idMusico); } }
public CadastroVM(EstabelecimentoVM estabelecimento) { if (estabelecimento != null) { this.Nome = estabelecimento.Nome; this.Username = estabelecimento.Username; this.Email = estabelecimento.Email; this.As = estabelecimento.As; this.Ate = estabelecimento.Ate; this.Das = estabelecimento.Das; this.De = estabelecimento.De; this.Descricao = estabelecimento.Descricao; this.CNPJ = estabelecimento.CNPJ; this.Razao = estabelecimento.Razao; this.IDAmbientacao = estabelecimento.IDAmbientacao; } else { this.Nome = string.Empty; this.Nome = string.Empty; this.Username = string.Empty; this.Email = string.Empty; this.As = 0; this.Ate = 1; this.Das = 0; this.De = 1; this.Descricao = string.Empty; this.CNPJ = string.Empty; this.Razao = string.Empty; this.IDAmbientacao = 1; } }
public ActionResult Checkout() { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); var pagamento = new Pagamento(this.BaseUsuario, 30.00m).GerarPagamento(); NameValueCollection dados = new NameValueCollection { { "reference", pagamento.REF }, { "itemDescription1", "Conta Premium - Nosso Show" }, { "itemAmount1", pagamento.Valor.ToString().Replace(",", ".") }, { "senderName", this.Estabelecimento.Nome }, { "senderEmail", this.Estabelecimento.Email.Split('@')[0].ToString() + "@sandbox.pagseguro.com.br" } }; if (false) //if (!string.IsNullOrEmpty(this.Estabelecimento.Telefone)) { string telefone = new string(this.Estabelecimento.Telefone.Where(c => char.IsDigit(c)).ToArray()); dados.Add("senderAreaCode", telefone.Substring(0, 2)); dados.Add("senderPhone", telefone.Substring(2, telefone.Count() - 2)); } string url = PagSeguro.Checkout(dados); return(Redirect(url)); }
public string GetAvaliacoes(string id) { try { using (var db = new nosso_showEntities(Conexao.GetString())) { int i = int.Parse(id); var u = db.usuario.First(x => x.ID == i); if (u.Tipo == 4) { var m = new MusicoVM(u); return(m.GetAvaliacoesJSON()); } else { var e = new EstabelecimentoVM(u); return(e.GetAvaliacoesJSON()); } } } catch { } return(string.Empty); }
public ActionResult Endereco() { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); var endereco = this.Estabelecimento.Endereco; return(View(endereco)); }
public ActionResult UploadProfile(HttpPostedFileBase Arquivo, string Href) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); new ImagemVM(Arquivo, this.Estabelecimento.ID, int.MinValue, 1).Upload(); return(Redirect(Href)); }
public ActionResult UploadImagem(HttpPostedFileBase Imagem) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); new ImagemVM(Imagem, this.Estabelecimento.ID, int.MinValue, 3).Upload(); return(Redirect("/inicio/estabelecimento/" + this.Estabelecimento.Username)); }
public ActionResult Conta() { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); var cadastro = new ContaVM(this.Estabelecimento); return(View(cadastro)); }
public ActionResult Eventos() { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); ViewBag.JSON = this.Estabelecimento.GetEventosJSON(); return(View()); }
public bool ValidarNomeUsuario(EstabelecimentoVM estabelecimento) { try { using (var db = new nosso_showEntities(Conexao.GetString())) { return(!db.usuario.Any(x => x.Username.ToLower() == this.Username.ToLower() && x.ID != estabelecimento.ID)); } } catch { return(true); } }
public bool ValidarEmail(EstabelecimentoVM estabelecimento) { try { using (var db = new nosso_showEntities(Conexao.GetString())) { return(!db.usuario.Any(x => x.Email == this.Email && x.ID != estabelecimento.ID)); } } catch { return(true); } }
public ActionResult UploadBannerEvento(HttpPostedFileBase Arquivo, int IDEvento) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); var e = this.Estabelecimento.GetEventoByID(IDEvento); if (e != null) { new ImagemVM(Arquivo, this.Estabelecimento.ID, IDEvento, 4).Upload(); } return(Redirect("/inicio/evento/" + IDEvento)); }
public ActionResult RedesSociais(RedesSociaisVM model) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); if (model.SaveChanges(this.Estabelecimento)) { ViewBag.Sucesso = "Os dados de redes sociais foram salvos."; } else { ViewBag.Erro = "Por favor, confira os dados informados e tente novamente."; } return(View(model)); }
public bool SaveChanges(EstabelecimentoVM estabelecimento) { estabelecimento.As = this.As; estabelecimento.Ate = this.Ate; estabelecimento.CNPJ = this.CNPJ; estabelecimento.Das = this.Das; estabelecimento.De = this.De; estabelecimento.Descricao = this.Descricao; estabelecimento.Email = this.Email; estabelecimento.IDAmbientacao = this.IDAmbientacao; estabelecimento.Nome = this.Nome; estabelecimento.Razao = this.Razao; estabelecimento.Username = this.Username; return(estabelecimento.SaveChanges()); }
public ActionResult PublicarEvento(int IDEvento) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); ViewBag.Estabelecimento = this.Estabelecimento; var evento = this.Estabelecimento.GetEventoByID(IDEvento); if (evento != null) { if (new EventoVM(evento).TogglePublicar()) { return(Redirect("/inicio/evento/" + evento.ID)); } } ViewBag.Erro = "Falha ao publicar o evento, por favor, tente novamente."; return(Redirect("/estabelecimento/evento/" + IDEvento)); }
public ActionResult Index() { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); using (var db = new nosso_showEntities(Conexao.GetString())) { var u = db.usuario.Single(x => x.ID == this.Estabelecimento.ID); if (u.usuario_estabelecimento.Count == 0) { return(Redirect("/estabelecimento/conta/")); } if (u.endereco.Count == 0) { return(Redirect("/estabelecimento/endereco/")); } } return(View(Estabelecimento)); }
public ActionResult Estabelecimento(string id) { if (this.BaseUsuario != null) { this.Usuario = new UsuarioVM(this.BaseUsuario); } else { this.Usuario = null; } ViewBag.Usuario = this.Usuario; try { using (var db = new nosso_showEntities(Conexao.GetString())) { var u = db.usuario.First(x => x.Username == id && x.Tipo == 2); var e = new EstabelecimentoVM(u); if (this.Usuario != null) { if (this.Usuario.TipoUsuario == 3) { ViewBag.Avaliacao = new AvaliacaoVM(this.Usuario, u); } } if (e.ValidarPerfil()) { e.ContarVisualizacao(); return(View(e)); } } } catch { } return(Redirect("/inicio/buscar/")); }
public string GetAtracoes(string id) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); var evento = new EventoVM(); int idEvento = int.MinValue; int.TryParse(id, out idEvento); if (idEvento > 0) { var e = this.Estabelecimento.GetEventoByID(idEvento); if (e != null) { evento = new EventoVM(e); } } return(evento.GetMusicos()); }
public ActionResult Evento(string id) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); var evento = new EventoVM(); int idEvento = int.MinValue; int.TryParse(id, out idEvento); if (idEvento > 0) { var e = this.Estabelecimento.GetEventoByID(idEvento); if (e != null) { evento = new EventoVM(e); } } ViewBag.Estabelecimento = this.Estabelecimento; return(View(evento)); }
public ActionResult Conta(ContaVM model) { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); if (ModelState.IsValid) { if (model.ValidarEmail(this.Estabelecimento)) { if (model.ValidarNomeUsuario(this.Estabelecimento)) { if (model.SaveChanges(this.Estabelecimento)) { ViewBag.Sucesso = "Os dados foram salvos."; } else { ViewBag.Erro = "Não foi possível estabelecer conexão com o servidor, por favor, tente novamente mais tarde."; } } else { ViewBag.Erro = "O nome de usuário informado já está sendo utilizado."; } } else { ViewBag.Erro = "O endereço de e-mail informado já está sendo utilizado."; } } else { ViewBag.Erro = "Por favor, confira os dados informados e tente novamente."; } return(View(model)); }
public ActionResult Index() { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); return(View()); }
public ActionResult RedesSociais() { this.Estabelecimento = new EstabelecimentoVM(this.BaseUsuario); return(View(this.Estabelecimento.RedesSociais)); }