public override List <EntidadeDominio> consultar(EntidadeDominio entidade) { try { if (connection.State == ConnectionState.Closed) { connection.Open(); } pst.Dispose(); Motivo Classe = (Motivo)entidade; string sql = null; if (Classe.Nome == null) { Classe.Nome = ""; } if (Classe.Dep.ID == 0) { sql = "SELECT * FROM motivo "; } else { sql = "SELECT * FROM motivo join dep_mot using(id_mot) WHERE id_dep = :co"; } pst = new NpgsqlCommand(); pst.CommandText = sql; parameters = new NpgsqlParameter[] { new NpgsqlParameter("co", Classe.Dep.ID) }; pst.Parameters.Clear(); pst.Parameters.AddRange(parameters); pst.Connection = connection; pst.CommandType = CommandType.Text; //pst.ExecuteNonQuery(); vai = pst.ExecuteReader(); List <EntidadeDominio> Classes = new List <EntidadeDominio>(); Motivo p; while (vai.Read()) { p = new Motivo(); p.ID = Convert.ToInt32(vai["id_mot"]); p.Nome = (vai["nome"].ToString()); if (Classe.Dep.ID != 0) { p.Dep.ID = Convert.ToInt32(vai["id_dep"]); } Classes.Add(p); } vai.Close(); connection.Close(); return(Classes); } catch (NpgsqlException ora) { vai.Close(); connection.Close(); throw ora; } }
public void DesativarMotivo(Motivo motivo) { if (AtualizarMotivo(motivo)) { Validacao.Add(Mensagem.Tramitacao.MotivoDesativado); } }
public void Procesar() { if (Motivo.Trim() != "") { _procesarIsOk = true; } }
public void Procesar() { if (Motivo.Trim() != "") { IsAnularOK = true; } }
public async Task <IActionResult> Edit(int id, Motivo Motivo) { if (id != Motivo.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(Motivo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MotivoExists(Motivo.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(Motivo)); }
public async Task <IActionResult> PutMotivo(int id, Motivo motivo) { if (id != motivo.IdMotivo) { return(BadRequest()); } _context.Entry(motivo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MotivoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public bool Verificar() { var rt = true; if (AutorizadoPor.Trim() == "") { Helpers.Msg.Error("Campo [ Autorizado ] Falta Por LLenar"); return(false); } if (Motivo.Trim() == "") { Helpers.Msg.Error("Campo [ Motivo ] Falta Por LLenar"); return(false); } if (detalle.ListaItems.Count == 0) { Helpers.Msg.Error("No Hay Items En El Documento "); return(false); } if (detalle.ListaItems.Count(c => c.Importe == 0.0m) > 0) { Helpers.Msg.Error("Hay Items En El Documento Con Importe En Cero (0)"); return(false); } return(rt); }
public ActionResult Create(Motivo a) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new ReservacionesEntities()) { //Auditoria(Cedula, "Usuario", "AGREGO UN USUARIO"); db.Motivoes.Add(a); var K = db.Usuarios.Single(u => u.Estado == "1"); if (K != null) { Auditoria(K.Cedula, "Motivo", "CREO UNA MOTIVO"); } db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("Error al agregar una Escuela", ex); return(View()); } }
public Boolean guardar(clsMotivo ctm, ref string Mensaje) { try { using (INVENTARIOEntities te = new INVENTARIOEntities()) { Motivo tm = new Motivo(); tm.IdEmpresa = Convert.ToInt32(ctm.empresa); tm.IdMotivo = Convert.ToInt32(ctm.codigo); tm.Descripcion = Convert.ToString(ctm.descripcion); tm.IdEstado = Convert.ToInt32(ctm.estado); te.AddToMotivo(tm); te.SaveChanges(); } return(true); } catch (Exception e) { Mensaje = "ERROR" + e.InnerException + e.Message; //System.Windows.Forms.MessageBox.Show("error al guardar" + e); return(false); } }
public async Task <ActionResult <Motivo> > PostMotivo(Motivo motivo) { _context.Motivo.Add(motivo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMotivo", new { id = motivo.IdMotivo }, motivo)); }
public ActionResult Edit(Motivo a) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new ReservacionesEntities()) { Motivo al = db.Motivoes.Find(a.Id); al.Nombre = a.Nombre; var K = db.Usuarios.Single(u => u.Estado == "1"); if (K != null) { Auditoria(K.Cedula, "Motivo", "EDITO UN MOTIVO"); } db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("Error al Editar el motivo", ex); return(View()); } }
private void Modificar_Load(object sender, EventArgs e) { int index = Motivo.FindString(Clases.Variables.BienesBMotivoBaja); Motivo.SelectedIndex = index; Valor.Text = Clases.Variables.BienesBValor; Observaciones.Text = Clases.Variables.BienesBObservacion; }
public ActionResult DeleteConfirmed(int id) { Motivo motivo = db.Motivoes.Find(id); db.Motivoes.Remove(motivo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(int?id) { var context = HttpContext.RequestServices.GetService(typeof(inventarioContext)) as inventarioContext; Motivo personalDetail = context.Motivo.Find(id); return(View(personalDetail)); }
//public MotivoModel(MotivoModel obj) : base(obj) { } public static new MotivoModel Create(Motivo obj) { if (obj == null) { return(null); } return(new MotivoModel(obj) as MotivoModel); }
private Dialogo CrearDialogo(string _nombre, IList <LineData> _lineas) { LineaDialogo[] bufferLineas = new LineaDialogo[_lineas.Count]; IList <LineaDialogo> iniciales = new List <LineaDialogo>(); string introduccion; IDictionary <int, IList <LineaDialogo> > indiceOpciones = new Dictionary <int, IList <LineaDialogo> >(); introduccion = _lineas[0].Introduccion; for (int c = 0; c < _lineas.Count; c++) { var linea = _lineas[c]; Motivo motivo = null; if (linea.EsMotivo) { motivo = new Motivo(linea.Respuesta, linea.EsMotivoVerdadero, linea.MotivoEnSelector, linea.MotivoEnHipotesis); } if (!indiceOpciones.Keys.Contains(linea.Opcion)) { indiceOpciones.Add(linea.Opcion, new List <LineaDialogo>()); } var ld = new LineaDialogo(linea.Opcion, linea.Pregunta, linea.Respuesta, linea.VisibilizaNombre, linea.SospechososEncontrados, linea.PistasEncontradas, false, motivo, linea.Audios, linea.AudioIntro); bufferLineas[c] = ld; indiceOpciones[linea.Opcion].Add(ld); if (linea.Opcion == 1) { iniciales.Add(ld); } } for (int c = 0; c < _lineas.Count; c++) { var linea = _lineas[c]; foreach (int idx in linea.DesbloqueaOpciones) { if (idx != 0) { if (indiceOpciones.Keys.Contains(idx)) { foreach (var lineaSiguiente in indiceOpciones[idx]) { bufferLineas[c].AddSiguiente(lineaSiguiente); } } else { Debug.LogError("Error en datos dialogo " + _nombre + "\r\n Linea: " + linea.Pregunta); } } } } return(new Dialogo(_nombre, introduccion, iniciales)); }
public IActionResult Create(Motivo emp) { var context = HttpContext.RequestServices.GetService(typeof(inventarioContext)) as inventarioContext; context.Motivo.Add(emp); context.SaveChanges(); TempData["message"] = "El nuevo motivo ha sido agreado"; return(RedirectToAction("Index")); }
public static Motivo ToBd(this MotivoDto motivoDto) { var motivo = new Motivo(); motivo.Id = motivoDto.Id; motivo.Descricao = motivoDto.Descricao; return(motivo); }
private void frmSalidaProducto_Load(object sender, EventArgs e) { dtgDetalleSalidaProducto.AutoGenerateColumns = true; cmbProducto.DataSource = Producto.ObtenerProductos(); cmbMotivo.DataSource = Motivo.ObtenerMotivos(); cmbProducto.SelectedItem = null; cmbMotivo.SelectedItem = null; salida = new SalidaProducto(); }
private void ProcesoMotivo() { if (currentIndex < manejadorDialogos.Motivos.Count) { texto.text = manejadorDialogos.Motivos[currentIndex].EnSelector; MotivoSeleccionado = manejadorDialogos.Motivos[currentIndex]; LLenaHipotesis(); } }
private Motivo ObtenerMotivo() { Motivo mar = new Motivo(); mar.id = Convert.ToInt32(txtCodigo.Text); mar.descripcion = txtDescripcion.Text.Trim(); return(mar); }
public IActionResult Edit(Motivo emp) { using (var context = new inventarioContext()) { context.Motivo.Update(emp); context.SaveChanges(); TempData["message"] = "La información del motivo ha sido actualizada"; return(RedirectToAction("Index")); } }
private void dgvMotivo_Click(object sender, EventArgs e) { Motivo mar = (Motivo)dgvMotivo.CurrentRow.DataBoundItem; if (mar != null) { txtCodigo.Text = Convert.ToString(mar.id); txtDescripcion.Text = mar.descripcion; } }
public async Task <IActionResult> Create(Motivo Motivo) { if (ModelState.IsValid) { _context.Add(Motivo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(Motivo)); }
private void cbMotivo_SelectedIndexChanged(object sender, EventArgs e) { if (cbMotivo.SelectedItem == null) { _motivoSeleccionado = null; } else { _motivoSeleccionado = (Motivo)cbMotivo.SelectedItem; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { MotivoBD bd = new MotivoBD(); Motivo motivo = bd.Select(Convert.ToInt32(Session["ID"])); txtMotivoPerda.Text = motivo.MotivoPerda; } txtMotivoPerda.Focus(); }
public async Task <IActionResult> Create([Bind("IdMotivo,TipoMotivo,NomeMotivo")] Motivo motivo) { if (ModelState.IsValid) { _context.Add(motivo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(motivo)); }
private void btnAgregar_Click(object sender, EventArgs e) { Motivo m = ObtenerMotivoFormulario(); if (validarNulos()) { Motivo.AgregarMotivo(m); ListarMotivo(); LimpiarFormulario(); } }
public ActionResult Edit([Bind(Include = "id,DataMotivo,ProdutoId,Usuario,MotivoAtivacao,MotivoInativacao")] Motivo motivo) { if (ModelState.IsValid) { db.Entry(motivo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProdutoId = new SelectList(db.Produtoes, "Id", "Titulo", motivo.ProdutoId); return(View(motivo)); }
public ActionResult DeleteConfirmed(int id) { var context = HttpContext.RequestServices.GetService(typeof(inventarioContext)) as inventarioContext; Motivo motivo = context.Motivo.Find(id); context.Motivo.Remove(motivo); context.SaveChanges(); TempData["message"] = "La información del motivo ha sido Eliminada"; return(RedirectToAction("Index")); }
public ArquivoIgnorado(string nome, Motivo motivo) : this(nome, motivo, null) { }
public GrupoMotivo(Motivo motivo, StreamWriter escritor) : base(escritor) { this.motivo = motivo; this.título = ObterTítulo(); }
public ArquivoIgnorado(string nome, Motivo motivo, string idDocumentoFiscal) : base(nome, idDocumentoFiscal) { this.motivo = motivo; }