private async Task <string> realizarTransferencia() { clsTransferencia objTransferencia = new clsTransferencia(); clsServicioTransferencia objServicioTransferencia = new Servicios.clsServicioTransferencia(); try { objTransferencia.strIdentificacionEmisor = strIdentificacion; objTransferencia.strNumeroCuentaEmisor = spinnerCuentaOrigen.SelectedItem.ToString(); clsCuenta objCuenta = lstCuentas.Find(x => x.numero_cuenta == objTransferencia.strNumeroCuentaEmisor); clsCooperativa objCooperativaEmisor = lstCooperativas.Find(x => x.Id == objCuenta.idCooperativa); objTransferencia.strEntidadEmisor = objCooperativaEmisor.nombreCooperativa; objTransferencia.strIdentificacionBeneficiario = txtIdentificacionBeneficiario.Text; string tipo_cuenta_seleccionada = string.Format("{0}", spinnerTipoCuenta.SelectedItem); objTransferencia.strTipoCuentaBeneficiario = tipo_cuenta_seleccionada; objTransferencia.strNumeroCuentaBeneficiario = txtCuentaBeneficiario.Text; objTransferencia.strEntidadBeneficiario = lstCooperativas[spinnerCooperativasDestino.SelectedItemPosition].nombreCooperativa; objTransferencia.dblMonto = double.Parse(txtMontoTransferencia.Text); objTransferencia.strMotivo = txtMotivoTransferencia.Text; return(await objServicioTransferencia.realizarTransferencia(objTransferencia, objCooperativaEmisor, lstCooperativas[spinnerCooperativasDestino.SelectedItemPosition])); } catch (Exception ex) { return("Alerta transferencia: " + ex.Message); } }
public Boolean Guardar(clsCuenta cuenta) { try { using (EntitiesContabilidad2 ent = new EntitiesContabilidad2()) { Cuenta ct = new Cuenta() { IdEmpresa = cuenta.IdEmpresa, IdCuenta = cuenta.IdCuenta, codigo_padre = cuenta.codigo_padre, nombre = cuenta.nombre, descripcion = cuenta.descripcion, IdNivelCuenta = cuenta.IdNivelCuenta, IdTipoCuenta = cuenta.IdTipoCuenta, naturaleza_cuenta = cuenta.naturaleza_cuenta, IdUsuario = 1, //FechaModificacion = cuenta.IdEmpresa }; ent.AddToCuenta(ct); ent.SaveChanges(); } return(true); } catch (Exception) { return(false); } }
public List <clsCuenta> ConsultarCuentas(string strServicio) { List <clsCuenta> lstCuenta = new List <clsCuenta>(); DataTable dtRespuesta = null; clsPersistenciaCuenta objPersistenciaCuenta = new clsPersistenciaCuenta(); try { dtRespuesta = objPersistenciaCuenta.ConsultarCuenta(strServicio); if (dtRespuesta != null) { foreach (DataRow dr in dtRespuesta.Rows) { clsCuenta objCuenta = new clsCuenta(); objCuenta.idCuenta = int.Parse(dr[0].ToString()); objCuenta.numeroCuenta = dr[1].ToString(); objCuenta.idCliente = int.Parse(dr[2].ToString()); objCuenta.nombreCliente = dr[3].ToString(); objCuenta.tipoCuenta = dr[4].ToString(); objCuenta.saldo = double.Parse(dr[5].ToString()); objCuenta.estado = bool.Parse(dr[6].ToString()); lstCuenta.Add(objCuenta); } } } catch (Exception) { throw; } return(lstCuenta); }
public List <clsCuenta> ConsultaCuentaComprobante() { try { List <clsCuenta> lista = new List <clsCuenta>(); EntitiesContabilidad2 entity = new EntitiesContabilidad2(); var plancuenta = from cuenta in entity.Cuenta where cuenta.IdNivelCuenta == 5 select cuenta; foreach (var item in plancuenta) { clsCuenta ccuenta = new clsCuenta(); ccuenta.IdEmpresa = item.IdEmpresa; ccuenta.IdCuenta = item.IdCuenta; ccuenta.codigo_padre = item.codigo_padre; ccuenta.nombre = item.nombre; ccuenta.descripcion = item.descripcion; ccuenta.IdNivelCuenta = item.IdNivelCuenta; ccuenta.IdTipoCuenta = item.IdTipoCuenta; ccuenta.naturaleza_cuenta = item.naturaleza_cuenta; ccuenta.IdUsuario = Convert.ToInt32(item.IdUsuario); ccuenta.FechaModficacion = Convert.ToDateTime(item.FechaModificacion); lista.Add(ccuenta); } return(lista); } catch (Exception) { return(null); } }
private clsTransferencia llenarDatosTransferencia() { clsTransferencia objTransferencia = new clsTransferencia(); try { objTransferencia.Id = "0"; objTransferencia.strIdentificacionEmisor = strIdentificacion; objTransferencia.strNumeroCuentaEmisor = strNumeroCuenta; clsCuenta objCuenta = lstCuentas.Find(x => x.numero_cuenta == strNumeroCuenta); objCooperativa = lstCooperativas.Find(x => x.Id == objCuenta.idCooperativa); objTransferencia.strEntidadEmisor = objCooperativa.nombreCooperativa; objTransferencia.strIdentificacionBeneficiario = "9999999999"; objTransferencia.strTipoCuentaBeneficiario = objCuenta.tipo_cuenta; objTransferencia.strNumeroCuentaBeneficiario = "99999999999"; objTransferencia.strEntidadBeneficiario = objCooperativa.nombreCooperativa; objTransferencia.dblMonto = double.Parse(txtMontoPago.Text); objTransferencia.strMotivo = "PAGO SERVICIO " + objCabeceraFacturaServicio.tipo_suministro + " SUMINISTRO " + txtNumeroSuministro.Text; } catch (Exception) { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); progress.Cancel(); alert.SetTitle("Alerta"); alert.SetMessage("Ocurió un problema al realizar el pago"); RunOnUiThread(() => { alert.Show(); }); } return(objTransferencia); }
private void MenuEliminar_Click(object sender, EventArgs e) { clsCuenta Cuentatemp = ObtenerCuenta(); if (Cuentatemp != null) { DialogResult resdialogo = MessageBox.Show("¿Está seguro de eliminar la Cuenta", "Target", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (resdialogo == System.Windows.Forms.DialogResult.Yes) { ResultadoTransaccion res = clsCuentas.BuscarCuentaPorId(Cuentatemp.Id); if (res.Estado == Entidades.Enums.Enums.EstadoTransaccion.Aceptada) { clsCuenta cuenta = (clsCuenta)res.ObjetoTransaccion; res = new ResultadoTransaccion(); res = clsCuentas.EliminarCuenta(cuenta); if (res.Estado == Entidades.Enums.Enums.EstadoTransaccion.Aceptada) { ListarCuentas(); } else { MessageBox.Show(res.Descripcion, "Cuenta", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } else { MessageBox.Show("Debe seleccionar a Cuenta", "Cuenta", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public static ResultadoTransaccion CambiaEstado(clsCuenta cuenta) { ResultadoTransaccion resTransaccion = new ResultadoTransaccion(); try { objParams = SqlHelperParameterCache.GetSpParameterSet(BaseDatos.Conexion(), "SP_A_CLIENTES_CUENTA_CAMBIA_ESTADO"); objParams[0].Value = cuenta.Id; objParams[1].Value = (Int16)cuenta.Estado; SqlCommand command = new SqlCommand("SP_A_CLIENTES_CUENTA_CAMBIA_ESTADO", BaseDatos.Conexion()); command.Parameters.AddRange(objParams); command.CommandType = CommandType.StoredProcedure; command.ExecuteNonQuery(); resTransaccion.Estado = Enums.EstadoTransaccion.Aceptada; } catch (Exception ex) { resTransaccion.Estado = Enums.EstadoTransaccion.Rechazada; resTransaccion.Descripcion = ex.Message; Log.EscribirLog(ex.Message); } finally { BaseDatos.CerrarConexion(); } return(resTransaccion); }
private clsTransferencia llenarDatosTransferencia() { clsTransferencia objTransferencia = new clsTransferencia(); try { objTransferencia.strIdentificacionEmisor = strIdentificacion; objTransferencia.strNumeroCuentaEmisor = strNumeroCuenta; clsCuenta objCuenta = lstCuentas.Find(x => x.numero_cuenta == strNumeroCuenta); objCooperativaEmisor = lstCooperativas.Find(x => x.Id == objCuenta.idCooperativa); objTransferencia.strEntidadEmisor = objCooperativaEmisor.nombreCooperativa; objTransferencia.strIdentificacionBeneficiario = "9999999999"; objTransferencia.strTipoCuentaBeneficiario = objCuenta.tipo_cuenta; objTransferencia.strNumeroCuentaBeneficiario = "99999999999"; objTransferencia.strEntidadBeneficiario = objCooperativaBeneficiario.nombreCooperativa; objTransferencia.dblMonto = double.Parse(txtMontoPagoTarjeta.Text); objTransferencia.strMotivo = "PAGO TARJETA " + txtTipoTarjetaSeleccionada.Text; } catch (Exception) { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); progress.Cancel(); alert.SetTitle("Alerta"); alert.SetMessage("Ocurió un problema al realizar la transferencia"); RunOnUiThread(() => { alert.Show(); }); } return(objTransferencia); }
protected override async void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ConsultaMovimientos); TextView lblNumeroCuentaConsultaMovimientos = FindViewById <TextView>(Resource.Id.lblNumeroCuentaConsultaMovimientos); TextView lblNombreEntidadConsultaMovimientos = FindViewById <TextView>(Resource.Id.lblNombreEntidadConsultaMovimientos); TextView lblSaldoDisponibleConsultaMovimientos = FindViewById <TextView>(Resource.Id.lblSaldoDisponibleConsultaMovimientos); // Create your application here mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar5); SetSupportActionBar(mToolBar); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetTitle(mConsultaMovimiento); //Guardar temporalmente varaibles pantalla strIdentificacion = Intent.GetStringExtra(clsConstantes.strIdentificacionUsuario); strCuentaJson = Intent.GetStringExtra(clsConstantes.strCuentaJson); strIdUsuario = Intent.GetStringExtra(clsConstantes.strIdUsuario); imageUrl = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario); strNumeroCuentaSeleccionada = Intent.GetStringExtra(clsConstantes.strNumeroCuentaSeleccionada); strCooperativa = Intent.GetStringExtra(clsConstantes.strCooperativas); lstCooperativas = JsonConvert.DeserializeObject <List <clsCooperativa> >(strCooperativa); string[] arrRespuesta = strCuentaJson.Split('|'); string strCuentas = arrRespuesta[0]; string strTarjetas = arrRespuesta[1]; List <clsCuenta> lstCuentas = JsonConvert.DeserializeObject <List <clsCuenta> >(strCuentas); clsCuenta objCuentaSeleccionada = lstCuentas.Where(x => x.numero_cuenta == strNumeroCuentaSeleccionada).Single(); if (objCuentaSeleccionada != null) { string saldoCuenta = string.Format("{0:N2}", objCuentaSeleccionada.saldo); lblSaldoDisponibleConsultaMovimientos.Text = "USD " + saldoCuenta; lblNombreEntidadConsultaMovimientos.Text = lstCooperativas.Find(x => x.Id == objCuentaSeleccionada.idCooperativa).nombreCooperativa; lblNumeroCuentaConsultaMovimientos.Text = objCuentaSeleccionada.numero_cuenta.ToString(); } clsCooperativa objCooperativa = lstCooperativas.Find(x => x.Id == objCuentaSeleccionada.idCooperativa); string strJsonMovimientos = await objServicioCuenta.consultaMovimientos(strNumeroCuentaSeleccionada, 10, objCooperativa.nombreColaEnvio, objCooperativa.nombreColaRespuesta); List <clsMovimiento> movimientosItems = JsonConvert.DeserializeObject <List <clsMovimiento> >(strJsonMovimientos); listView = FindViewById <ListView>(Resource.Id.ListaMovimientos); if (movimientosItems.Count > 0) { listView.Adapter = new movimientos_adapter(this, movimientosItems); } } catch (Exception ex) { Console.WriteLine("Alerta: Al mostrar la pantalla de consulta de movimientos... " + ex.Message); } }
public ActionResult ModificarCuenta(string idCuenta) { clsServicioCooperativa objServicioCooperativa = new clsServicioCooperativa(); List <SelectListItem> items = new List <SelectListItem>(); List <SelectListItem> items1 = new List <SelectListItem>(); try { if (Session["login"] != null) { string strServicio = Session["cooperativa"].ToString(); lstCuenta = (List <clsCuenta>)Session["cuentasRegistrados"]; clsCuenta objCuenta = lstCuenta.Find(x => x.idCuenta == int.Parse(idCuenta)); lstCliente = objServicioCooperativa.ConsultarClientes(strServicio); foreach (clsCliente objCliente in lstCliente) { items.Add(new SelectListItem { Text = objCliente.nombreCliente + " " + objCliente.apellidoCliente, Value = objCliente.idCliente.ToString() }); } items1.Add(new SelectListItem { Text = "Ahorros", Value = "A" }); items1.Add(new SelectListItem { Text = "Corriente", Value = "C" }); ViewBag.lstClientes = items; ViewBag.lstTipoCuenta = items1; if (objCuenta != null) { return(View(objCuenta)); } else { return(RedirectToAction("Error", "Home")); } } else { return(RedirectToAction("Login", "Home")); } } catch (Exception) { return(RedirectToAction("Error", "Home")); } }
public static ResultadoTransaccion GuardarCuenta(clsCuenta cuenta) { if (cuenta.IsNew) { return(AccesoDatos.Clientes.clsCuentaADO.GuardarCuenta(cuenta)); } return(AccesoDatos.Clientes.clsCuentaADO.ActualizarCuenta(cuenta)); }
private clsCuenta ObtenerCuenta() { var filaSelected = grdCuentas.DefaultView.GetRow(gridView1.FocusedRowHandle); if (filaSelected == null) { return(null); } clsCuenta cuenta = (clsCuenta)filaSelected; return(cuenta); }
private void gridViewCmbPadre_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) { try { claseCmbPadre = GetSelectedRowCmbCuenta((DevExpress.XtraGrid.Views.Grid.GridView)sender); txtcodigo.Properties.MaxLength = Convert.ToInt32(claseCmbPadre.digitos); //txtcodigo.Properties.Mask.EditMask = "\d{"+claseCmbPadre.digitos.ToString()+"}"; } catch (Exception ex) { Console.WriteLine("Error: " + ex); } }
public Boolean Modificar(clsCuenta cuenta) { try { EntitiesContabilidad2 ent = new EntitiesContabilidad2(); var mod = (from q in ent.Cuenta where q.IdEmpresa == cuenta.IdEmpresa && q.IdCuenta == cuenta.IdCuenta select q).First(); mod.descripcion = cuenta.descripcion; mod.nombre = cuenta.nombre; mod.FechaModificacion = DateTime.Now; ent.SaveChanges(); return(true); } catch (Exception) { return(false); } }
private void MenuVerDatos_Click(object sender, EventArgs e) { clsCuenta cuenta = ObtenerCuenta(); frmCuenta form = frmCuenta.Instancia; if (cuenta != null) { form.CuentaActual = cuenta; form.FormLoad(); if (form.CargarFormulario()) { form.Accion = Entidades.Enums.Enums.TipoAccionFormulario.Editar; form.ShowDialog(); } } else { MessageBox.Show("Debe seleccionar una Cuenta", "Cuenta", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public Boolean Eliminar(clsCuenta cuenta) { try { EntitiesContabilidad2 ent = new EntitiesContabilidad2(); var regcuenta = (from q in ent.Cuenta where q.IdEmpresa == cuenta.IdEmpresa && q.IdCuenta == cuenta.IdCuenta select q).First(); var count = (from q in ent.Cuenta where q.codigo_padre == cuenta.IdCuenta select q).Count(); if (count == 0) { ent.DeleteObject(regcuenta); ent.SaveChanges(); } else { return(false); } return(true); } catch (Exception) { return(false); } }
public static ResultadoTransaccion GuardarCuenta(clsCuenta cuenta) { resTransaccion = new ResultadoTransaccion(); Int64 idMaster = 0; Int64 idCuenta = 0; try { //Abrir Conexion conn = BaseDatos.Conexion(); //Crear Transaccion transaction = conn.BeginTransaction(); //Registrar Direcciones resTransaccion = clsDireccionADO.GuardarDirecciones(cuenta.ClienteMaster.DireccionInfo, conn, transaction); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } cuenta.ClienteMaster.DireccionInfo = (clsDireccionInfo)resTransaccion.ObjetoTransaccion; //Registrar Cliente Master resTransaccion = clsClienteMasterADO.GuardarClienteMaster(cuenta.ClienteMaster, conn, transaction); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } idMaster = (Int64)resTransaccion.ObjetoTransaccion; //Registrar Cuenta objParams = SqlHelperParameterCache.GetSpParameterSet(conn, "SP_N_CLIENTES_CUENTA"); objParams[0].Value = idMaster; if (cuenta.VendedorAsignado != null) { objParams[1].Value = cuenta.VendedorAsignado.Id; } else { objParams[1].Value = -1; } //if (cuenta.CustomerAsignado != null) // objParams[2].Value = cuenta.CustomerAsignado.Id; //else // objParams[2].Value = -1; objParams[2].Value = cuenta.Telefono; objParams[3].Value = cuenta.CuentaSkype; objParams[4].Value = cuenta.SitioWeb; objParams[5].Value = cuenta.Email; objParams[6].Value = cuenta.Estado; if (cuenta.ZonaVentas == null) { objParams[7].Value = -1; } else { objParams[7].Value = cuenta.ZonaVentas.Id; } if (cuenta.CategoriaCliente == null) { objParams[8].Value = -1; } else { objParams[8].Value = cuenta.CategoriaCliente.Id; } objParams[9].Value = cuenta.Observacion; if (cuenta.SectorEconomico != null) { objParams[10].Value = cuenta.SectorEconomico.Id; } else { objParams[10].Value = -1; } if (cuenta.TipoMonedaVtaEstimada != null) { objParams[11].Value = cuenta.TipoMonedaVtaEstimada.Id; } else { objParams[11].Value = -1; } objParams[12].Value = cuenta.MontoVentaEstimada; objParams[13].Value = cuenta.NumEmpleados; if (cuenta.UMMovimientoEstimado != null) { objParams[14].Value = cuenta.UMMovimientoEstimado.Id; } else { objParams[14].Value = -1; } objParams[15].Value = cuenta.MontoMovimientoEstimado; if (cuenta.FormaContactoPreferida != null) { objParams[16].Value = cuenta.FormaContactoPreferida.Id; } else { objParams[16].Value = -1; } objParams[17].Value = cuenta.PermiteTelOficina; objParams[18].Value = cuenta.PermiteTelParticular; objParams[19].Value = cuenta.PermiteTelCelular; objParams[20].Value = cuenta.PermiteSkype; objParams[21].Value = cuenta.PermiteEmail; objParams[22].Value = cuenta.PermiteEmailMasivo; if (cuenta.DiaPreferido == null) { objParams[23].Value = -1; } else { objParams[23].Value = cuenta.DiaPreferido.Id; } if (cuenta.JornadaPreferida == null) { objParams[24].Value = -1; } else { objParams[24].Value = cuenta.JornadaPreferida.Id; } objParams[25].Value = cuenta.AutorizadoAduana; if (cuenta.Clasificacion == null) { objParams[26].Value = -1; } else { objParams[26].Value = cuenta.Clasificacion.Id; } SqlCommand command2 = new SqlCommand("SP_N_CLIENTES_CUENTA", conn); command2.Transaction = transaction; command2.Parameters.AddRange(objParams); command2.CommandType = CommandType.StoredProcedure; idCuenta = Convert.ToInt64(command2.ExecuteScalar()); cuenta.Id = idCuenta; if (idMaster > 0) { //Productos preferidos //clsClienteMasterADO.BorrarProductos(idTarget, transaction,conn); foreach (var producto in cuenta.ClienteMaster.ProductosPreferidos) { clsClienteMasterADO.AsignarTipoProducto(producto, idMaster, transaction, conn); } //Tipos Relacion //clsClienteMasterADO.BorrarTipoRelacion(idMaster, transaction, conn); foreach (var relacion in cuenta.ClienteMaster.TiposRelaciones) { clsClienteMasterADO.AsignarTipoRelacion(relacion, idMaster, transaction, conn); } } //Ejecutar transaccion transaction.Commit(); resTransaccion.Estado = Enums.EstadoTransaccion.Aceptada; resTransaccion.Descripcion = "Se Creo Cuenta con Id " + idMaster.ToString(); //Registrar Actividad LogActividadUsuarios log = new LogActividadUsuarios(cuenta.GetType().ToString(), cuenta.Id, Enums.TipoActividadUsuario.Creo, Base.Usuario.UsuarioConectado.Usuario); LogActividades.clsLogActividadUsuariosADO.GuardaActividad(log); } catch (Exception ex) { transaction.Rollback(); Log.EscribirLog(ex.Message); resTransaccion.Estado = Enums.EstadoTransaccion.Rechazada; resTransaccion.Descripcion = ex.Message; resTransaccion.ArchivoError = "clsCuentaADO"; resTransaccion.MetodoError = MethodBase.GetCurrentMethod().Name; } finally { conn.Close(); resTransaccion.Accion = Enums.AccionTransaccion.Insertar; cuenta.Id = idCuenta; cuenta.ClienteMaster.Id = idMaster; resTransaccion.ObjetoTransaccion = cuenta; } return(resTransaccion); }
public static ResultadoTransaccion ObtenerCuentaPorIdMaster(Int64 IdMaster) { ResultadoTransaccion res = new ResultadoTransaccion(); try { //Abrir Conexion //conn = BaseDatos.Conexion(); conn = BaseDatos.NuevaConexion(); //Registrar Cliente Master objParams = SqlHelperParameterCache.GetSpParameterSet(conn, "SP_C_CLIENTES_CUENTA_POR_ID_MASTER"); objParams[0].Value = IdMaster; SqlCommand command = new SqlCommand("SP_C_CLIENTES_CUENTA_POR_ID_MASTER", conn); command.Parameters.AddRange(objParams); command.CommandType = CommandType.StoredProcedure; dreader = command.ExecuteReader(); while (dreader.Read()) { clsCuenta cuenta = new clsCuenta(); cuenta.ClienteMaster.Id = Convert.ToInt64(dreader["IdMaster"]); cuenta.ClienteMaster.NombreCompañia = dreader["NombreCompania"].ToString(); cuenta.ClienteMaster.NombreFantasia = dreader["NombreFantasia"].ToString(); cuenta.ClienteMaster.RUT = dreader["RUT"].ToString(); cuenta.ClienteMaster.Tipo = (Enums.TipoPersona)dreader["CodTipo"]; cuenta.ClienteMaster.FechaCreacion = (DateTime)dreader["FechaCreacionMaster"]; if (dreader["AutorizadoAduana"] is DBNull) { cuenta.AutorizadoAduana = false; } else { cuenta.AutorizadoAduana = (bool)dreader["AutorizadoAduana"]; } if (dreader["IdDireccionInfo"] is DBNull) { cuenta.ClienteMaster.DireccionInfo = null; } else { cuenta.ClienteMaster.DireccionInfo = clsDireccionADO.ListarDireccionesPorIdInfo(Convert.ToInt64(dreader["IdDireccionInfo"])); } cuenta.Id = Convert.ToInt64(dreader["IdCuenta"]); if (!(dreader["IdVendedorAsignado"] is DBNull)) { cuenta.VendedorAsignado = Usuarios.clsUsuarioADO.ObtenerUsuarioPorId(Convert.ToInt16(dreader["IdVendedorAsignado"])); } //if (!(dreader["IdCustomerAsignado"] is DBNull)) // cuenta.CustomerAsignado = Usuarios.clsUsuarioADO.ObtenerUsuarioPorId(Convert.ToInt16(dreader["IdCustomerAsignado"])); cuenta.Telefono = dreader["Telefono"].ToString(); cuenta.CuentaSkype = dreader["CuentaSkype"].ToString(); cuenta.SitioWeb = dreader["SitioWeb"].ToString(); cuenta.Email = dreader["Email"].ToString(); cuenta.Estado = (Enums.Estado)dreader["IdEstado"]; if (!(dreader["IdZonaVentas"] is DBNull)) { cuenta.ZonaVentas = Parametros.clsParametrosDAO.BuscarParametroPorId(Convert.ToInt16(dreader["IdZonaVentas"])); } if (!(dreader["IdCategoriaCliente"] is DBNull)) { cuenta.CategoriaCliente = Parametros.clsParametrosDAO.BuscarParametroPorId(Convert.ToInt16(dreader["IdCategoriaCliente"])); } if (!(dreader["IdClasificacion"] is DBNull)) { cuenta.Clasificacion = ObtenerClasificacionPorId(Convert.ToInt16(dreader["IdClasificacion"])); } cuenta.Observacion = dreader["Observacion"].ToString(); if (!(dreader["IdSectorEconomico"] is DBNull)) { cuenta.SectorEconomico = Parametros.clsParametrosDAO.BuscarParametroPorId(Convert.ToInt16(dreader["IdSectorEconomico"])); } if (!(dreader["IdMonedaVtaEst"] is DBNull)) { cuenta.TipoMonedaVtaEstimada = Parametros.clsParametrosDAO.BuscarMonedaPorId(Convert.ToInt16(dreader["IdMonedaVtaEst"])); } if (!(dreader["MontoVtaEst"] is DBNull)) { cuenta.MontoVentaEstimada = (decimal)dreader["MontoVtaEst"]; } if (!(dreader["NumEmpleados"] is DBNull)) { cuenta.NumEmpleados = Convert.ToInt64(dreader["NumEmpleados"]); } if (!(dreader["IdUMMovimiento"] is DBNull)) { cuenta.UMMovimientoEstimado = Parametros.clsParametrosDAO.BuscarParametroPorId(Convert.ToInt16(dreader["IdUMMovimiento"])); } if (!(dreader["VolumenMovimiento"] is DBNull)) { cuenta.MontoMovimientoEstimado = Convert.ToDecimal(dreader["VolumenMovimiento"]); } if (!(dreader["IdFormaContactoPref"] is DBNull)) { cuenta.FormaContactoPreferida = Parametros.clsParametrosDAO.BuscarParametroPorId(Convert.ToInt16(dreader["IdFormaContactoPref"])); } cuenta.PermiteTelOficina = (bool)dreader["PermiteTelOfi"]; cuenta.PermiteTelParticular = (bool)dreader["PermiteTelPart"]; cuenta.PermiteTelCelular = (bool)dreader["PermiteTelCel"]; cuenta.PermiteSkype = (bool)dreader["PermiteSkype"]; cuenta.PermiteEmail = (bool)dreader["PermiteEmail"]; cuenta.PermiteEmailMasivo = (bool)dreader["PermiteEmailMasivo"]; if (!(dreader["CodDiaPreferido"] is DBNull)) { cuenta.DiaPreferido = Parametros.clsParametrosDAO.BuscarParametroPorId(Convert.ToInt16(dreader["CodDiaPreferido"])); } if (!(dreader["CodJornadaPreferida"] is DBNull)) { cuenta.JornadaPreferida = Parametros.clsParametrosDAO.BuscarParametroPorId(Convert.ToInt16(dreader["CodJornadaPreferida"])); } cuenta.ClienteMaster.ProductosPreferidos = clsClienteMasterADO.ObtenerProductosPreferidos(cuenta.ClienteMaster.Id); cuenta.ClienteMaster.TiposRelaciones = clsClienteMasterADO.ObtenerTiposRelacion(cuenta.ClienteMaster.Id); res.Estado = Enums.EstadoTransaccion.Aceptada; res.ObjetoTransaccion = cuenta; } } catch (Exception ex) { Log.EscribirLog(ex.Message); res.Estado = Enums.EstadoTransaccion.Rechazada; res.Descripcion = ex.Message; res.Accion = Enums.AccionTransaccion.Consultar; } finally { if (!dreader.IsClosed) { dreader.Close(); } conn.Close(); } return(res); }
public static ResultadoTransaccion EliminarCuenta(clsCuenta cuenta) { return(AccesoDatos.Clientes.clsCuentaADO.EliminarCuenta(cuenta)); }
public static ResultadoTransaccion EliminarCuenta(clsCuenta cuenta) { ResultadoTransaccion resTransaccion = new ResultadoTransaccion(); try { transaction = BaseDatos.Conexion().BeginTransaction(); //Eliminar Direcciones if (cuenta.ClienteMaster.DireccionInfo != null) { foreach (var direccion in cuenta.ClienteMaster.DireccionInfo.Items) { resTransaccion = new ResultadoTransaccion(); resTransaccion = clsDireccionADO.EliminarDireccion(direccion, transaction); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } } resTransaccion = new ResultadoTransaccion(); resTransaccion = clsDireccionADO.EliminarDireccionInfo(cuenta.ClienteMaster.DireccionInfo.IdInfo, transaction); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } } //Eliminar Tipos de Relacion resTransaccion = new ResultadoTransaccion(); resTransaccion = clsClienteMasterADO.BorrarTipoRelacion(cuenta.ClienteMaster.Id, transaction, conn); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } //Eliminar Tipos de Carga resTransaccion = new ResultadoTransaccion(); resTransaccion = clsClienteMasterADO.BorrarProductos(cuenta.ClienteMaster.Id, transaction, conn); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } //Eliminar Cliente Master resTransaccion = new ResultadoTransaccion(); resTransaccion = clsClienteMasterADO.EliminarClienteMaster(cuenta.ClienteMaster, transaction); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } //Eliminar Contactos IList <clsContacto> listContactos = new List <clsContacto>(); listContactos = clsClienteMasterADO.ListarContactos(cuenta.ClienteMaster); foreach (var contacto in listContactos) { resTransaccion = new ResultadoTransaccion(); resTransaccion = clsContactoADO.EliminarContacto(contacto, transaction); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } } //Eliminar Cuenta objParams = SqlHelperParameterCache.GetSpParameterSet(BaseDatos.Conexion(), "SP_E_CLIENTES_CUENTA"); objParams[0].Value = cuenta.Id; SqlCommand command = new SqlCommand("SP_E_CLIENTES_CUENTA", BaseDatos.Conexion()); command.Parameters.AddRange(objParams); command.CommandType = CommandType.StoredProcedure; command.Transaction = transaction; command.ExecuteNonQuery(); resTransaccion.Estado = Enums.EstadoTransaccion.Aceptada; transaction.Commit(); //Registrar Actividad LogActividadUsuarios log = new LogActividadUsuarios(cuenta.GetType().ToString(), cuenta.Id, Enums.TipoActividadUsuario.Elimino, Base.Usuario.UsuarioConectado.Usuario); LogActividades.clsLogActividadUsuariosADO.GuardaActividad(log); } catch (Exception ex) { transaction.Rollback(); resTransaccion.Estado = Enums.EstadoTransaccion.Rechazada; resTransaccion.Descripcion = ex.Message; Log.EscribirLog(ex.Message); } finally { BaseDatos.CerrarConexion(); } return(resTransaccion); }
public static ResultadoTransaccion ActualizarCuenta(clsCuenta cuenta) { resTransaccion = new ResultadoTransaccion(); try { //Abrir Conexion conn = BaseDatos.Conexion(); //Crear Transaccion transaction = conn.BeginTransaction(); //Registrar Direcciones resTransaccion = clsDireccionADO.GuardarDirecciones(cuenta.ClienteMaster.DireccionInfo, conn, transaction); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } cuenta.ClienteMaster.DireccionInfo = (clsDireccionInfo)resTransaccion.ObjetoTransaccion; //Actualizar Master resTransaccion = clsClienteMasterADO.ActualizarClienteMaster(cuenta.ClienteMaster, conn, transaction); if (resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) { throw new Exception(resTransaccion.Descripcion); } //Actualizar Cuenta objParams = SqlHelperParameterCache.GetSpParameterSet(conn, "SP_A_CLIENTES_MASTER"); objParams[0].Value = cuenta.Id; objParams[1].Value = cuenta.ClienteMaster.Id; if (cuenta.VendedorAsignado != null) { objParams[2].Value = cuenta.VendedorAsignado.Id; } else { objParams[2].Value = -1; } //if (cuenta.CustomerAsignado != null) // objParams[3].Value = cuenta.CustomerAsignado.Id; //else // objParams[3].Value = -1; objParams[3].Value = cuenta.Telefono; objParams[4].Value = cuenta.CuentaSkype; objParams[5].Value = cuenta.SitioWeb; objParams[6].Value = cuenta.Email; objParams[7].Value = cuenta.Estado; if (cuenta.ZonaVentas != null) { objParams[8].Value = cuenta.ZonaVentas.Id; } else { objParams[8].Value = -1; } if (cuenta.CategoriaCliente != null) { objParams[9].Value = cuenta.CategoriaCliente.Id; } else { objParams[9].Value = -1; } objParams[10].Value = cuenta.Observacion; if (cuenta.SectorEconomico != null) { objParams[11].Value = cuenta.SectorEconomico.Id; } else { objParams[11].Value = -1; } if (cuenta.TipoMonedaVtaEstimada != null) { objParams[12].Value = cuenta.TipoMonedaVtaEstimada.Id; } else { objParams[12].Value = -1; } objParams[13].Value = cuenta.MontoVentaEstimada; objParams[14].Value = cuenta.NumEmpleados; if (cuenta.UMMovimientoEstimado != null) { objParams[15].Value = cuenta.UMMovimientoEstimado.Id; } else { objParams[15].Value = -1; } objParams[16].Value = cuenta.MontoMovimientoEstimado; if (cuenta.FormaContactoPreferida != null) { objParams[17].Value = cuenta.FormaContactoPreferida.Id; } else { objParams[17].Value = -1; } objParams[18].Value = cuenta.PermiteTelOficina; objParams[19].Value = cuenta.PermiteTelParticular; objParams[20].Value = cuenta.PermiteTelCelular; objParams[21].Value = cuenta.PermiteSkype; objParams[22].Value = cuenta.PermiteEmail; objParams[23].Value = cuenta.PermiteEmailMasivo; if (cuenta.DiaPreferido == null) { objParams[24].Value = -1; } else { objParams[24].Value = cuenta.DiaPreferido.Id; } if (cuenta.JornadaPreferida == null) { objParams[25].Value = -1; } else { objParams[25].Value = cuenta.JornadaPreferida.Id; } objParams[26].Value = cuenta.AutorizadoAduana; if (cuenta.Clasificacion == null) { objParams[27].Value = -1; } else { objParams[27].Value = cuenta.Clasificacion.Id; } objParams[28].Value = cuenta.TipoReciboAperturaEmbarcador; SqlCommand command2 = new SqlCommand("SP_A_CLIENTES_MASTER", conn, transaction); command2.Parameters.AddRange(objParams); command2.CommandType = CommandType.StoredProcedure; command2.ExecuteNonQuery(); //Productos preferidos foreach (var producto in cuenta.ClienteMaster.ProductosPreferidos) { if (producto.IsNew && !producto.IsDeleted) { clsClienteMasterADO.AsignarTipoProducto(producto, cuenta.ClienteMaster.Id, transaction, conn); } else if (!producto.IsNew && !producto.IsDeleted) { clsClienteMasterADO.ActualizarTipoProducto(producto, transaction, conn); } else if (producto.IsDeleted) { clsClienteMasterADO.BorrarProductosPorId(producto.Id, transaction, conn); } } //resTransaccion = clsClienteMasterADO.BorrarProductos(cuenta.ClienteMaster.Id, transaction, conn); //if (resTransaccion.Estado == Enums.EstadoTransaccion.Aceptada) //{ // foreach (var producto in cuenta.ClienteMaster.ProductosPreferidos) // { // clsClienteMasterADO.AsignarTipoProducto(producto, cuenta.ClienteMaster.Id, transaction, conn); // } //} //else // throw new Exception(resTransaccion.Descripcion); //Tipos Relacion resTransaccion = clsClienteMasterADO.BorrarTipoRelacion(cuenta.ClienteMaster.Id, transaction, conn); if (resTransaccion.Estado == Enums.EstadoTransaccion.Aceptada) { foreach (var relacion in cuenta.ClienteMaster.TiposRelaciones) { clsClienteMasterADO.AsignarTipoRelacion(relacion, cuenta.ClienteMaster.Id, transaction, conn); } } else { throw new Exception(resTransaccion.Descripcion); } //Condiciones comerciales //resTransaccion = clsCondicionComercialDAO.GuardaCondicionComercialCliente(cuenta.ClienteMaster, conn, // transaction); //if(resTransaccion.Estado == Enums.EstadoTransaccion.Rechazada) // throw new Exception(resTransaccion.Descripcion); //Ejecutar transaccion transaction.Commit(); resTransaccion.Estado = Enums.EstadoTransaccion.Aceptada; resTransaccion.Descripcion = "Se actualizo Cuenta con Id " + cuenta.Id.ToString(); //Registrar Actividad LogActividadUsuarios log = new LogActividadUsuarios(cuenta.GetType().ToString(), cuenta.Id, Enums.TipoActividadUsuario.Edito, Base.Usuario.UsuarioConectado.Usuario); LogActividades.clsLogActividadUsuariosADO.GuardaActividad(log); } catch (Exception ex) { transaction.Rollback(); Log.EscribirLog(ex.Message); resTransaccion.Estado = Enums.EstadoTransaccion.Rechazada; resTransaccion.Descripcion = ex.Message; } finally { conn.Close(); resTransaccion.Accion = Enums.AccionTransaccion.Actualizar; resTransaccion.ObjetoTransaccion = cuenta; } return(resTransaccion); }
public static IList <clsCuenta> ListarCuentas(string nombre, Int64 vendedor, Int64 customer, int idEstado) { IList <clsCuenta> listTarget = new List <clsCuenta>(); clsCuenta cuenta; try { //Abrir Conexion conn = BaseDatos.Conexion(); //Registrar Cliente Master objParams = SqlHelperParameterCache.GetSpParameterSet(conn, "SP_L_CLIENTES_CUENTAS"); objParams[0].Value = nombre; objParams[1].Value = vendedor; objParams[2].Value = customer; objParams[3].Value = idEstado; SqlCommand command = new SqlCommand("SP_L_CLIENTES_CUENTAS", conn); command.Parameters.AddRange(objParams); command.CommandType = CommandType.StoredProcedure; dreader = command.ExecuteReader(); while (dreader.Read()) { cuenta = new clsCuenta(); cuenta.ClienteMaster.Id = Convert.ToInt64(dreader[0]); cuenta.Id = Convert.ToInt64(dreader[1]); cuenta.ClienteMaster.NombreCompañia = dreader[2].ToString(); cuenta.ClienteMaster.RUT = dreader[3].ToString(); if (dreader[4] is DBNull) { cuenta.VendedorAsignado = null; } else { cuenta.VendedorAsignado = new clsUsuario(dreader[4].ToString(), dreader[5].ToString(), dreader[6].ToString()); } //if (dreader[7] is DBNull) // cuenta.CustomerAsignado = null; //else // cuenta.CustomerAsignado = new clsUsuario(dreader[7].ToString(), dreader[8].ToString(), dreader[9].ToString()); cuenta.Telefono = dreader[7].ToString(); cuenta.CuentaSkype = dreader[8].ToString(); cuenta.SitioWeb = dreader[9].ToString(); cuenta.Email = dreader[10].ToString(); cuenta.Estado = (Enums.Estado)Convert.ToInt16(dreader[11]); cuenta.ClienteMaster.NombreFantasia = dreader[12].ToString(); listTarget.Add(cuenta); } } catch (Exception ex) { Log.EscribirLog(ex.Message); } finally { conn.Close(); } return(listTarget); }
private void schedulerControl1_AppointmentDrop(object sender, AppointmentDragEventArgs e) { string createEventMsg = "Crear el evento a las {0} el dia {1}."; string moveEventMsg = "Mover el evento desde {0} el dia {1} a las {2} el dia {3}."; bool Crear = false; bool Mover = false; DateTime srcStart = e.SourceAppointment.Start; DateTime newStart = e.EditedAppointment.Start; string msg = (srcStart == DateTime.MinValue) ? String.Format(createEventMsg, newStart.ToShortTimeString(), newStart.ToShortDateString()) : String.Format(moveEventMsg, srcStart.ToShortTimeString(), srcStart.ToShortDateString(), newStart.ToShortTimeString(), newStart.ToShortDateString()); if (msg.Contains("Crear")) { Crear = true; } if (msg.Contains("Mover")) { Mover = true; } clsVisita visita = new clsVisita(); if (Mover) { if (!PermitirModificarVisita(e.SourceAppointment)) { e.Allow = false; e.Handled = true; return; } } if (XtraMessageBox.Show(msg + "\r\nProceder?", "Mi Calendario", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { e.Allow = false; e.Handled = true; return; } if (Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"]) > 0) { if (Mover) { visita = LogicaNegocios.Calendarios.clsCalendarios.ObtenerVisitaPorId( Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"])); } //visita.Id = Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"]); //visita.Asunto = e.SourceAppointment.Subject; //visita.Descripcion = e.SourceAppointment.Description; //visita.Ubicacion = e.SourceAppointment.Location; visita.FechaHoraComienzo = e.EditedAppointment.Start; visita.FechaHoraTermino = e.EditedAppointment.End; } else { visita.Id = Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"]); visita.Asunto = e.SourceAppointment.Subject; visita.Descripcion = e.SourceAppointment.Description; visita.Ubicacion = e.SourceAppointment.Location; visita.FechaHoraComienzo = e.EditedAppointment.Start; visita.FechaHoraTermino = e.EditedAppointment.End; } if (Crear) { visita.Cliente = LogicaNegocios.Clientes.clsClientesMaster.ObtenerClienteMasterPorId(IdClienteDraw); visita.EstadoBD = Entidades.Enums.Enums.VisitaEstado.Incompleta; if (visita.Cliente.Tipo == Enums.TipoPersona.Cuenta) { ResultadoTransaccion resCuenta = LogicaNegocios.Clientes.clsCuentas.ObtenerCuentaPorIdMaster(visita.Cliente.Id); clsCuenta cuenta = new clsCuenta(); if (resCuenta.Estado == Enums.EstadoTransaccion.Aceptada) { cuenta = (clsCuenta)resCuenta.ObjetoTransaccion; } if (cuenta != null) { visita.Vendedor = cuenta.VendedorAsignado; } } else if (visita.Cliente.Tipo == Enums.TipoPersona.Target) { ResultadoTransaccion resCuenta = LogicaNegocios.Clientes.clsTarget.ObtenerTargetPorIdMaster(visita.Cliente.Id); clsTarget target = new clsTarget(); if (resCuenta.Estado == Enums.EstadoTransaccion.Aceptada) { target = (clsTarget)resCuenta.ObjetoTransaccion; } if (target != null) { visita.Vendedor = target.VendedorAsignado; } } clsVisitaAsistente asistente = new clsVisitaAsistente(); asistente.Usuario = Base.Usuario.UsuarioConectado.Usuario; asistente.TipoAsistente = Entidades.Enums.Enums.VisitaTipoAsistente.Usuario; visita.Asistentes.Add(asistente); clsParametrosInfo paraminfo = LogicaNegocios.Parametros.clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.ImportanciaVisita); visita.NivelImportancia = paraminfo.Items[0]; // Entidades.Enums.Enums.VisitaNivelImportancia.Baja; } //visita.Vendedor = Base.Usuario.UsuarioConectado.Usuario; visita.UsuarioOrganizador = Base.Usuario.UsuarioConectado.Usuario; Entidades.GlobalObject.ResultadoTransaccion res = LogicaNegocios.Calendarios.clsCalendarios.GuardarVisita(visita); if (res.Estado == Entidades.Enums.Enums.EstadoTransaccion.Aceptada) { } else { MessageBox.Show(res.Descripcion, "Calendario", MessageBoxButtons.OK, MessageBoxIcon.Error); e.Allow = false; e.Handled = true; return; } PopupClientes.Visible = false; //if(schedulerStorage1.Appointments.IsNewAppointment(e.EditedAppointment)) //{ // schedulerStorage1.Appointments.Add(e.EditedAppointment); //} //SincronizarOutlook(); }
public static ResultadoTransaccion CambiaEstado(clsCuenta cuenta) { return(AccesoDatos.Clientes.clsCuentaADO.CambiaEstado(cuenta)); }
private void gridView5_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { DevExpress.XtraGrid.Views.Base.ColumnView columna = sender as DevExpress.XtraGrid.Views.Base.ColumnView; string nomcliente = ""; Int64 IdCliente = 0; clsCuenta cuenta = new clsCuenta(); clsClienteMaster clienteselecccionado = new clsClienteMaster(false); if (e.Column.FieldName == "Cliente.NombreFantasia") { nomcliente = columna.EditingValue.ToString(); //Console.WriteLine("nomCliente--->"+nomcliente); if (nomcliente.Trim() != "") { ddlP1Cliente.SelectedIndex = 0; for (int i = 0; i < ddlP1Cliente.Properties.Items.Count; i++) { if (ddlP1Cliente.Properties.Items[i].ToString().Trim() == nomcliente.Trim()) { ddlP1Cliente.SelectedIndex = i; break; } } //Console.WriteLine("index seleccionado--->" + ddlP1Cliente.SelectedIndex); if (ddlP1Cliente.SelectedIndex == 0) { clienteselecccionado = new clsClienteMaster(true) { NombreFantasia = columna.EditingValue.ToString(), NombreCompañia = columna.EditingValue.ToString(), Tipo = Enums.TipoPersona.CuentaPaperless, EstadoCuenta = Enums.Estado.Habilitado }; PaperlessAsignacionActual.DataUsuario1.Paso1HousesBL[e.RowHandle].TipoCliente = null; } else { clienteselecccionado = (clsClienteMaster)this.ddlP1Cliente.SelectedItem; if (clienteselecccionado.Id != 0) { PaperlessTipoCliente ptc = new PaperlessTipoCliente(); var transaccion = LogicaNegocios.Clientes.clsCuentas.BuscarCuentaPorId(clienteselecccionado.Id); if (transaccion != null) { cuenta = (clsCuenta)transaccion.ObjetoTransaccion; if (cuenta != null && cuenta.ClienteMaster.ClienteMasterTipoCliente != null) { if (cuenta.ClienteMaster.ClienteMasterTipoCliente.Count.Equals(0) || cuenta.ClienteMaster.ClienteMasterTipoCliente.Count > 1) { PaperlessAsignacionActual.DataUsuario1.Paso1HousesBL[e.RowHandle].TipoCliente = null; } else { ptc.Nombre = cuenta.ClienteMaster.ClienteMasterTipoCliente[0].Nombre; ptc.Id = cuenta.ClienteMaster.ClienteMasterTipoCliente[0].Id; PaperlessAsignacionActual.DataUsuario1.Paso1HousesBL[e.RowHandle].TipoCliente = ptc; } } else { PaperlessAsignacionActual.DataUsuario1.Paso1HousesBL[e.RowHandle].TipoCliente = null; } } } if (clienteselecccionado.NombreFantasia.Length.Equals(0)) { clienteselecccionado.NombreFantasia = clienteselecccionado.NombreCompañia; } } } PaperlessAsignacionActual.DataUsuario1.Paso1HousesBL[e.RowHandle].Cliente = clienteselecccionado; } if (e.Column.FieldName == "TipoCliente.Nombre") { PaperlessAsignacionActual.DataUsuario1.Paso1HousesBL[e.RowHandle].TipoCliente = (PaperlessTipoCliente)columna.EditingValue; } }