private bool verificaSolicitante(STDDatos.Solicitante pSolicitante, ref String mensaje) { if (pSolicitante.nombre.Equals("")) { mensaje = "Tiene que ingresar el nombre del solicitante."; return false; } if (pSolicitante.apellido.Equals("")) { mensaje = "Tiene que ingresar el apellido del solicitante."; return false; } if (pSolicitante.dni.Equals("")) { mensaje = "Tiene que ingresar el DNI del solicitante."; return false; } if (!verificaValor(pSolicitante.telefono)) { mensaje = "Tiene que ingresar un número de Teléfono válido."; return false; } if (!pSolicitante.correo.Equals("") && (!pSolicitante.correo.Contains(@"@") || !pSolicitante.correo.Contains(@".com"))) { mensaje = "Tiene que ingresar el correo válido."; return false; } mensaje = ""; return true; }
public bool AgregarCargo(ref STDDatos.Cargo pCargo) { try { return new STDDatos.CargoBl().Agregar(ref pCargo); } catch (Exception ex) { throw new FaultException(ex.Message); } }
public bool AgregarExpediente(ref STDDatos.Expediente pExpediente) { try { return new STDDatos.ExpedienteBl().Agregar(ref pExpediente); } catch (Exception ex) { throw new FaultException(ex.Message); } }
private bool verificaUsuario(STDDatos.Usuario pUsuario, ref String mensaje) { if (pUsuario.DNI.Equals("")) { mensaje = "Tiene que ingresar el DNI del solicitante."; return false; } if (pUsuario.Nombre.Equals("")) { mensaje = "Tiene que ingresar el nombre del solicitante."; return false; } mensaje = ""; return true; }
public String Actualizar(STDDatos.Evaluacion expedienteModificado) { String mensaje = ""; try { bool resultado = new STDDatos.EvaluacionBL().Actualizar(expedienteModificado); if (!resultado) { return "Ocurrio un error al momento de actualizar el expediente."; } return mensaje; } catch (Exception ex) { throw new FaultException(ex.Message); } }
public bool AgregarSolicitante(ref STDDatos.Solicitante pSolicitante) { String mensaje = ""; try { bool validacion = verificaSolicitante(pSolicitante, ref mensaje); if (validacion) { return new STDDatos.SolicitanteBl().Agregar(ref pSolicitante); } else { throw new FaultException(mensaje); } } catch (Exception ex) { throw new FaultException(ex.Message); } }
public STDDatos.Expediente Actualizar(STDDatos.Expediente expedienteModificado) { string mensaje = ""; try { bool respuesta = new STDDatos.ExpedienteBl().Actualizar(ref expedienteModificado); if (respuesta) { return expedienteModificado; } else { mensaje = "No se actualizó el expediente."; throw new FaultException(mensaje); } } catch (Exception ex) { throw new FaultException(mensaje); } }
public bool AgregarUsuario(STDDatos.Usuario pUsuario) { string mensaje = ""; try { //bool validacion = verificaUsuario(pUsuario, ref mensaje); //if (validacion) //{ return new STDDatos.UsuarioBL().Agregar(ref pUsuario); //} //else //{ // throw new WebFaultException<string>(mensaje, HttpStatusCode.InternalServerError); //} } catch (Exception) { mensaje = "Usuario no fue creado."; throw new WebFaultException<string>(mensaje, HttpStatusCode.InternalServerError); } }