private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { try { string IdVisibilidad = dataGridView2.CurrentRow.Cells[1].Value.ToString(); string Descripcion = dataGridView2.CurrentRow.Cells[2].Value.ToString(); string Grado = dataGridView2.CurrentRow.Cells[3].Value.ToString(); string Porcentaje = dataGridView2.CurrentRow.Cells[4].Value.ToString(); string Costo = dataGridView2.CurrentRow.Cells[5].Value.ToString(); string Tieneenvio = dataGridView2.CurrentRow.Cells[6].Value.ToString(); string Costoenvio = dataGridView2.CurrentRow.Cells[7].Value.ToString(); Alta baja = new Alta(); baja.baja(IdVisibilidad, Descripcion, Grado, Porcentaje, Costo, Tieneenvio, Costoenvio); baja.Show(); this.Dispose(); } catch { MessageBox.Show("No se seleccionó registro para eliminar."); } } }
public ActionResult Save(AltaDto model) { if (ModelState.IsValid) { var Alta = new Alta(); _Alta.Save(model); return(RedirectToAction("List")); } else { return(RedirectToAction("Create", model)); } }
private static void SincronizarAltas(Query q) { s = q.ComandoSql; if (q.Parametrizar) { s += Ambiente.OracleDate(q.UltSincronizacion); } DataTable altasRemotas = Ambiente.Oracledb.Select(s); if (altasRemotas.Rows.Count > 0) { i = 0; foreach (DataRow a in altasRemotas.Rows) { var alta = new Alta(); alta.NrAtendimento = a["NR_ATENDIMENTO"].ToString(); alta.CdPaciente = a["CD_PACIENTE"].ToString(); alta.CdMedico = a["CD_MEDICO"].ToString(); alta.CdEstabelecimento = a["CD_ESTABELECIMENTO"].ToString(); alta.DtEntrada = DateTime.Parse(a["DT_ENTRADA"].ToString()); alta.DtAlta = DateTime.Parse(a["DT_ALTA"].ToString()); alta.DtActualizacion = DateTime.Parse(a["DT_ACTUALIZACION"].ToString()); alta.CdUnidadeBasica = a["CD_UNIDADE_BASICA"].ToString(); alta.CdSetorAtendimento = a["CD_SETOR_ATENDIMENTO"].ToString(); alta.CreatedAt = DateTime.Now; if (altaController.InsertOne(alta)) { WriteStatus("ALTAS", i, altasRemotas.Rows.Count - 1); i++; } } SincronizaMedico(altasRemotas); SincronizaPaciente(altasRemotas); SincronizarComplementoMedico(altasRemotas); SincronizarComplementoPaciente(altasRemotas); PreparaHttpRequest(altasRemotas); LanzaHttpRequests(); q.UltSincronizacion = DateTime.Now; queryController.Update(q); } else { WriteStatus("TODO ESTÁ SINCRONIZADO " + DateTime.Now.ToString("HH:mm:ss")); } }
public bool InsertOne(Alta o) { try { using (var db = new SyncContext()) { db.Add(o); db.SaveChanges(); return(true); } } catch (Exception ex) { Ambiente.Message("Algo salío mal con: " + MethodBase.GetCurrentMethod().Name + " @" + GetType().Name + "\n" + ex.Message); } return(false); }
public bool Update(Alta o) { try { using (var db = new SyncContext()) { db.Entry(o).State = EntityState.Modified; db.SaveChanges(); return(true); } } catch (Exception ex) { Ambiente.Message("Algo salío mal con: " + MethodBase.GetCurrentMethod().Name + " @" + GetType().Name + "\n" + ex.Message); } return(false); }
private void button1_Click(object sender, EventArgs e) { Alta alta = new Alta(); alta.Show(); }
public AltaController() { _Alta = new Alta(); }