Beispiel #1
0
 public TicketController()
 {
     _productBusiness      = new ProductBusiness();
     _dictionaryBusiness   = new DictionaryBusiness();
     _areaBusiness         = new AreaBusiness();
     _product_dateBusiness = new product_dateBusiness();
     _teamBusiness         = new TeamBusiness();
 }
Beispiel #2
0
        public ActionResult CadastroEmpresa(Empresa empresa, Endereco endereco, Area area)
        {
            if (ModelState.IsValid)
            {
                EnderecoBusiness business     = new EnderecoBusiness();
                AreaBusiness     areaBusiness = new AreaBusiness();
                empresa.Senha      = CriptografiaSenha.Codifica(empresa.Senha);
                endereco           = business.InserirEndereco(endereco);
                area               = areaBusiness.InserirArea(area);
                empresa.IdEndereco = endereco.IdEndereco;
                empresa.IdArea     = area.IdArea;
                db.Empresa.Add(empresa);
                db.SaveChanges();
                return(View());
            }

            return(View(new Empresa()));
        }