/// <summary> /// Implementación del método de la interfaz. /// </summary> public void saveResultado(Gestion gestion, Parametro tipo, string descripcion, DateTime fecha, Persona titular, Contacto contacto) { if (gestion != null) { // Primero graba y actualiza algunas cosas try { long scn = Persistencia.Controlador.iniciarTransaccion(); gestion.FechaInicio = fecha; gestion.Resultado = tipo; gestion.ResultadoDesc = descripcion; gestion.Contactado = titular; gestion.Contacto = contacto; gestion.Usuario = Sistema.Controlador.SecurityService.getUsuario(); gestion.Estado = _finalizada; gestion.Cuenta.agregarGestion(gestion); gestion.FechaCierre = DateTime.Now; gestion.save(); Persistencia.Controlador.commitTransaccion(scn); } catch (Exception e) { Persistencia.Controlador.rollbackTransaccion(); throw new DataErrorException("DATA-SAVENOK", e.ToString()); } // Finalmente ejecuta el resultado y finaliza la gestion try { ResultadoGestion.EjecutarResultado(gestion, gestion.Resultado); gestion.save(); } catch (Exception e) { throw new DataErrorException("ERROR-EJECUTAR-RESULTADO", e.ToString()); } } }
/// <summary> /// Este método representa el punto de entrada a la api de Resultado de /// Gestión. Se maneja como un método estático que obtiene todos lo que /// se necesita desde sus párametros y con ello define qué resultado se /// debe ejecutar y aplicar las acciones asociadas al mismo. Aqui no se /// capturan las excepciones para se que vuelvan a la clase de gestión. /// IMPORTANTE: el resultado de una gestion se ejecuta ANTES!!! de que /// la misma se cierre y se agregue a la cuenta asociada. Esto es así /// para que, si el resultado falla, la gestion no se modifique y no /// se termine. IMPORTANTE2: POR ESTO ULTIMO, PRIMERO DEBE VERIFICAR /// EL RESULTADO Y QUE DEBE Y PUEDE EJECUTARSE Y RECIEN DESPUES HACER /// CAMBIOS!!!!!!!!!!!. /// </summary> /// <param name="gestion"> /// La gestión que se esta ejecutando. /// </param> /// <param name="resultado"> /// El resultado que se desea ejecutar para la gestión. /// </param> public static void EjecutarResultado(Gestion gestion, Parametro resultado) { // Primero se verifica si debe agregarse un gasto por esto if (gestion.Tipo.Valordouble > 0) AgregarGastoGestion(gestion); // Luego se ejecuta la parte propia de cada resultado if (resultado.Clave.Equals("RESULTADOGESTION.NOCONTACTADO")) EjecutarResultadoNoContactado(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.PROMESAPAGO")) EjecutarResultadoPromesaPago(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.PROMESAPAGOCUOTA")) EjecutarResultadoPromesaPagoCuota(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.PROMESAVISITA")) EjecutarResultadoPromesaVisita(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.PROMESASUCURSAL")) EjecutarResultadoPromesaPagoSucursal(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.ALTACONVENIO")) EjecutarResultadoAltaConvenio(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.FALLECIDO")) EjecutarResultadoDeudorFallecido(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.SINVOLUNTAD")) EjecutarResultadoSinVoluntad(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.AGOTADA")) EjecutarResultadoAgotada(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.SOLICITACONTACTO")) EjecutarResultadoSolicitaContacto(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.REINTENTARCONTACTO")) EjecutarResultadoReintentoContacto(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.CONTACTOINVALIDO")) EjecutarResultadoContactoInvalido(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.POSITIVA")) EjecutarResultadoBusquedaPositiva(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.EMBARGO")) EjecutarResultadoCuentaConEmbargo(gestion); else if (resultado.Clave.Equals("RESULTADOGESTION.INSOLVENTE")) EjecutarResultadoInsolvente(gestion); }
/// <summary> /// Listar todas las gestiones terminadas registradas en el sistema en un periodo de tiempo. /// </summary> /// <param name="i">Fecha inicial del periodo de tiempo</param> /// <param name="i">Fecha final del periodo de tiempo</param> /// <returns>Lista de las gestiones registradas en el sistema</returns> public BindingList <Gestion> listarGestionesTerminadas(DateTime i, DateTime f) { BindingList <Gestion> gestiones = new BindingList <Gestion>(); SqlCommand comando = _manejador.obtenerProcedimiento("SelectGestionesTerminadas"); SqlDataReader datareader = null; _manejador.agregarParametro(comando, "@fecha_inicio", i, SqlDbType.DateTime); _manejador.agregarParametro(comando, "@fecha_fin", f, SqlDbType.DateTime); try { datareader = _manejador.ejecutarConsultaDatos(comando); while (datareader.Read()) { int id_gestion = (int)datareader["ID_Gestion"]; DateTime fecha = (DateTime)datareader["Fecha"]; DateTime fecha_finalizacion = (DateTime)datareader["Fecha_Finalizacion"]; string comentario = (string)datareader["Comentario"]; decimal monto = (decimal)datareader["Monto"]; ClasificacionesGestion clasificacion = (ClasificacionesGestion)datareader["Clasificacion"]; short id_cliente = (short)datareader["ID_Cliente"]; string nombre_cliente = (string)datareader["Nombre_Cliente"]; short id_punto_venta = (short)datareader["ID_Punto_Venta"]; string nombre_punto_venta = (string)datareader["Nombre_Punto_Venta"]; byte id_tipo = (byte)datareader["ID_Tipo"]; string nombre_tipo = (string)datareader["Nombre_Tipo"]; short tiempo_esperado = (short)datareader["Tiempo"]; byte id_causa = (byte)datareader["ID_Causa"]; string descripcion = (string)datareader["Descripcion"]; Causantes causante = (Causantes)datareader["Causante"]; string comentario_causa = (string)datareader["Comentario_Causa"]; Cliente cliente = new Cliente(id_cliente, nombre_cliente); PuntoVenta punto_venta = new PuntoVenta(id_punto_venta, nombre_punto_venta, cliente); TipoGestion tipo = new TipoGestion(id_tipo, nombre_tipo, tiempo_esperado); CausaGestion causa = new CausaGestion(id_causa, descripcion, causante); Gestion gestion = new Gestion(id: id_gestion, punto_venta: punto_venta, monto: monto, tipo: tipo, causa: causa, comentario_causa: comentario_causa, fecha: fecha, fecha_finalizacion: fecha_finalizacion, clasificacion: clasificacion, comentario: comentario); gestiones.Add(gestion); } comando.Connection.Close(); } catch (Exception) { comando.Connection.Close(); throw new Excepcion("ErrorDatosConexion"); } return(gestiones); }
/// <summary> /// Clic en el botón de guardar. /// </summary> private void btnGuardar_Click(object sender, EventArgs e) { // Verificar que se hayan seleccionado los datos if (cboPuntoVenta.SelectedItem == null || cboGestion.SelectedItem == null) { Excepcion.mostrarMensaje("ErrorGestionDatosRegistro"); return; } try { frmAdministracionGestiones padre = (frmAdministracionGestiones)this.Owner; TipoGestion tipo = (TipoGestion)cboGestion.SelectedItem; PuntoVenta punto_venta = (PuntoVenta)cboPuntoVenta.SelectedItem; DateTime fecha = DateTime.Now; string comentario = txtComentario.Text; decimal monto = nudMonto.Value; BindingList <Deposito> depositos = (BindingList <Deposito>)dgvDepositos.DataSource; BindingList <ManifiestoCEF> manifiestos = (BindingList <ManifiestoCEF>)dgvManifiestos.DataSource; BindingList <Tula> tulas = (BindingList <Tula>)dgvTulas.DataSource; // Verificar si la gestión ya está registrada if (_gestion == null) { // Agregar los datos de la gestión if (Mensaje.mostrarMensajeConfirmacion("MensajeGestionRegistro") == DialogResult.Yes) { Gestion nueva = new Gestion(punto_venta: punto_venta, monto: monto, tipo: tipo, fecha: fecha, comentario: comentario); foreach (Deposito deposito in depositos) { nueva.agregarDeposito(deposito); } foreach (ManifiestoCEF manifiesto in manifiestos) { nueva.agregarManifiesto(manifiesto); } foreach (Tula tula in tulas) { nueva.agregarTula(tula); } _coordinacion.agregarGestion(ref nueva); padre.agregarGestion(nueva); Mensaje.mostrarMensaje("MensajeGestionConfirmacionRegistro"); this.Close(); } } else { // Actualizar los datos de la gestión Gestion copia = new Gestion(id: _gestion.ID, punto_venta: punto_venta, monto: monto, tipo: tipo, comentario: comentario); foreach (Deposito deposito in depositos) { copia.agregarDeposito(deposito); } foreach (ManifiestoCEF manifiesto in manifiestos) { copia.agregarManifiesto(manifiesto); } foreach (Tula tula in tulas) { copia.agregarTula(tula); } _coordinacion.actualizarGestion(copia); _gestion.Punto_venta = punto_venta; _gestion.Tipo = tipo; _gestion.Comentario = comentario; _gestion.Depositos = depositos; _gestion.Manifiestos = manifiestos; _gestion.Tulas = tulas; padre.actualizarLista(); Mensaje.mostrarMensaje("MensajeGestionConfirmacionActualizacion"); this.Close(); } } catch (Excepcion ex) { ex.mostrarMensaje(); } }
public ActionResult Create([Bind(Include = "Id,Gral_Nombre,Gral_Apellidopa,Gral_Apellidoma,Gral_Fechanac,Gral_Nss,Gral_Curp,Gral_Rfc,Gral_Lugarnac,Gral_Calle,Gral_Numero,Gral_Cp,Gral_Colonia,Gral_Municipio,Gral_Estado,Gral_Celular,Gral_Tel_casa,Gral_Estado_civil,Gral_Regimen_matrimonial,Gral_Ocupacion,Gral_Teltrabajo,Gral_Correo,Gral_Identificacion,Gral_No_identificacion,Gral_Ref_nombre1,Gral_Ref_cel_1,Gral_Ref_nombre2,Gral_Ref_cel_2,Cyg_Nombre,Cyg_Apellidopa,Cyg_Apellidoma,Gyg_Fechanac,Cyg_Nss,Cyg_Curp,Cyg_Rfc,Cyg_Lugarnac,Cyg_Celular,Cyg_Tel_casa,Cyg_Ocupacion,Cyg_Tel_trabajo,Cyg_Correo,Cyg_Identificacion,Cyg_No_identificacoion,Gral_Fechaalta,Id_Corretaje,Gral_ProgresoForm,Grlal_Folio,Id_Vendedor,Id_Usuario,Gral_CuentaInfonavit,Gral_ClaveInfonavit,Gral_NoExpediente")] Cliente cliente) { int cliente_id; int corretaje_id; string telefono, correo; //Obtener los correos de los usuarios de hablitacion y contaduria var usuarios = (from usu in db.Usuario where usu.usu_tipo == "2" || usu.usu_tipo == "6" select new { usu.usu_correo }).ToArray(); var gestion_controller = new GestionsController(); var gestion = new Gestion(); var verificacion_controller = new VerificacionsController(); var verificacion = new Verificacion(); var foliogenerado = ValidarFolioDuplicado(); //SMS y Correo var sms = new SmsController(); var correo_controlador = new CorreoController(); var estadocivil = new SelectList(new[] { new { value = "No seleccionado", text = "Seleccione una opción..." }, new { value = "Soltero", text = "Soltero" }, new { value = "Casado", text = "Casado" }, new { value = "Divorsiado", text = "Divorsiado" }, new { value = "Viudo", text = "Viudo" } }, "value", "text", 0); if (ModelState.IsValid) { cliente.Gral_Fechaalta = DateTime.Now; cliente.Grlal_Folio = foliogenerado; //Guardar Usuario que creo el registro cliente.Id_Usuario = int.Parse(Session["UsuarioID"].ToString()); db.Cliente.Add(cliente); db.SaveChanges(); //Mandar a llamar el método para crear un formulario vacío cliente_id = cliente.Id; corretaje_id = cliente.Id_Corretaje.Value; //Preguntar si lo dejo así o corretaje_id = cliente.Id_Corretaje.HasValue ? cliente.Id_Corretaje.Value:0 //telefono = cliente.Gral_Celular.ToString(); correo = cliente.Gral_Correo; if (cliente.Id_Corretaje != null) { Corretaje cr = db.Corretaje.Find(cliente.Id_Corretaje); cr.Crt_Status = "Venta"; db.SaveChanges(); } verificacion_controller.VerfificacionCreate(verificacion, cliente_id); gestion_controller.GestionCrear(gestion, cliente_id, corretaje_id); //Si el cliente es eliminado esto hace que se le asigne un nuevo cliente y aparezca en gestion //Gestion gs = db.Gestion.Find(cliente.Id_Corretaje); <---- Ver despues //gs.Id_Cliente = cliente.Id; //db.Enrty(gs).State = EntityState.Modified //db.SaveChanges(); //sms.SendSms(telefono); Comentado porque gasta dinero if (cliente.Gral_Correo != null) { correo_controlador.sendmail(correo); } //Enviar correo de alta de casa a los demás departamentos foreach (var item in usuarios) { if (item != null) { correo_controlador.sendMailGestion(item.usu_correo); } } return(RedirectToAction("Index")); } ViewData["EstadoCivil"] = estadocivil; ViewBag.Id_Corretaje = new SelectList(db.Corretaje, "Id", "Crt_Direccion", cliente.Id_Corretaje); ViewData["Posicion"] = ViewBag.Id_Corretaje; ViewBag.Id_Vendedor = new SelectList(db.Vendedor, "Id", "Vndr_Nombre", cliente.Id_Vendedor); ViewData["Posicion2"] = ViewBag.Id_Vendedor; return(View(cliente)); }
protected void tempb_Click(object sender, EventArgs e) { if (accept.Checked) { Gestion gestion = new Gestion(); requete = "select count (*) as nb from Employee_status where idEmploye='" + userId + "'"; String verif = gestion.recupererValeurString(requete); if (verif.Equals("0")) { requete = "INSERT INTO [dbo].[Employee_status]([idEmploye]) VALUES "; requete += "('" + userId + "')"; gestion.insertToDataBase(requete); } if (admin.Checked != admin1s.Checked) { if (admin.Checked) { requete = "INSERT INTO [dbo].[Employee_status] "; requete += " ([Efunction] ,[idEmploye]) VALUES "; requete += "('ad','" + id + "')"; gestion.insertToDataBase(requete); } else { requete = " delete from Employee_status where Efunction='ad' and idEmploye='" + id + "'"; gestion.insertToDataBase(requete); } } if (hr.Checked != hr1s.Checked) { if (hr.Checked) { requete = "INSERT INTO [dbo].[Employee_status] "; requete += " ([Efunction] ,[idEmploye]) VALUES "; requete += "('hr','" + id + "')"; gestion.insertToDataBase(requete); } else { requete = " delete from Employee_status where Efunction='hr' and idEmploye='" + id + "'"; gestion.insertToDataBase(requete); } } if (sup1s.Checked != sup.Checked) { if (sup.Checked) { requete = "INSERT INTO [dbo].[Employee_status] "; requete += " ([Efunction] ,[idEmploye]) VALUES "; requete += "('sup','" + id + "')"; gestion.insertToDataBase(requete); } else { requete = " delete from Employee_status where Efunction='sup' and idEmploye='" + id + "'"; gestion.insertToDataBase(requete); } } if (deptManage1s.Checked != deptManage.Checked || listdepartement.SelectedIndex != -1) { if (deptManage.Checked) { requete = "select dmmUserID from User_Information where userFName='" + userfname; requete += " ' and userSName='" + userlname + "'"; String idmanager = gestion.recupererValeurString(requete); requete = "select DMMDeptID from Department where DeptName='" + deptname + "'"; String idDepartement = gestion.recupererValeurString(requete); requete = "select count(*) as nb from SupervisorControl where idManager='" + idmanager + "'"; requete += " and idEmploye='0' and idDept='" + idDepartement + "'"; if (gestion.recupererValeurString(requete).Equals("0")) { requete = "INSERT INTO [dbo].[SupervisorControl] ([idEmploye] ,[idManager],[fromdate],[idDept]) "; requete += "VALUES ('0','" + idmanager + "','" + DateTime.Today.ToString("yyyy-MM-dd") + "','" + idDepartement + "')"; gestion.insertToDataBase(requete); requete = "select distinct idEmploye,idvacation,fromdate from SupervisorControl where "; requete += " idEmploye!='0' and idDept='" + idDepartement + "'"; List <Supervision> listsupervision = gestion.updateSupervision(requete); foreach (Supervision superv in listsupervision) { requete = "INSERT INTO [dbo].[SupervisorControl]([idEmploye] "; requete += ",[idManager],[fromdate],[idDept] ,[idvacation]) VALUES "; requete += "('" + superv.idEmploye + "','" + idmanager + "','" + superv.datefrom + "','"; requete += idDepartement + "','" + superv.idvacation + "')"; gestion.insertToDataBase(requete); } } else { Response.Write("ALREADY A MANAGER"); } } else { requete = " delete from SupervisorControl where idManager='" + id + "' and idDept=("; requete += "select DMMDeptID from Department where DeptName='" + deptname + "')"; gestion.insertToDataBase(requete); } } /* * if(!admin.Checked && !hr.Checked && !sup.Checked) * { * requete = "Update Employee_status "; * requete += " set Efunction='' where idEmploye=(select dmmUserID from User_Information where userFName='" + userfname; * requete += " ' and userSName='" + userlname + "')"; * gestion.insertToDataBase(requete); * }*/ } Response.Redirect("~/Home/settingsUsersrights.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Gestion gestion = new Gestion(); userId = Application.Get("userId").ToString(); punch = Application.Get("punch").ToString(); if (Application.Get("adminstatus").ToString().Equals("ad")) { titreAdmin.Visible = true; } else { titreAdmin.Visible = false; } if (Application.Get("hrstatus").ToString().Equals("hr")) { titreHr.Visible = true; } else { titreHr.Visible = false; } if (Application.Get("supstatus").ToString().Equals("sup")) { titresup.Visible = true; } else { titresup.Visible = false; } requete = "SELECT [UserDeptId]"; requete += " from User_Information where UserPayrollNo='" + punch + "'"; iddept = gestion.recupererValeurString(requete); requete = "SELECT distinct vsupervisor FROM Vacation_information,User_Information,Department"; requete += " where vuserid=dmmUserID and vuserid='" + userId + "' and UserDeptId=DMMDeptID"; try { supervisor = gestion.recupererValeurString(requete); requete = "SELECT userFName,userSName, [fromdate],[todate],[dateSubmit],[situation],DeptName,idvacation,nbdaysh"; requete += " FROM [Vacation_information],User_Information,Department where dmmUserID='" + userId + "'"; requete += " and vuserid=dmmUserID and UserDeptId=DMMDeptID ORDER BY fromdate DESC"; secondrequete = "SELECT userFName,userSName FROM [Vacation_information],User_Information where vuserid='" + userId + "'"; secondrequete += " and vsupervisor=dmmUserID ORDER BY fromdate DESC"; gestion.bingGridVEmp(requete, secondrequete, GridView1, 9); error.Visible = false; } catch (SystemException ex) { error.Visible = true; } } }
/// <summary> /// Este método importa novedades de pagos para cuentas de CARSA /// y/o CREDINEA, actualizando ademas los saldos asociados a las /// mismas. /// </summary> public static void ImportarNovedadesPagoCarsa(DataRow registro) { // luego obtiene otros datos del registro const string observacion = "OBSERV: "; string mensaje = observacion; int pto = Convert.ToInt32(registro["NroPtoVta"].ToString().Trim()); bool hayPlanVigente = registro["PlanVigente"].ToString().Trim().Equals("SI"); string ficha = registro["NroFicha"].ToString().Trim().ToUpper(); string expte = registro["ExpedNro"].ToString().Trim().ToUpper(); string recibo = registro["NroRecibo"].ToString().Trim().ToUpper(); int strent = Convert.ToInt32(registro["CodCom"].ToString().Trim()); Guid entidadId = (strent == 4 || ficha.StartsWith("S")) ? _entCarsa.Id : _entCredinea.Id; double capital = Convert.ToDouble(registro["Capital"].ToString().Replace('.', ',')); double interes = Convert.ToDouble(registro["Intereses"].ToString().Replace('.', ',')); double gastos = Convert.ToDouble(registro["Gastos"].ToString().Replace('.', ',')); double subtotal = Convert.ToDouble(registro["SubTotalEmpresa"].ToString().Replace('.', ',')); double honorario = subtotal - capital - interes - gastos; // primero verifica el punto de venta que recibio el pago // para asegurarse de no tomar los pagos recibidos en A&A if (pto == 706 || pto == 957) throw new DataErrorException("GENERICO", "El pago fue cobrado en el Estudio (ya computado)!"); // Hace un tratamiento especial con las fechas por las dudas DateTime fechapago = Fechas.FechaNull; DateTime fechaimp = Fechas.FechaNull; try { fechapago = Convert.ToDateTime(registro["Fecha"]);} catch {} try { fechaimp = Convert.ToDateTime(registro["FechaImputacion"]);} catch {} // luego verifica el tipo de pago para no tomar anulaciones // y/o devoluciones (por hora no hacer nada es estos casos?) string tipo = registro["CpteDGI"].ToString().Trim().ToUpper(); if (tipo.Contains("ANULA") || tipo.Contains("DEVOLU")) throw new DataErrorException("GENERICO", "El tipo de pago es Devolucion ó Anulacion: valores no admitidos!"); // luego verifica si la cuenta ya existe cargada (por codigo) string sql = "SELECT [cta_id] as cta, [cta_estado] as edo, [cta_activada] as act, [cta_convenioactivo] as conv"; sql += " FROM [sgmpro].[dbo].[Cuenta]"; sql += " WHERE [cta_codigo] = '" + ficha + "'"; sql += " AND [cta_entidad] = '" + entidadId + "'"; sql += " AND [cta_fechabaja] = convert(datetime, '1753-01-01 00:00:000', 121)"; sql += " ORDER BY [cta_fechaasignacion] DESC"; object[] resulta = Persistencia.EjecutarSqlOneRow(sql, _cadena); // si no existe la cuenta => sale (ni intenta cargar la deuda) if (resulta == null) throw new DataErrorException("GENERICO", "La Cuenta no existe en el Sistema -o se encuentra dada de baja-!"); // obtiene la cuenta para seguir con el resto Cuenta cuenta = Cuentas.GetById(((Guid)resulta[0])); // si existe pero esta cancelada entonces ni intenta cargar el pago if (cuenta.Estado.Equals(_ecCancelado)) throw new DataErrorException("GENERICO", "La Cuenta tiene estado de Cancelación Total de Deuda!"); // si existe pero esta cancelada entonces ni intenta cargar el pago if (cuenta.getMontoSaldoTotalActual() <= 0) throw new DataErrorException("GENERICO", "La Cuenta no tiene Deuda cancelable!"); // si existe pero esta desasignada entonces no intenta cargar el pago if (cuenta.Estado.Equals(_ecDesasignada)) mensaje += "Al ingreso del Pago la Cuenta se encuentra Desasignada!\r\n"; // si existe pero no esta activa entonces no intenta cargar el pago if (resulta[2].ToString().Equals("0")) mensaje += "Al ingreso del Pago la Cuenta NO se encuentra Activa!\r\n"; // si el pago es por plan pero la cuenta no tiene un plan entonces no carga el pago if (cuenta.ConvenioActivo == null && hayPlanVigente) mensaje += "Se ingresa un Pago marcado como de Convenio y la Cuenta no posee Convenio Activo!\r\n"; // si el pago no es por plan y la cuenta si tiene un plan entonces no carga el pago if (cuenta.ConvenioActivo != null && !hayPlanVigente) mensaje += "Se ingresa un Pago que NO es de Convenio y la Cuenta posee un Convenio Activo!\r\n"; // obtiene los datos necesarios para ingresar el pago if (cuenta.getMontoSaldoConvenio() <= 0 && hayPlanVigente && mensaje.Equals(observacion)) mensaje += "Se ingresa un Pago marcado como de Convenio y la Cuenta NO posee saldo de Convenio!\r\n"; // genera un mensaje descriptivo string desc = "Cuenta=" + cuenta + " - Fecha=" + (fechapago == Fechas.FechaNull ? "S/D" : fechapago.Date.ToString()) + " - Fecha Imp.=" + (fechaimp == Fechas.FechaNull ? "S/D" : fechaimp.Date.ToString()) + " - Capital=$" + capital + " - Interes=$" + interes + " - Honor=$" + honorario + " - Gastos=$" + gastos + " - Total=$" + subtotal + " - Expte=" + expte + " - Recibo=" + recibo + " - Sucursal=" + pto + " - Tiene Convenio=" + (hayPlanVigente ? "SI" : "NO") + (mensaje.Equals(observacion) ? string.Empty : " - " + mensaje); // si todavia no hay problemas entonces obtiene la deuda mas vieja (sea de plan o comun) //Deuda deuda = null; //if (mensaje.Equals(observacion)) // try { // deuda = hayPlanVigente // ? (Deudas.OrdenarPorFecha(cuenta.ConvenioActivo.getCuotasPendientes()))[0] // : (Deudas.OrdenarPorFecha(cuenta.getDeudaInformada()))[0]; // if (deuda == null) // throw new DataErrorException("GENERICO", "Deuda es NULL"); // } catch (Exception e) { // Sistema.Controlador.logear("GENERICO", ENivelMensaje.INFORMACION, "Error al importar Pago [" + desc + "]:" + e); // mensaje += hayPlanVigente // ? "No puede determinarse la Cuota del Convenio a cancelar!\r\n" // : "No puede determinarse la Deuda Informada a cancelar!\r\n"; // } //// Verifica los montos en caso de ser un plan, porque si hay mucha //// diferencia, entonces solo agrega una gestion y termina el proceso //if ((hayPlanVigente // && (deuda != null) // && (Math.Abs(deuda.Total-subtotal) > Deuda.TOPE_DIFERENCIA_MONTO)) // || (!mensaje.Equals(observacion))) { Gestion gestion = new Gestion { Cuenta = cuenta, Tipo = _tipBack, Contactado = cuenta.Titular, Contacto = cuenta.Titular.getContactoPrincipal(), Estado = _gfinalizada, FechaInicio = DateTime.Now, FechaCierre = DateTime.Now, FechaUMod = DateTime.Now, Resultado = _resgesPagoVerif, ResultadoDesc = ("PAGO EN SUCURSAL PARA VERIFICAR: " + desc)}; cuenta.agregarGestion(gestion); //return; //} //// si esta todos bien entonces genera el pago a ingresar //if (deuda != null) // deuda.impactarPagoSucursal(capital, interes, honorario, gastos, fechapago, // string.Format("Imputación hecha por importación de Pagos en Sucursal (usuario {1}): {0}", desc, // Sistema.Controlador.SecurityService.getUsuario().Nombre)); }
/// <summary> /// Ejecución de un resultado de promesa de pago parcial en sucrusal /// (antes de firmar un plan). /// </summary> public static void EjecutarResultadoPromesaPagoSucursal(Gestion gestion) { gestion.Cuenta.FechaElegible = gestion.ResultadoFecha.AddDays((Parametros.GetByClave("GESTION.DIASGRACIA")).Valorlong); //gestion.Cuenta.setearEstado( // gestion.Cuenta.Estado.Clave.Contains("JUICIO") // ? Parametros.GetByClave("ESTADOCUENTA.JUICIO-CON-PROMESA") // : Parametros.GetByClave("ESTADOCUENTA.PROMESA-DE-PAGO"), // "Fecha de promesa:" + gestion.ResultadoFecha.ToShortDateString()); }
/// <summary> /// Ejecución de un resultado de no contactado, donde verifica que si /// se supero el valor del parametro MAXIMAGESTIONESNC entonces debe /// pasarse la cuenta al estado 'NO SE UBICA' (cuenta valorlong-1 pq /// se agrega esta gestion tb obvio). /// </summary> public static void EjecutarResultadoNoContactado(Gestion gestion) { //if (gestion.Cuenta.Estado.Clave.Contains("JUICIO")) // return; //Parametro maxnc = Parametros.GetByClave("GESTION.MAXIMAGESTIONESNC"); //for (int i = 0; i <= (maxnc.Valorlong - 1); i++) { // Gestion ges = gestion.Cuenta.getGestionRealizadaAnteriorSinRefresh(i); // if (ges == null || !ges.Resultado.Equals(gestion.Resultado)) // return; //} //gestion.Cuenta.setearEstado(Parametros.GetByClave("ESTADOCUENTA.NO-SE-UBICA")); }
public NegocioUsuario() { gestion = new Gestion(); }
public async Task <ICollection <AlertaIndividualOutput> > ExecuteList(int gestion, decimal monto, string operador, decimal porcentaje) { var declaracionesAlerta = await _alertaIndividualReadOnlyRepository.GetFromGestion(gestion); var gestionOutput = await _gestionReadOnlyRepository.Get(gestion); var result = new List <AlertaIndividualOutput>(); foreach (var item in declaracionesAlerta) { var declaracionActual = await _declaracionReadOnlyRepository.Get(item.DeclaracionID); Declaracion declaracionAnterior = null; try { if (item.DeclaracionAnteriorID == null) { declaracionAnterior = Declaracion.Load(Guid.NewGuid(), item.FuncionarioID, Gestion.For(gestionOutput.Anio, gestionOutput.FechaInicio, gestionOutput.FechaFinal, gestionOutput.Vigente), DateTime.Now, Domain.Enumerations.EstadoDeclaracion.Completado, new DepositoCollection(), new DeudaBancariaCollection(), new InmuebleCollection(), new OtroIngresoCollection(), new ValorNegociableCollection(), new VehiculoCollection(), null); } else { declaracionAnterior = await _declaracionReadOnlyRepository.Get(item.DeclaracionAnteriorID); if (declaracionAnterior == null) { declaracionAnterior = Declaracion.Load(Guid.NewGuid(), item.FuncionarioID, Gestion.For(gestionOutput.Anio, gestionOutput.FechaInicio, gestionOutput.FechaFinal, gestionOutput.Vigente), DateTime.Now, Domain.Enumerations.EstadoDeclaracion.Completado, new DepositoCollection(), new DeudaBancariaCollection(), new InmuebleCollection(), new OtroIngresoCollection(), new ValorNegociableCollection(), new VehiculoCollection(), null); } } var declaracion = Declaracion.Load(declaracionActual.ID, declaracionActual.FuncionarioID, declaracionActual.Gestion, declaracionActual.FechaLlenado, declaracionActual.Estado, declaracionActual.Depositos, declaracionActual.DeudasBancarias, declaracionActual.Inmuebles, declaracionActual.OtrosIngresos, declaracionActual.ValoresNegociables, declaracionActual.Vehiculos, declaracionAnterior); if (declaracionAnterior.Depositos.ValorNeto > 0) { item.SetMontosDepositos(declaracionActual.Depositos.ValorNeto, declaracionAnterior.Depositos.ValorNeto, declaracionActual.Depositos.ValorNeto - declaracionAnterior.Depositos.ValorNeto, (declaracionActual.Depositos.ValorNeto - declaracionAnterior.Depositos.ValorNeto) / declaracionAnterior.Depositos.ValorNeto * 100); } if (declaracionAnterior.DeudasBancarias.ValorNeto > 0) { item.SetMontosDeudaBancaria(declaracionActual.DeudasBancarias.ValorNeto, declaracionAnterior.DeudasBancarias.ValorNeto, declaracionActual.DeudasBancarias.ValorNeto - declaracionAnterior.DeudasBancarias.ValorNeto, (declaracionActual.DeudasBancarias.ValorNeto - declaracionAnterior.DeudasBancarias.ValorNeto) / declaracionAnterior.DeudasBancarias.ValorNeto * 100); } if (declaracionAnterior.Inmuebles.ValorNeto > 0) { item.SetMontosInmuebles(declaracionActual.Inmuebles.ValorNeto, declaracionAnterior.Inmuebles.ValorNeto, declaracionActual.Inmuebles.ValorNeto - declaracionAnterior.Inmuebles.ValorNeto, (declaracionActual.Inmuebles.ValorNeto - declaracionAnterior.Inmuebles.ValorNeto) / declaracionAnterior.Inmuebles.ValorNeto * 100); } if (declaracionAnterior.OtrosIngresos.ValorNeto > 0) { item.SetMontosOtrosIngresos(declaracionActual.OtrosIngresos.ValorNeto, declaracionAnterior.OtrosIngresos.ValorNeto, declaracionActual.OtrosIngresos.ValorNeto - declaracionAnterior.OtrosIngresos.ValorNeto, (declaracionActual.OtrosIngresos.ValorNeto - declaracionAnterior.OtrosIngresos.ValorNeto) / declaracionAnterior.OtrosIngresos.ValorNeto * 100); } if (declaracionAnterior.ValoresNegociables.ValorNeto > 0) { item.SetMontosValoresNegociables(declaracionActual.ValoresNegociables.ValorNeto, declaracionAnterior.ValoresNegociables.ValorNeto, declaracionActual.ValoresNegociables.ValorNeto - declaracionAnterior.ValoresNegociables.ValorNeto, (declaracionActual.ValoresNegociables.ValorNeto - declaracionAnterior.ValoresNegociables.ValorNeto) / declaracionAnterior.ValoresNegociables.ValorNeto * 100); } if (declaracionAnterior.Vehiculos.ValorNeto > 0) { item.SetMontosVehiculos(declaracionActual.Vehiculos.ValorNeto, declaracionAnterior.Vehiculos.ValorNeto, declaracionActual.Vehiculos.ValorNeto - declaracionAnterior.Vehiculos.ValorNeto, (declaracionActual.Vehiculos.ValorNeto - declaracionAnterior.Vehiculos.ValorNeto) / declaracionAnterior.Vehiculos.ValorNeto * 100); } item.SetMontosPatrimonioTotal(declaracion.PatrimonioNeto, declaracion.PatrimonioNetoGestionAnterior, declaracion.DiferenciaPatrimonio, declaracion.VariacionPorcentual); result.Add(item); } catch (Exception ex) { var exception = new InvalidOperationException(String.Format("Error en Declaraion '{0}' FuncionarioID '{1}'", item.DeclaracionID, declaracionActual.FuncionarioID), ex); throw exception; } } if (monto > 0 && porcentaje > 0 && !String.IsNullOrEmpty(operador)) { var condicionAlerta = new CondicionAlerta(operador); switch (condicionAlerta.Operador) { case Domain.Enumerations.OperadorAlerta.Y: result = result.Where(c => c.DiferenciaPatrimonio > monto && c.VariacionPorcentual > porcentaje).ToList(); break; case Domain.Enumerations.OperadorAlerta.O: result = result.Where(c => c.DiferenciaPatrimonio > monto || c.VariacionPorcentual > porcentaje).ToList(); break; default: break; } } return(result); }
public static String GetRutaGestion(Gestion opcion) { return(GESTION + "/index.php#" + opcion.ToString()); }
/// <summary> /// Este método importa novedades de pagos para cuentas de CARSA /// y/o CREDINEA, actualizando ademas los saldos asociados a las /// mismas. /// </summary> public static void ImportarPromoCarsaMega(DataRow registro) { // luego obtiene otros datos del registro const string observacion = "OBSERV: "; string mensaje = observacion; string ficha = registro["Ficha"].ToString().Trim().ToUpper(); string promoa = registro["PromoA"].ToString().Trim().ToUpper(); string promob = registro["PromoB"].ToString().Trim().ToUpper(); string promobcuota = registro["MontoCuota"].ToString().Trim().ToUpper(); Guid entidadId = (ficha.StartsWith("S")) ? _entCarsa.Id : _entCredinea.Id; // Hace un tratamiento especial con las fechas por las dudas DateTime fechamora = Fechas.FechaNull; try { fechamora = Convert.ToDateTime(registro["FechaMora"]); } catch { } // luego verifica si la cuenta ya existe cargada (por codigo) string sql = "SELECT [cta_id] as cta, [cta_estado] as edo, [cta_activada] as act, [cta_convenioactivo] as conv"; sql += " FROM [sgmpro].[dbo].[Cuenta]"; sql += " WHERE [cta_codigo] = '" + ficha + "'"; sql += " AND [cta_entidad] = '" + entidadId + "'"; sql += " AND [cta_fechabaja] = convert(datetime, '1753-01-01 00:00:000', 121)"; sql += " ORDER BY [cta_fechaasignacion] DESC"; object[] resulta = Persistencia.EjecutarSqlOneRow(sql, _cadena); // si no existe la cuenta => sale (ni intenta cargar la deuda) if (resulta == null) throw new DataErrorException("GENERICO", "La Cuenta no existe en el Sistema -o se encuentra dada de baja-!"); // obtiene la cuenta para seguir con el resto Cuenta cuenta = Cuentas.GetById(((Guid)resulta[0])); // si existe pero esta cancelada entonces ni intenta cargar el pago if (cuenta.Estado.Equals(_ecCancelado)) throw new DataErrorException("GENERICO", "La Cuenta tiene estado de Cancelación Total de Deuda!"); // si existe pero esta cancelada entonces ni intenta cargar el pago if (cuenta.getMontoSaldoTotalActual() <= 0) throw new DataErrorException("GENERICO", "La Cuenta no tiene Deuda cancelable!"); // si existe pero esta desasignada entonces no intenta cargar el pago if (cuenta.Estado.Equals(_ecDesasignada)) mensaje += "Al ingreso de la Promo la Cuenta se encuentra Desasignada!\r\n"; // si existe pero no esta activa entonces no intenta cargar el pago if (resulta[2].ToString().Equals("0")) mensaje += "Al ingreso de la Promo la Cuenta NO se encuentra Activa!\r\n"; // genera un mensaje descriptivo string desc = "Cuenta=" + cuenta + " - Fecha Mora=" + (fechamora == Fechas.FechaNull ? "S/D" : fechamora.Date.ToString()) + " - Opcion A: TOTAL = $" + promoa + " - Opcion B: TOTAL = $" + promob + " EN 3 CUOTAS = $" + promobcuota + (mensaje.Equals(observacion) ? string.Empty : " - " + mensaje); Gestion gestion = new Gestion { Cuenta = cuenta, Tipo = _tipBack, Contactado = cuenta.Titular, Contacto = cuenta.Titular.getContactoPrincipal(), Estado = _gfinalizada, FechaInicio = DateTime.Now, FechaCierre = DateTime.Now, FechaUMod = DateTime.Now, Resultado = _resgesPromo, ResultadoDesc = ("***PROMOCION CARSA ACTIVOS: " + desc) }; cuenta.agregarGestion(gestion); cuenta.setearEstado(_ecPromocion); }
public void setControlador(Gestion ctr) { _controlador = ctr; }
public bool iniciar(object padre, params object[] valor) { // Asigna el padre Padre = padre; // Obtiene la gestión correspondiente if (valor.Count() < 2) return false; // Imprime una sola o genera toda una lista if (valor[1] is Gestion && ((Gestion)valor[1]).Tipo != null) { _gestionEnCurso = valor[1] as Gestion; // Crea el panel para seleccionar el template de la carta var panel = new PanelSeleccionTemplate(this) {Dock = DockStyle.Fill}; // Crea el formulario var ventana = new FrmVisualizador( String.Format("{0} - Imprimir carta", _gestionEnCurso.Tipo.Valorstring)) { Owner = (Form) Padre, Size = new Size(540, 125), MaximizeBox = false, MinimizeBox = false, FormBorderStyle = FormBorderStyle.FixedSingle }; // Agrega el panel al formulario ventana.Controls.Add(panel); DialogResult resultado = ventana.ShowDialog(); if (resultado == DialogResult.OK) { // Asigna el nombre de la carta seleccionada a la descripción // del resultado de la gestión _gestionEnCurso.ResultadoDesc += panel.NombreCarta; _gestionEnCurso.save(); } return true; } if (valor[1] is ListaGestion) { _listaEnCurso = valor[1] as ListaGestion; // Crea el panel para seleccionar el template de la carta var panel = new PanelSeleccionTemplateLista(this, _listaEnCurso) { Dock = DockStyle.Fill }; // Crea el formulario var ventana = new FrmVisualizador( String.Format("{0} - Generar Documentos", _listaEnCurso.Nombre)) { Owner = (Form)Padre, Size = new Size(540, 165), MaximizeBox = false, MinimizeBox = false, FormBorderStyle = FormBorderStyle.FixedSingle }; // Agrega el panel al formulario ventana.Controls.Add(panel); DialogResult resultado = ventana.ShowDialog(); } return false; }
/// <summary> /// Ejecución de un resultado de promesa de visita al estudio. /// </summary> public static void EjecutarResultadoPromesaVisita(Gestion gestion) { gestion.Cuenta.FechaElegible = gestion.ResultadoFecha.AddDays((Parametros.GetByClave("GESTION.DIASGRACIA")).Valorlong); }
/// <summary> /// Este método se encarga de verificar y agergar, si debe, el /// gasto que corresponda por la ejecución de la gestión actual. /// </summary> /// <param name="gestion"> /// La gestión que se esta ejecutando. /// </param> private static void AgregarGastoGestion(Gestion gestion) { if (gestion.Tipo.Valordouble > 0) { Deuda d = new Deuda(DateTime.Now, Parametros.GetByClave("CONCEPTODEUDA.GASTO"), Parametros.GetByClave("DETALLEDEUDA.NINGUNO"), false, "GASTO POR GESTION " + gestion.Tipo, 0, 0, 0, Math.Round(gestion.Tipo.Valordouble, 2), gestion.Cuenta, null, 0); // TODO: VERIFICAR SI SE DEBE GRABAR LA DEUDA CREADA POR GESTION EN AGREGARGASTOGESTION() //d.save(); gestion.Cuenta.agregarDeuda(d); } }
/// <summary> /// Ejecución de un resultado de alta de convenio. /// </summary> private static void EjecutarResultadoAltaConvenio(Gestion gestion) { gestion.Estado = Parametros.GetByClave("ESTADOGESTION.FINALIZADA"); gestion.Usuario = Sistema.Controlador.SecurityService.getUsuario(); gestion.Resultado = Parametros.GetByClave("RESULTADOGESTION.ALTACONVENIO"); gestion.FechaInicio = gestion.FechaInicio.Equals(Fechas.FechaNull) ? DateTime.Now : gestion.FechaInicio; gestion.FechaUMod = DateTime.Now; gestion.FechaCierre = DateTime.Now; gestion.save(); gestion.Cuenta.ListaAsignada = null; gestion.Cuenta.FechaElegible = gestion.Cuenta.ConvenioActivo.getPrimeraCuota().FechaVencimiento.AddDays( (Parametros.GetByClave("GESTION.DIASGRACIA")) .Valorlong); gestion.Cuenta.save(); }
//Funcion generar registro vacio relacionado con un cliente dado de alta public void CreateGestions(int cliente_id, int corretaje_id) { CasasRedEntities CS = new CasasRedEntities(); //Consulta para buscar las casas existentes en la base de datos var gestio = (from a in db.Gestion where corretaje_id == a.Id_Corretaje select a).FirstOrDefault(); //Si es distinto a null entonces la casa si esta registrada en gestion if (gestio != null) { gestio.Id_Cliente = cliente_id; db.SaveChanges(); } else { Gestion gestion_obj = new Gestion { Gtn_Escrituras = false, Gtn_Planta_Cartografica = false, Gtn_Predial = false, Gtn_Recibo_Luz = false, Gtn_Recibo_Agua = false, Gtn_Acta_Nacimiento = false, Gtn_IFE_Copia = false, Gtn_Sol_Ret_Ifo = false, Gtn_Cert_Hip = false, Gtn_Cert_Fiscal = false, Gtn_Sol_Estado = false, Gtn_Junta_URBI = false, Gtn_Agua_Pago_Inf = false, Gtn_Cert_Cartogr = false, Gtn_No_Oficial = false, Gtn_Avaluo = false, Gtn_CT_Banco = false, Gtn_Aviso_Suspension = false, Gtn_Formato_Infonavit = false, Gtn_Fotos_Propiedad = false, Gtn_Evaluo_Contacto = false, Gtn_Planeacion_Fianza = false, Gtn_Urbanizacion = false, Gtn_Credito_INFONAVIT = false, Gtn_Notaria = false, Gtn_Firma_Escrituras = false, Id_Cliente = cliente_id, Id_Corretaje = corretaje_id, Gtn_ProgresoForm = 0, Gtn_FechaAlta = DateTime.Now, Gtn_CuentaBancaria = false, Gtn_ReciboActualizado = false, Gtn_Taller = false, Gtn_Acta_Nacim_Cony = false, Gtn_Acta_Matrimonio = false, Gtn_DatosGnrl_Comp = false, Gtn_Comp_Domicilio = false, Gtn_Recibo_Nomina = false, Gtn_RFC_Comprador = false, Gtn_CURP_Comprador = false, Gtn_RFC_Conyugue = false, Gtn_CURP_Conyugue = false, Gtn_Inscp_INFONAVIT = false, Gtn_Acta_Nac_Ven = false, Gtn_Acta_Nac_Cony_Ven = false, Gtn_Acta_Matrimonio_Ven = false, Gtn_IFE_Copia_Ven = false, Gtn_RFC_Ven = false, Gtn_CURP_Ven = false, Gtn_RFC_Conyu_Ven = false, Gtn_CURP_Conyu_Ven = false, Gtn_Entrega_Vivienda = false, Gtn_Aviso_Ret = false, }; CS.Gestion.Add(gestion_obj); CS.SaveChanges(); } }
/// <summary> /// Ejecución de un resultado de contacto inválido. /// </summary> private static void EjecutarResultadoBusquedaPositiva(Gestion gestion) { //if (!gestion.Cuenta.Estado.Clave.Contains("JUICIO")) // gestion.Cuenta.setearEstado(Parametros.GetByClave("ESTADOCUENTA.CONTACTO")); }
public Respuesta <object> insertarGestion(Gestion gestion) { var resultado = this.cliente.insertarGestion(gestion); return(resultado); }
/// <summary> /// Ejecución de un resultado de contacto inválido. /// </summary> private static void EjecutarResultadoContactoInvalido(Gestion gestion) { //if (!gestion.Cuenta.Estado.Clave.Contains("JUICIO")) // gestion.Cuenta.setearEstado(Parametros.GetByClave("ESTADOCUENTA.BUSQUEDA")); }
/// <summary> /// Implementación del método de la interfaz. /// </summary> public void aceptarParametros(params object[] parametros) { if (!(parametros[0] is Cuenta)) throw new DataErrorException("ERROR-ADD-WITHOUT-MASTER", null); CuentaActual = (Cuenta)parametros[0]; // Si viene una gestion verifica su estado y asignacion // y si no viene entonces crea una nueva para gestionar _gestion = null; if (parametros.Length > 1) { if (!(parametros[1] is Gestion)) throw new DataErrorException("ERROR-DATA-GESTION-TIPO-NOK", null); _gestion = (Gestion)parametros[1]; } }
/// <summary> /// Ejecución de un resultado de cuenta con embargo. /// </summary> private static void EjecutarResultadoCuentaConEmbargo(Gestion gestion) { //gestion.Cuenta.setearEstado(Parametros.GetByClave("ESTADOCUENTA.CUENTA-CON-EMBARGO")); }
static void Main(string[] args) { Avion avion = new Avion(500000, 1500); Comercial comercial = new Comercial(500000, 1500, 150); Privado privado = new Privado(700000, 2000, 20); Console.WriteLine(avion.Informacion); Console.WriteLine(comercial.Informacion); Console.WriteLine(privado.Informacion); Console.WriteLine("----------------------------------------------------"); Console.WriteLine("Impuesto avion: " + ((IAFIP)avion).CalcularImpuesto()); Console.WriteLine("Impuesto avion: " + ((IARBA)avion).CalcularImpuesto()); Console.WriteLine("Impuesto comercial: " + ((IAFIP)comercial).CalcularImpuesto()); Console.WriteLine("Impuesto comercial: " + ((IARBA)comercial).CalcularImpuesto()); Console.WriteLine("Impuesto comercial no casteado: " + comercial.CalcularImpuesto()); Console.WriteLine("Impuesto privado: " + ((IAFIP)privado).CalcularImpuesto()); Console.WriteLine("Impuesto privado: " + ((IARBA)privado).CalcularImpuesto()); Console.WriteLine("----------------------------------------------------"); //Console.ReadLine(); Familiar F = new Familiar(60000, "III111", 4); Deportivo D = new Deportivo(120000, "AAA222", 600); Console.WriteLine(F.Informacion); Console.WriteLine(D.Informacion); Console.WriteLine("----------------------------------------------------"); IAFIP I1; IARBA I2; I1 = comercial; I2 = comercial; Console.WriteLine("Metodo MostrarImpuestoNacional: " + Gestion.MostrarImpuestoNacional(I1)); Console.WriteLine("Metodo MostrarImpuestoProvincial: " + Gestion.MostrarImpuestoProvincial(I2)); Console.WriteLine("Precio Total comercial: {0}", comercial.Precio + Gestion.MostrarImpuestoNacional(I1) + Gestion.MostrarImpuestoProvincial(I2)); Console.WriteLine("----------------------------------------------------"); Console.ReadLine(); }
/// <summary> /// Ejecución de un resultado de deudor fallecido. /// </summary> private static void EjecutarResultadoDeudorFallecido(Gestion gestion) { //gestion.Cuenta.setearEstado(Parametros.GetByClave("ESTADOCUENTA.DEUDOR-FALLECIDO")); }
/*EDITAR VERIFICACION */ // GET: Verificacions/Edit/5 public ActionResult Editv(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } List <Verificacion> verificacions = new List <Verificacion>(); List <Gestion> gestions = new List <Gestion>(); bool continuar = false; int? idv = 0; int? idcliente = 0; gestions = db.Gestion.ToList(); verificacions = db.Verificacion.ToList(); Gestion gestion = db.Gestion.Find(id); idcliente = gestion.Id_Cliente; foreach (var searchidv in verificacions) { if (searchidv.Id_Cliente == idcliente) { idv = searchidv.Id_Cliente; continuar = true; break; } } if (continuar == true) { //Linq para mostrar asesor asignado var busqueda = (from a in db.Verificacion join v in db.VendedorAsig on a.Cliente.Id_Corretaje equals v.Id_Corretaje into c from algo in c.DefaultIfEmpty() join ve in db.Vendedor on algo.Id_Vendedor equals ve.Id into ce from algoo in ce.DefaultIfEmpty() select new { a.Id, cliente = (a.Cliente.Gral_Nombre + " " + a.Cliente.Gral_Apellidopa + " " + a.Cliente.Gral_Apellidoma), idven = ((algo.Id_Vendedor != null) ? algo.Id_Vendedor : 0), vendenombre = ((algoo.Vndr_Nombre != null) ? algoo.Vndr_Nombre : null), vendeapp = ((algoo.Vndr_Apellidopa != null) ? algoo.Vndr_Apellidopa : null), vendeapm = ((algoo.Vndr_Apellidoma != null) ? algoo.Vndr_Apellidoma : " ") }).ToList(); foreach (var item in busqueda) { if (item.vendenombre != null) { if (item.Id == id) { ViewBag.Vendedor += item.vendenombre + " " + item.vendeapp + " " + item.vendeapm + "," + " "; } } } //Selectlist calificacion vendedor var calificacion = new SelectList(new[] { new { value = 0, text = "Seleccione una opción...." }, new { value = 1, text = "1" }, new { value = 2, text = "2" }, new { value = 3, text = "3" }, new { value = 4, text = "4" }, new { value = 5, text = "5" }, new { value = 6, text = "6" }, new { value = 7, text = "7" }, new { value = 8, text = "8" }, new { value = 9, text = "9" }, new { value = 10, text = "10" } }, "value", "text", 0); ViewData["Calificacion"] = calificacion; Verificacion verificacion = db.Verificacion.Find(idv); if (verificacion == null) { return(HttpNotFound()); } ViewBag.Id_Cliente = new SelectList(db.Cliente, "Id", "Gral_Nombre", verificacion.Id_Cliente); return(View(verificacion)); } else { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } }
/// <summary> /// Ejecución de un resultado de gestion agotada. /// </summary> private static void EjecutarResultadoInsolvente(Gestion gestion) { //gestion.Cuenta.setearEstado(Parametros.GetByClave("ESTADOCUENTA.INSOLVENTE")); }
public async Task <DeclaracionOutput> Execute(int anioGestion, int funcionarioID) { var gestion = await _gestionReadOnlyRepository.Get(anioGestion); if (gestion == null) { throw new ApplicationException("La gestión '" + anioGestion.ToString() + "' no existe."); } var declaracion = await _declaracionReadOnlyRepository.Get(Gestion.For(gestion.Anio, gestion.FechaInicio, gestion.FechaFinal, gestion.Vigente), funcionarioID); var funcionario = await _funcionarioReadOnlyRepository.GetByCodigo(declaracion.FuncionarioID); var depositos = new List <DepositoOutput>(); foreach (var item in declaracion.Depositos.Items) { depositos.Add(new DepositoOutput(item.ID, item.DeclaracionID, item.InstitucionFinanciera, item.TipoDeCuenta, item.Saldo)); } var deudasBancarias = new List <DeudaBancariaOutput>(); foreach (var item in declaracion.DeudasBancarias.Items) { deudasBancarias.Add(new DeudaBancariaOutput(item.ID, item.DeclaracionID, item.InstitucionFinanciera, item.Monto, item.Tipo)); } var inmuebles = new List <InmuebleOutput>(); foreach (var item in declaracion.Inmuebles.Items) { inmuebles.Add(new InmuebleOutput(item.ID, item.DeclaracionID, item.Direccion, item.TipoDeInmueble, item.PorcentajeParticipacion.Valor, item.ValorComercial, item.SaldoHipoteca, item.Banco)); } var otrosIngresos = new List <OtroIngresoOutput>(); foreach (var item in declaracion.OtrosIngresos.Items) { otrosIngresos.Add(new OtroIngresoOutput(item.ID, item.DeclaracionID, item.Concepto, item.IngresoMensual)); } var valoresNegociables = new List <ValorNegociableOutput>(); foreach (var item in declaracion.ValoresNegociables.Items) { valoresNegociables.Add(new ValorNegociableOutput(item.ID, item.DeclaracionID, item.Descripcion, item.TipoValor, item.ValorAproximado)); } var vehiculos = new List <VehiculoOutput>(); foreach (var item in declaracion.Vehiculos.Items) { vehiculos.Add(new VehiculoOutput(item.ID, item.DeclaracionID, item.Marca, item.TipoVehiculo, item.Anio, item.ValorAproximado, item.SaldoDeudor, item.Banco)); } var output = new DeclaracionOutput(declaracion, funcionario, depositos, deudasBancarias, inmuebles, otrosIngresos, valoresNegociables, vehiculos, declaracion.PatrimonioNeto, new List <string> { MENSAJE_IMPORTANTE1, MENSAJE_IMPORTANTE2 }); return(output); }
/// <summary> /// Ejecución de un resultado de deudor sin voluntad de pago. /// </summary> private static void EjecutarResultadoSinVoluntad(Gestion gestion) { //gestion.Cuenta.setearEstado(Parametros.GetByClave("ESTADOCUENTA.SIN-VOLUNTAD-DE-PAGO")); }
protected void Button1_Click(object sender, EventArgs e) { if (password.Text.Length != 0 && punchid.Text.Length != 0) { Gestion gestion = new Gestion(); String requete = "select [PunchCardID] ,[Password] FROM [holidaycontrol].[dbo].[User]"; String res = gestion.verifconnection(punchid.Text, password.Text, requete); if (res.Equals("no")) { Label1.Text = "Error on login and password"; Label1.Visible = true; } else if (res.Equals("okl")) { Label1.Text = "Error password"; Label1.Visible = true; } else if (res.Equals("okp")) { Label1.Text = "Error on login"; Label1.Visible = true; } else if (res.Equals("oklokp")) { requeteEmid = "select dmmUserID from User_Information where UserPayrollNo='" + punchid.Text + "'"; String retour = gestion.recupererValeurString(requeteEmid); requeteInfoEmp = "SELECT [Efunction] FROM Employee_status where idEmploye='" + retour + "'"; Response.Write(requeteInfoEmp); List <String> listeDroits = new List <string>(); listeDroits = gestion.getvalues(requeteInfoEmp, 1); Application.Set("adminstatus", ""); Application.Set("hrstatus", ""); Application.Set("supstatus", ""); Application.Set("empstatus", ""); foreach (String droit in listeDroits) { if (droit.Equals("ad")) { Application.Set("adminstatus", droit); } else if (droit.Equals("hr")) { Application.Set("hrstatus", droit); } else if (droit.Equals("sup")) { Application.Set("supstatus", droit); } Response.Write(droit); } Application.Set("punch", punchid.Text); requete = "select dmmUserID from User_Information where UserPayrollNo='" + punchid.Text + "'"; Gestion manage = new Gestion(); String userId = manage.recupererValeurString(requete); Application.Set("userId", userId); Response.Redirect("~/pages/EmployeeInfos.aspx"); } else { Label1.Text = "Error on login and password"; Label1.Visible = true; } } else { Label1.Text = "You have to specify Login and password please "; Label1.Visible = true; } }
/// <summary> /// Ejecución de un resultado de gestion de solicitud de contacto por /// parte del deudor. Se controla que no se supere el maximo de repet. /// consecutiva de este resultado segun el parametro MAXREPGESTIONES.SC. /// </summary> private static void EjecutarResultadoSolicitaContacto(Gestion gestion) { Parametro maxsc = Parametros.GetByClave("GESTION.MAXREPGESTIONES.SC"); for (int i = 0; i <= (maxsc.Valorlong-1); i++) { Gestion ges = gestion.Cuenta.getGestionRealizadaAnteriorSinRefresh(i); if (ges == null || !ges.Resultado.Equals(gestion.Resultado)) { if (gestion.ResultadoFecha.Date == DateTime.Today.Date) gestion.Estado = Parametros.GetByClave("ESTADOGESTION.PENDIENTE"); else gestion.Cuenta.FechaElegible = gestion.ResultadoFecha.Date; return; } } throw new DataErrorException("ERROR-RESULTADO-REPETIDO"); }
/// <summary> /// Este método inicia la gestión de una gestión (jeje). /// </summary> /// <param name="gestion"> /// La gestión a iniciarse. /// </param> private void iniciarGestion(Gestion gestion) { // primero establece la fecha de inicio de la gestion // a la fecha en que se abrió la ventana actual (para // permitir controlar el tiempo del proceso completo) gestion.FechaUMod = gestion.FechaInicio = _fechaInicioGestion; // luego inicia la gestion dependiendo del tipo(puede // ser que abra directamente el ABM de gestion, o que // primero obligue a imprimir una carta o formulario) if (gestion.Tipo.Equals(_tgadmin) || gestion.Tipo.Equals(_tgtelef) || gestion.Tipo.Equals(_tgbackof)) CUCaller.CallCU("cuAbmGestion", this, new object[] {EModoVentana.EDIT, gestion}); else if (gestion.Tipo.Equals(_tgpostal) || gestion.Tipo.Equals(_tgterren)) if (gestion.Estado.Equals(_creada) || gestion.Estado.Equals(_asignada)) { gestion.Estado = _enproceso; CUCaller.CallCU("cuGenerarInformes.CUGenerarCarta", this, new object[] {EModoVentana.VIEW, gestion}); } else CUCaller.CallCU("cuAbmGestion", this, new object[] {EModoVentana.EDIT, gestion}); }
public frmTerminacionGestiones(Gestion gestion, bool supervisor) { InitializeComponent(); _gestion = gestion; try { // Cargar los datos this.cargarDatos(); btnGuardar.Enabled = supervisor; cboCausa.Enabled = supervisor; cboCausante.Enabled = supervisor; txtComentarioCausa.Enabled = supervisor; cboCausante.SelectedIndex = (byte)_gestion.Causa.Causante; cboCausa.Text = _gestion.Causa.Descripcion; cboClasificacion.SelectedIndex = (byte)_gestion.Clasificacion; txtComentarioCausa.Text = _gestion.Comentario_causa; string colaborador = _gestion.Colaborador == null ? string.Empty : _gestion.Colaborador.ToString(); string transportadora = _gestion.Transportadora == null ? string.Empty : _gestion.Transportadora.Nombre; switch (_gestion.Causa.Causante) { case Causantes.Cajero: lblCajero.Visible = true; cboCajero.Text = colaborador; cboCajero.Enabled = supervisor; break; case Causantes.Digitador: lblDigitador.Visible = true; cboDigitador.Text = colaborador; cboDigitador.Enabled = supervisor; break; case Causantes.Coordinador: lblCoordinador.Visible = true; cboCoordinador.Text = colaborador; cboCoordinador.Enabled = supervisor; break; case Causantes.Receptor: lblReceptor.Visible = true; cboReceptor.Text = colaborador; cboReceptor.Enabled = supervisor; break; case Causantes.Transportadora: lblEmpresa.Visible = true; cboEmpresa.Text = transportadora; cboEmpresa.Enabled = supervisor; break; } } catch (Exception ex) { throw ex; } }