protected void BtnGuardar_Click(object sender, EventArgs e) { try { BllTiposIrregularidades.TiposIrregularidades ObjGrabar = new BllTiposIrregularidades.TiposIrregularidades(); if (TxtCodigo.Text != "") { ObjGrabar.TiIreCodi = TxtCodigo.Text; ObjGrabar.TiIrDesc = TxtTipologia.Text; ObjGrabar.TiIrLiQu = Int16.Parse(CmbTipoAnomalia.SelectedValue); ObjGrabar.TiIresta = ChkActivo.Checked; if (BllTiposIrregularidades.Exist(TxtCodigo.Text) == 0) { long r = ObjGrabar.Insert(); if (r > 0) { Metodos.divMensaje(Constantes.Succes, Constantes.Guardado, PnlMsg, Constantes.Ok); FillTiposAnomalia(); updateGrid.Update(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "mostrarDatos();", true); } updateGrid.Update(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "mostrarDatos();", true); } else { long r = ObjGrabar.Update(); if (r > 0) { Metodos.divMensaje(Constantes.Succes, Constantes.Actualizar, PnlMsg, Constantes.Ok); FillTiposAnomalia(); updateGrid.Update(); } updateGrid.Update(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "mostrarDatos();", true); } } updateGrid.Update(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "mostrarGrid();", true); } catch (Exception ex) { Metodos.divMensaje(Constantes.Danger, Constantes.errorGeneral, PnlMsg, Constantes.Fallo); UpdateNew.Update(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "mostrarGrid();", true); } }
public void cargarListas(List<string[]> lista) { try { // List<string[]> fila=lista; BllTiposIrregularidades.TiposIrregularidades Objgrabar = new BllTiposIrregularidades.TiposIrregularidades(); int insert = 0; int act = 0; string[] vector; for (int c = 0; c < lista.Count; c++) { // 22 codigo depto, 23 desc dpto vector = lista[c]; string tipologia = vector[0].ToString(); string Situacion = vector[1].ToString(); string Tipo = vector[2].ToString(); string Procedimiento = vector[3].ToString(); string MetodoLiquidac = vector[4].ToString(); // DateTime Birthdate = DateTime.ParseExact(date, "dd/MM/yyyy", null); string MetodoLiq2 = vector[5].ToString(); //Objgrabar.tipologia = tipologia; //Objgrabar.situacionencontrada = Situacion; //Objgrabar.tipo = llamarTipo(Tipo).ToString(); ////Objgrabar.metodoLiquidacion1 = LlamarMetodo(MetodoLiquidac); //Objgrabar.procedimiento = Procedimiento; //Objgrabar.metodoLiquidacion2 = MetodoLiq2; //BllTiposIrregularidades.TiposIrregularidades ObjHisEm = new BllTiposIrregularidades.TiposIrregularidades(); //if (BllTiposIrregularidades.Exist(Objgrabar.situacionencontrada,Objgrabar.tipologia) == 0) //{ //int resul = Objgrabar.Insert(); //if (resul > 0) //{ // insert = insert + 1; // Label1.Text = insert.ToString() + " Archivos Guardados"; //} //} //else //{ //} } } catch (Exception ex) { mensaje(Constantes.errorGeneral); } }
protected void BtnSelect_Command(object sender, CommandEventArgs e) { try { if (e.CommandName != "Page") { BllTiposIrregularidades.TiposIrregularidades Row = new BllTiposIrregularidades.TiposIrregularidades(); List<BllTiposIrregularidades.TiposIrregularidades> Rows = new List<BllTiposIrregularidades.TiposIrregularidades>(); Rows = (List<BllTiposIrregularidades.TiposIrregularidades>)Session["ListTiposIrregularidades"]; LblTittle.Text = "Modificar Regristro"; BtnGuardar.Text = "Modificar"; if (Rows.Exists(b => b.TiIrIndi.ToString() == e.CommandArgument.ToString())) { Row = Rows.Where(b => b.TiIrIndi.ToString() == e.CommandArgument.ToString()).First(); TxtCodigo.Enabled = false; TxtCodigo.Text = Row.TiIreCodi.ToString(); TxtTipologia.Text = Row.TiIrDesc; CmbTipoAnomalia.SelectedValue = Row.TiIrLiQu.ToString(); ChkActivo.Checked = Row.TiIresta; UpdateNew.Update(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "mostrarDatos();", true); } } } catch (Exception ex) { Metodos.divMensaje(Constantes.Danger, Constantes.ErrorAlConsultarDatos, PnlMsg, Constantes.Fallo); UpdateNew.Update(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "mostrarGrid();", true); } }