public int Insert(GlobaisClienteEnderecoBE obj) { var end = new GlobaisEnderecoBLL().Insert(new GlobaisEnderecoBE { end_cep = obj.end_cep, end_logradouro = obj.end_logradouro, end_numero = obj.end_numero, end_complemento = obj.end_complemento, end_bairro = obj.end_bairro, end_cidade = obj.end_cidade, end_estado = obj.end_estado }); var cli_id = new GlobaisClienteEnderecoDao().Insert(new { cli_id = obj.cli_id, cliEnd_Tipo = obj.cliEnd_Tipo, end_id = end.end_id }); return(cli_id); }
public bool Update(GlobaisClienteEnderecoBE obj) { var end = new GlobaisEnderecoBLL().Update(new GlobaisEnderecoBE { end_id = obj.end_id, end_cep = obj.end_cep, end_logradouro = obj.end_logradouro, end_numero = obj.end_numero, end_complemento = obj.end_complemento, end_bairro = obj.end_bairro, end_cidade = obj.end_cidade, end_estado = obj.end_estado }); var cli_id = new GlobaisClienteEnderecoDao().Update(new { cli_id = obj.cli_id, cliEnd_Tipo = obj.cliEnd_Tipo, end_id = obj.end_id, cliEnd_id = obj.cliEnd_id }); return(true); }
/// <summary> /// Inclui o Novo Endereço /// </summary> /// <param name="obj"></param> /// <returns></returns> public JsonResult InsertClienteEndereco(GlobaisClienteEnderecoBE obj) { try { new GlobaisClienteEnderecoBLL().Insert(obj); return(Json(true, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { Common.TratarLogErro(ex); return(Json(false, JsonRequestBehavior.AllowGet)); } }
public ClienteBE Insert(ClienteBE obj, GlobaisEnderecoBE _end, GlobaisClienteContatoBE _contato) { var clienteEnd = new GlobaisClienteEnderecoBE(); obj.cli_SCM = false; obj.cli_MNT = false; obj.cli_CGC = obj.cli_CPF; _end.end_id = new EnderecoDao().Insert(_end); obj.cli_id = new ClienteDao().Insert(obj); _contato.cli_id = obj.cli_id; _contato.cont_id = new ClienteContatoDao().Insert(_contato); new ClienteEnderecoBLL().Insert(obj.cli_id, _end.end_id, "EP"); return(obj); }
public ActionResult Insert(GlobaisClienteBE _cliente, string cli_CFOP, GlobaisClienteEnderecoBE _endereco, GlobaisClienteContatoBE _contato) { _cliente.cli_CFOP = Convert.ToDecimal(cli_CFOP.Replace(".", ",")); _cliente.cli_id = new GlobaisClienteBLL().Insert(_cliente); _endereco.cli_id = _cliente.cli_id; _endereco.cliEnd_Tipo = "EP"; new GlobaisClienteEnderecoBLL().Insert(_endereco); if (_contato.cont_nome != null) { _contato.cli_id = _cliente.cli_id; new GlobaisClienteContatoBLL().Insert(_contato); } //Response.Redirect("/ClienteServicos?cli_id=" + listaClientes.cli_id); return(View()); }
public ClienteBE Insert(ClienteBE obj) { var clienteEnd = new GlobaisClienteEnderecoBE(); obj.cli_SCM = false; obj.cli_MNT = false; obj.cli_CGC = obj.cli_CPF; var clie = this.Select(new ClienteBE { cli_CGC = obj.cli_CGC, conf_id = obj.conf_id }); if (clie.Count == 0) { obj.cli_id = new ClienteDao().Insert(obj); return(obj); } else { return(null); } }
public List <GlobaisClienteEnderecoBE> Select(GlobaisClienteEnderecoBE obj) { return(new GlobaisClienteEnderecoDao().Select <GlobaisClienteEnderecoBE>(obj).ToList()); }
public bool Delete(GlobaisClienteEnderecoBE obj) { return(new GlobaisClienteEnderecoDao().Delete(obj).Value); }
public GlobaisClienteEnderecoBE SelectId(GlobaisClienteEnderecoBE obj) { return(new GlobaisClienteEnderecoDao().SelectId <GlobaisClienteEnderecoBE>(obj)); }