Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html ng-app="Crm">
- <body ng-controller="CrmCtrl">
- <form name="novoCrmForm">
- <div class="row">
- <div class="form-group text-left col-md-8">
- <label for="Nome">Nome <i class="danger">*</i></label>
- <input type="text" class="form-control" ng-model="empresaParticipante.NOME_FANTASIA" ng-required="true" name="NOME_FANTASIA" placeholder="Nome">
- </div>
- <div class="form-group text-left col-md-4">
- <label for="cpf">CPF</label>
- <input type="text" class="form-control" ng-model="empresaParticipante.CNPJ_CPF" name="CNPJ_CPF" placeholder="CPF">
- </div>
- </div>
- <div class="row">
- <div class="form-group text-left col-md-6">
- <label for="Telefone">Telefone</label>
- <input type="tel" class="form-control" ng-model="empresaParticipante.TELEFONE_01" name="TELEFONE_01" placeholder="Telefone">
- </div>
- <div class="form-group text-left col-md-6">
- <label for="Celular">Celular <i class="danger">*</i></label>
- <input type="text" class="form-control" ng-model="empresaParticipante.CELULAR" ng-required="true" name="CELULAR" placeholder="Celular">
- </div>
- </div>
- <div class="row">
- <div class="form-group text-left col-md-12">
- <label for="Email">Email <i class="danger">*</i></label>
- <input type="email" class="form-control" ng-model="empresaParticipante.EMAIL" ng-required="true" name="EMAIL" placeholder="Email">
- </div>
- </div>
- </form>
- </div>
- </div>
- <button class="btn btn-info" data-dismiss="modal" ng-click="adicionarRegistro(empresaParticipante)" ng-disabled="novoCrmForm.$invalid">Salvar</button>
- var crmApp = angular.module("Crm", []);
- crmApp.controller("CrmCtrl", function ($scope, $http) {
- $scope.adicionarRegistro = function (empresaParticipante) {
- $http.post("http://localhost:50183/api/crm/salvar", JSON.stringify(empresaParticipante)).success(function (data) {
- delete $scope.empresaParticipante;
- $scope.novoCrmForm.$setPristine();
- console.log(empresaParticipante);
- carregarRegistros();
- });
- };
- carregarRegistros();
- });
- {"NOME_FANTASIA":"bruno","CNPJ_CPF":"111.222.333-44","TELEFONE_01":"(000) 00000-0011","CELULAR":"(000) 00000-0022","EMAIL":"teste@teste.com.br"}
- {"mensagem":"Store update, insert, or delete statement affected an unexpected number of rows (0). Entities
- may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId
- =472540 for information on understanding and handling optimistic concurrency exceptions.","objeto":null
- ,"lista":[],"status":false}
- [Route("salvar")]
- [HttpPost]
- public HttpResponseMessage post([FromBody] EMPRESAS_PARTICIPANTES empresaParticipante)
- {
- IEmpresas_ParticipantesBO Empresas_ParticipantesBO = new Empresas_ParticipantesBO();
- Retorno retorno = new Retorno();
- try
- {
- //salvar
- retorno = Empresas_ParticipantesBO.salvar(empresaParticipante);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement