/// <summary> /// Autor: jlucero /// Fecha: 2015-06-15 /// </summary> /// <param name="oRq"></param> /// <returns></returns> public Observacion DAuditoria(Request_CRUD_Observacion oRq) { try { Observacion oBj = new Observacion(); using (IDataReader oDr = DatabaseFactory.CreateDatabase().ExecuteReader("dsige_observacion", oRq.obs_id, 0, "", "", 0, 0, 0, 4)) { if (oDr != null) { while (oDr.Read()) { oBj.crea_id = Convert.ToInt32(oDr["obs_crea"]); oBj.crea_nombre = Convert.ToString(oDr["obs_crea_nombre"]); oBj.crea_fecha = Convert.ToString(oDr["obs_crea_fecha"]); oBj.modifica_id = Convert.ToInt32(oDr["obs_modifica"]); oBj.modifica_nombre = Convert.ToString(oDr["obs_modifica_nombre"]); oBj.modifica_fecha = Convert.ToString(oDr["obs_modifica_fecha"]); } } } return(oBj); } catch (Exception e) { throw e; } }
/// <summary> /// Autor: jlucero /// Fecha: 2015-06-15 /// </summary> /// <param name="oRq"></param> /// <returns></returns> public Observacion DObjeto(Request_CRUD_Observacion oRq) { try { Observacion oBj = new Observacion(); using (IDataReader oDr = DatabaseFactory.CreateDatabase().ExecuteReader("dsige_observacion", oRq.obs_id, 0, "", "", 0, 0, 0, 5, oRq.obs_pideFoto, oRq.obs_noPideFoto)) { if (oDr != null) { while (oDr.Read()) { oBj.obs_id = Convert.ToInt32(oDr["obs_id"]); oBj.emp_id = Convert.ToInt32(oDr["emp_id"]); oBj.obs_abreviatura = Convert.ToString(oDr["obs_abreviatura"]); oBj.obs_descripcion = Convert.ToString(oDr["obs_descripcion"]); oBj.gde_id = Convert.ToInt32(oDr["gde_id"]); oBj.obs_estado = Convert.ToInt32(oDr["obs_estado"]); oBj.obs_pideFoto = Convert.ToString(oDr["PideFoto"]); oBj.obs_noPideFoto = Convert.ToString(oDr["NoPideFoto"]); } } } return(oBj); } catch (Exception e) { throw e; } }
public IHttpActionResult EstadoCumple(Observacion observacion) { SolicitudService con = new SolicitudService(); con.EstadoCumple(observacion); return(Ok()); }
public void GetList() { try { HttpWebRequest request = (HttpWebRequest)WebRequest .Create("http://localhost:1921/Medicos.svc/Medicos"); request.Method = "GET"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string tramaJson = reader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); List <Medico> MedicoLista = js.Deserialize <List <Medico> >(tramaJson); Assert.IsTrue(MedicoLista.Count > 0); } catch (WebException e) { HttpStatusCode code = ((HttpWebResponse)e.Response).StatusCode; string message = ((HttpWebResponse)e.Response).StatusDescription; StreamReader reader = new StreamReader(e.Response.GetResponseStream()); string error = reader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); Observacion Observacion = js.Deserialize <Observacion>(error); Assert.AreEqual("La lista no devolvió datos.", Observacion.MensajeError); } }
public Observacion Obtener(string nombre) { Observacion a = null; SqlCommand cmd = new SqlCommand("dbo.usp_ObtenerObservacionPorNombre", this.Conexion); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@nombre", SqlDbType.VarChar, 100)).Value = nombre; try { Conexion.Open(); SqlDataReader sdr = cmd.ExecuteReader(CommandBehavior.CloseConnection); if (sdr.Read()) { a = new Observacion(); a.Id = Convert.ToInt32(sdr["id"]); a.Nombre = sdr["nombre"].ToString(); } sdr.Close(); return(a); } catch { throw; } finally { if (Conexion.State == ConnectionState.Open) { Conexion.Close(); } } }
/// <summary> /// Create object on the repository /// </summary> /// <param name="obs_vo"></param> /// <param name="user_log"></param> /// <returns></returns> public TransactionResult createObservacion(ObservacionVo obs_vo, User user_log) { Observacion obs = ObservacionAdapter.voToObject(obs_vo); obs.user = user_log; return(caja_repository.createObservacion(obs)); }
private void cmbCliente_SelectedIndexChanged(object sender, EventArgs e) { int i = cmbCliente.SelectedIndex; if (i >= 0) //Esto verifica que se ha seleccionado algún item del comboBox { observacion = new Observacion(); int idCliente = Convert.ToInt32(tablaCliente.Rows[i]["idCliente"].ToString()); txtNroDocumento.Text = tablaCliente.Rows[i]["nroDocumento"].ToString(); tablaUsuario = clienteDA.ListarKamEncargado(idCliente); cmbKamEncargado.DataSource = tablaUsuario; cmbKamEncargado.DisplayMember = "nombre"; cmbKamEncargado.ValueMember = "idUsuario"; observacion.IdCliente = idCliente; txtObservacionDeuda.Text = ""; txtObservacionLevantamiento.Text = ""; txtNroObservacion.Text = ""; } else { txtNroDocumento.Text = ""; } }
public JsonResult GuardarObservacion(Guid idRegistro, string clase, string atributo, string textoObservacion) { try { var obser = new Observacion() { Estado = (int)EstadoObservacion.Agregado, FechaObservacion = DateTime.Now, IdRegistro = idRegistro, IdUsuario = SesionUsuario.Usuario.Id, TextoObservacion = textoObservacion }; if (!string.IsNullOrEmpty(atributo)) { var atributoObj = _db.Atributos.SingleOrDefault(x => x.Nombre.Equals(atributo) && x.Clase.Nombre.Equals(clase)); obser.IdAtributo = atributoObj.Id; } else { var objClase = _db.Clases.SingleOrDefault(x => x.Nombre.Equals(clase)); obser.IdClase = objClase.Id; } _db.Observaciones.AddObject(obser); _db.SaveChanges(); return(Json(new { Correcto = true })); } catch (Exception ex) { Utilidades.ColocarMensaje(ex, Request); return(Json(new { Correcto = false, Mensaje = Utilidades.ObtenerMensajeExcepcion(ex) })); } }
public void EstadoCumple(Observacion observacion) { System.Data.SqlClient.SqlConnection conn; SqlCommand command; var conString = System.Configuration. ConfigurationManager.ConnectionStrings["HorasBecaAPI"]; string strConnString = conString.ConnectionString; conn = new SqlConnection(strConnString); conn.Open(); SqlParameter idsolicitud = new SqlParameter("@IS", System.Data.SqlDbType.Int); idsolicitud.Value = observacion.IdSolicitud; SqlParameter descripcion = new SqlParameter("@O", System.Data.SqlDbType.VarChar); descripcion.Value = observacion.Descripcion; command = new SqlCommand("EXEC EstadoSolicitudCumple @IdSolicitud=@IS, @Observacion=@O ", conn); command.Parameters.Add(idsolicitud); command.Parameters.Add(descripcion); command.ExecuteNonQuery(); conn.Close(); }
public int AnularLevantamiento(Observacion observacion, string usuario) { bool error = false; parametrosEntrada = new MySqlParameter[6]; parametrosEntrada[0] = new MySqlParameter("@_guiaLevantamiento", MySqlDbType.VarChar, 80); parametrosEntrada[1] = new MySqlParameter("@_observacionLevantamiento", MySqlDbType.VarChar, 1000); parametrosEntrada[2] = new MySqlParameter("@_fechaLevantamiento", MySqlDbType.DateTime); parametrosEntrada[3] = new MySqlParameter("@_estado", MySqlDbType.Int32); parametrosEntrada[4] = new MySqlParameter("@_usuario_mod", MySqlDbType.VarChar, 100); parametrosEntrada[5] = new MySqlParameter("@_idObservacionDeudas", MySqlDbType.Int32); parametrosEntrada[0].Value = ""; parametrosEntrada[1].Value = ""; parametrosEntrada[2].Value = null; parametrosEntrada[3].Value = observacion.IdEstado; parametrosEntrada[4].Value = usuario; parametrosEntrada[5].Value = observacion.IdObervacion; bool okey = objManager.EjecutarProcedure(parametrosEntrada, "update_observacion"); if (!okey) { return(0); } return(1); }
public async Task <IHttpActionResult> PostObservacion(Observacion observacion) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Observacions.Add(observacion); try { await db.SaveChangesAsync(); } catch (Exception ex) { if (ex.InnerException != null && ex.InnerException.InnerException != null && ex.InnerException.InnerException.Message.Contains("Unique")) { return(BadRequest("Hay un registro con la misma descripción.")); } else { return(BadRequest(ex.Message)); } } return(CreatedAtRoute("DefaultApi", new { id = observacion.IdObservacion }, observacion)); }
public Observacion LlamarObservacionModificable(int idObservacion) { Observacion observacion = new Observacion(); MySqlDataReader reader; string sql = ""; sql = "Select * From vista_lista_observaciones where IdObservacion=" + idObservacion + " ;"; reader = objManager.MostrarInformacion(sql); while (reader.Read()) { observacion.IdObervacion = reader.GetInt32("IdObservacion"); observacion.IdCliente = reader.GetInt32("IdCliente"); observacion.Cliente = reader.GetString("Cliente"); observacion.RUC = reader.GetString("RUC"); observacion.IdLC = reader.GetInt32("IdLC"); observacion.CodigoLC = reader.GetString("CodigoLC"); observacion.IdDevolucion = reader.GetInt32("IdDevolucion"); observacion.IdCambio = reader.GetInt32("IdCambio"); observacion.ObservacionDeuda = reader.GetString("ObservacionDeuda"); observacion.GuiaLevantamiento = reader.GetString("GuiaLevantamiento"); observacion.ObservacionLevantamiento = reader.GetString("ObservacionLevantamiento"); observacion.FechaLevantamiento = reader.GetDateTime("FechaLevantamiento"); observacion.IdEstado = reader.GetInt32("IdEstado"); observacion.Estado = reader.GetString("Estado"); } objManager.conexion.Close(); objManager.conexion.Dispose(); objManager.cmd.Dispose(); return(observacion); }
//public List<Observacion> GetObservaciones() //{ // List<Observacion> observaciones = new List<Observacion>(); // observaciones.Add(new Observacion(1, new DateTime(2013, 09, 06), "Fines CENS", "Mariano", "MDS", "Cursada", "Mariano", "Entre los alumnos agarraron al profesor para golpearle la cabeza", "Los echamos a todos", new DateTime(2013, 09, 15), "Elena")); // observaciones.Add(new Observacion(2, new DateTime(2013, 09, 06), "Fines Puro", "Leonardo", "MDS", "Cursada", "Mariano", "Necesito los certificados de los días que faltó a cursar", "MARIANO, por favor pedile los certificados y avisales a todos los de acá que cada vez que faltan a cursar justifiquen", new DateTime(2013, 09, 15), "Elena")); // observaciones.Add(new Observacion(3, new DateTime(2013, 09, 06), "Fines Puro", "Cholo", "MDS", "Libre", "Mariano", "Esta por quedar libre", "Se lo llamo para motivarlo a venir y terminar el ciclo", new DateTime(2013, 09, 15), "Elena")); // observaciones.Add(new Observacion(4, new DateTime(2013, 09, 06), "Fines CENS", "Stefania", "MDS", "Expulsion", "Mariano", "Saco un arma en clase y amenazo con matar a todos", "Llamamos a la policia y se lo llevaron a comer una pizza para calmarlo", new DateTime(2013, 09, 15), "Elena")); // return observaciones; //} //public List<Observacion> GetObservaciones() //{ // return this.cache.Ejecutar(GetObservacionesDesdeLaBase, this); //} public List <Observacion> GetObservaciones() { var tablaDatos = conexion.Ejecutar("dbo.SACC_Get_Observaciones"); var observaciones = new List <Observacion>(); tablaDatos.Rows.ForEach(row => { Observacion observacion = new Observacion ( row.GetInt("id"), row.GetObject("FechaCarga") is DBNull ? new DateTime(DateTime.Now.Year, 1, 1) : row.GetDateTime("FechaCarga"), row.GetString("Relacion"), row.GetString("PersonaCarga"), row.GetString("Pertenece"), row.GetString("Asunto"), row.GetString("ReferenteMDS"), row.GetString("Seguimiento"), row.GetString("Resultado"), row.GetObject("FechaDelResultado") is DBNull ? new DateTime(DateTime.Now.Year, 1, 1) : row.GetDateTime("FechaDelResultado"), row.GetString("ReferenteRtaMDS")); //observacion.Id = row.GetInt("id"); //row.GetString("idBaja")); observaciones.Add(observacion); }); //observaciones.Sort((curso1, curso2) => curso1.esMayorAlfabeticamenteQue(curso2)); return(observaciones); }
public ActionResult Actualizar(ObservacionView ObservacionView) { try { string id = Request.Form["txtId"]; string nombreObservacion = Request.Form["txtNombreObservacion"]; Observacion a = new Observacion(); a.Id = int.Parse(id); a.Nombre = nombreObservacion; ObservacionRepository pr = new ObservacionRepository(); a = pr.Actualizar(a); if (a.Id == 0) { ObservacionView.Mensaje = "Hubo un error al crear la Observacion"; return(View("Crear", ObservacionView)); } ObservacionView pp = new ObservacionView(); pp.Mensaje = "Observacion Actualizada"; pp.Observacion = a; return(View("Obtener", pp)); } catch (Exception ex) { return(View("Mensaje", new ObservacionView { Mensaje = ex.Message })); } }
public async Task <IHttpActionResult> PutObservacion(int id, Observacion observacion) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != observacion.IdObservacion) { return(BadRequest()); } db.Entry(observacion).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (Exception ex) { if (ex.InnerException != null && ex.InnerException.InnerException != null && ex.InnerException.InnerException.Message.Contains("Unique")) { return(BadRequest("Hay un registro con la misma descripción.")); } else { return(BadRequest(ex.Message)); } } return(Ok(observacion)); }
public void Inicializado() { clienteDA = new ClienteDA(); usuarioDA = new UsuarioDA(); observacionDA = new ObservacionDA(); observacion = new Observacion(); dtpFechaIngreso.Value = DateTime.Now; tablaCliente = clienteDA.ListarClientes(); cmbCliente.DataSource = tablaCliente; cmbCliente.DisplayMember = "nombre_razonSocial"; cmbCliente.ValueMember = "idCliente"; cmbCliente.SelectedIndex = 0; int i = cmbCliente.SelectedIndex; int idCliente = Convert.ToInt32(tablaCliente.Rows[i]["idCliente"].ToString()); txtNroDocumento.Text = tablaCliente.Rows[i]["nroDocumento"].ToString(); //!OBTENER KAM ENCARGADO tablaUsuario = clienteDA.ListarKamEncargado(idCliente); cmbKamEncargado.DataSource = tablaUsuario; cmbKamEncargado.DisplayMember = "nombre"; cmbKamEncargado.ValueMember = "idUsuario"; ObtenerDatosObservacion(); }
public void Delete() { try { HttpWebRequest request1 = (HttpWebRequest)WebRequest .Create("http://localhost:1921/Medicos.svc/Medicos/2"); request1.Method = "DELETE"; HttpWebResponse response1 = (HttpWebResponse)request1.GetResponse(); StreamReader reader1 = new StreamReader(response1.GetResponseStream()); string tramaJson1 = reader1.ReadToEnd(); JavaScriptSerializer js1 = new JavaScriptSerializer(); HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://localhost:1921/Medicos.svc/Medicos/2"); req.Method = "GET"; req.ContentType = "application/json"; var res = (HttpWebResponse)req.GetResponse(); StreamReader reader = new StreamReader(res.GetResponseStream()); string MedicoJson = reader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); Medico MedicoCreado = js.Deserialize <Medico>(MedicoJson); Assert.AreEqual(null, MedicoCreado); } catch (WebException e) { HttpStatusCode code = ((HttpWebResponse)e.Response).StatusCode; string message = ((HttpWebResponse)e.Response).StatusDescription; StreamReader reader = new StreamReader(e.Response.GetResponseStream()); string error = reader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); Observacion Observacion = js.Deserialize <Observacion>(error); Assert.AreEqual("El Medico a eliminar no se encuentra registrado.", Observacion.MensajeError); } }
//GET public ActionResult EditObs(int idObservacion) { Observacion obs = db.Observacion.Find(idObservacion); ViewBag.idRevision = obs.idRevision; return(View("CreateEditObs", obs)); }
public void GetListXEsp() { try { string postdata = "{\"Especialidad\":2}";//JSON byte[] data = Encoding.UTF8.GetBytes(postdata); HttpWebRequest req = (HttpWebRequest)WebRequest .Create("http://localhost:1921/Medicos.svc/Medicos"); req.Method = "POST"; req.ContentLength = data.Length; req.ContentType = "application/json"; var reqStream = req.GetRequestStream(); reqStream.Write(data, 0, data.Length); HttpWebResponse response = (HttpWebResponse)req.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string tramaJson = reader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); List <Medico> MedicoLista = js.Deserialize <List <Medico> >(tramaJson); Assert.IsTrue(MedicoLista.Count > 0); } catch (WebException e) { HttpStatusCode code = ((HttpWebResponse)e.Response).StatusCode; string message = ((HttpWebResponse)e.Response).StatusDescription; StreamReader reader = new StreamReader(e.Response.GetResponseStream()); string error = reader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); Observacion Observacion = js.Deserialize <Observacion>(error); Assert.AreEqual("La lista no devolvió datos.", Observacion.MensajeError); } }
public Observacion Actualizar(Observacion a) { string procedure = a.Id == 0 ? "dbo.usp_CrearObservacion" : "dbo.usp_ActualizarObservacion"; SqlCommand cmd = new SqlCommand(procedure, this.Conexion); cmd.CommandType = CommandType.StoredProcedure; if (a.Id > 0) { cmd.Parameters.Add(new SqlParameter("@id", SqlDbType.Int)).Value = a.Id; } cmd.Parameters.Add(new SqlParameter("@nombre", SqlDbType.VarChar, 100)).Value = a.Nombre; try { Conexion.Open(); int id = Convert.ToInt32(cmd.ExecuteScalar()); a.Id = id; return(a); } catch { throw; } finally { if (Conexion.State == ConnectionState.Open) { Conexion.Close(); } } }
public async Task <IHttpActionResult> DeleteObservacion(int id) { Observacion observacion = await db.Observacions.FindAsync(id); if (observacion == null) { return(NotFound()); } db.Observacions.Remove(observacion); try { await db.SaveChangesAsync(); } catch (Exception ex) { if (ex.InnerException != null && ex.InnerException.InnerException != null && ex.InnerException.InnerException.Message.Contains("REFERENCE")) { return(BadRequest("No puede eliminar este registro, porque tiene un registro relacionado.")); } else { return(BadRequest(ex.Message)); } } return(Ok(observacion)); }
public void Add(Observacion observation) { IsRefreshing = true; observations.Add(observation); Observations = new ObservableCollection <Observacion>( observations.OrderBy(c => c.Descripcion)); IsRefreshing = false; }
public ActionResult DeleteConfirmed(int id) { Observacion observacion = db.Observacions.Find(id); db.Observacions.Remove(observacion); db.SaveChanges(); return(RedirectToAction("Index")); }
public Coordinacion(int id, Observacion observacion, string fecha, Hora hora, int estado) { this.Id = id; this.Observacion = observacion; this.Fecha = fecha; this.HoraInicio = hora; this.Estado = estado; }
public void DeleteObservacion(Observacion observacion) { if (observacion == null) { throw new ArgumentNullException(nameof(observacion)); } _context.Observaciones.Remove(observacion); }
private void btnCancelar_Click(object sender, EventArgs e) { if (MessageBox.Show("Estas seguro que deseas cancelar el proceso", "◄ AVISO | LEASEIN S.A.C. ►", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { estadoComponentes(TipoVista.Limpiar); observacion = new Observacion(); } }
// GET: Observacion/Edit/5 public ActionResult Edit(int Id) { Observacion observacion = this.db.Observacion.Find(Id); this.ViewBag.Paciente = this.db.Paciente.Find(observacion.Id_Paciente); this.ViewBag.Medicos = this.db.Medico.OrderBy(m => m.Apellido).ToList(); return(View(observacion)); }
public IActionResult Update(Observacion entidad) { //Instancia la entidad servicio.Actualizar(entidad); //Regresa la ruta de la entidad creada de acuerdo al key {Id o Codigo} return(CreatedAtRoute(nameof(Search), new { codigo = entidad.Codigo }, entidad)); }
// GET: Observacion/Create public ActionResult Create(int idPaciente) { Observacion observacion = new Observacion(); observacion.Id_Paciente = idPaciente; this.ViewBag.Paciente = db.Paciente.Find(idPaciente); this.ViewBag.Medicos = db.Medico.OrderBy(m => m.Apellido).ToList(); return(View(observacion)); }
public async Task AddObservacion(Observacion observacion) { if (observacion == null) { throw new ArgumentNullException(nameof(observacion)); } await _context.Observaciones.AddAsync(observacion); }
public List<Observacion> Obtener(ClsFEXGetCMPR comprobanteAfip, FexCabecera cabFex) { List<string> diferencias = new List<string>(); if ( comprobanteAfip.Fecha_cbte != cabFex.FechaComprobante ) { diferencias.Add("La fecha no es la correcta."); diferencias.Add("Afip: " + comprobanteAfip.Fecha_cbte + " Enviado :" + cabFex.FechaComprobante); } if ( comprobanteAfip.Cbte_nro != cabFex.ComprobanteNumero ) { diferencias.Add("El número no es el correcto."); diferencias.Add("Afip: " + comprobanteAfip.Cbte_nro + " Enviado :" + cabFex.ComprobanteNumero); } if ( comprobanteAfip.Incoterms != cabFex.ClausulaDeVenta ) { diferencias.Add("El incoterms no es el correcto."); diferencias.Add("Afip: " + comprobanteAfip.Incoterms + " Enviado :" + cabFex.ClausulaDeVenta); } if (comprobanteAfip.Cuit_pais_cliente != cabFex.CuitPaisCliente) { diferencias.Add("El C.U.I.T. no es el correcto."); diferencias.Add("Afip: " + comprobanteAfip.Cuit_pais_cliente + " Enviado :" + cabFex.CuitPaisCliente); } if (comprobanteAfip.Imp_total != cabFex.ImporteTotal) { diferencias.Add("El total no es correcto."); diferencias.Add("Afip: " + comprobanteAfip.Imp_total.ToString(CultureInfo.InvariantCulture.NumberFormat) + " Enviado :" + cabFex.ImporteTotal.ToString(CultureInfo.InvariantCulture.NumberFormat)); } List<Observacion> observaciones = new List<Observacion>(); Observacion observacion; for (int i = 0; i < diferencias.Count; i++) { observacion = new Observacion(); observacion.Mensaje = diferencias[i]; observaciones.Add( observacion ); } return observaciones; }