Пример #1
0
 public String ActualizarCola(Expediente expedienteModificado)
 {
     try
     {
         string rutaCola = @".\private$\evaluacionXhora";
         if (!MessageQueue.Exists(rutaCola))
             MessageQueue.Create(rutaCola);
         MessageQueue cola = new MessageQueue(rutaCola);
         Message mensaje = new Message();
         mensaje.Label = "Expediente actualizado";
         mensaje.Body = new Expediente()
         {
             codigo = expedienteModificado.codigo,
             codigoSolicitante = expedienteModificado.codigoSolicitante,
             codigoTramite = expedienteModificado.codigoTramite,
             Estado = expedienteModificado.Estado
         };
         cola.Send(mensaje);
         return "Se registro la actualización del expediente.";
     }
     catch (Exception)
     {
         return "Hubo un error al registrar la actualizacion del expediente.";
     }
 }
Пример #2
0
 public Expediente AgregarExpediente(Expediente pExpediente, ref String mensaje)
 {
     try
     {
         bool resultado = cliente.AgregarExpediente(ref pExpediente);
         mensaje = "Expediente registrado.";
         return pExpediente;
     }
     catch (Exception ex)
     {
         mensaje = ex.Message;
         return null;
     }
 }
 public void Evaluar(int estado)
 {
     //conectamos la capa de negocio (STDNegocio)
     Expediente eExpediente = new Expediente();
     ExpedienteNeg expedienteNegocio = new ExpedienteNeg();
     EvaluacionNeg evaluacionNegocio = new EvaluacionNeg();
     String mensaje = "";
     int codigoExp = Convert.ToInt32(hdCodigo.Value);
     //Obtenemos la informacion del expediente en base al codigo seleccionado
     eExpediente = expedienteNegocio.ObtenerExpediente(codigoExp, ref mensaje);
     //modificamos el estado del expediente
     eExpediente.Estado = estado;
     //recuperamos el mensaje
     mensaje = evaluacionNegocio.ActualizarCola(eExpediente);
     lblError.Text = mensaje;
     trOpcion.Visible = false;
     trPregunta.Visible = false;
 }
Пример #4
0
 public bool Agregar(ref Expediente pExpediente)
 {
     try
     {
         using (BDDOCUMENTUMEntities datos = new BaseDAO().conexion())
         {
             datos.Expedientes.AddObject(pExpediente);
             var vResult = datos.SaveChanges();
             if (vResult > 0)
                 return true;
             else
                 return false;
         }
     }
     catch (Exception)
     {
         throw new Exception("Ocurrio un error al registrar el expediente.");
     }
 }
Пример #5
0
 public bool Actualizar(ref Expediente pExpediente)
 {
     try
     {
         using (BDDOCUMENTUMEntities datos = new BaseDAO().conexion())
         {
             datos.Expedientes.Attach(pExpediente);
             datos.ObjectStateManager.ChangeObjectState(pExpediente, System.Data.EntityState.Modified);
             var vResult = datos.SaveChanges();
             if (vResult > 0)
                 return true;
             else
                 throw new Exception("No existe el registro Expediente para modificar.");
         }
     }
     catch (Exception)
     {
         throw new Exception("Ocurrio un error al actualizar el expediente.");
     }
 }
Пример #6
0
        private void FixupExpediente(Expediente previousValue)
        {
            if (previousValue != null && previousValue.Cargoes.Contains(this))
            {
                previousValue.Cargoes.Remove(this);
            }

            if (Expediente != null)
            {
                if (!Expediente.Cargoes.Contains(this))
                {
                    Expediente.Cargoes.Add(this);
                }
                if (codigoExpediente != Expediente.codigo)
                {
                    codigoExpediente = Expediente.codigo;
                }
            }
            else if (!_settingFK)
            {
                codigoExpediente = null;
            }
        }