void cargarTipoCuenta(GridView grv, int id) { CiaSeguro_DAO db = new CiaSeguro_DAO(); grv.DataSource = db.ListarTipoCuentas(id); grv.DataBind(); }
void CargaListaSeguro() { using (CiaSeguro_DAO db = new CiaSeguro_DAO()) { grvCiaSeguros.DataSource = db.ListarSeguros(); grvCiaSeguros.DataBind(); } }
protected void btnConfirmar_Click(object sender, EventArgs e) { using (CiaSeguro_DAO db = new CiaSeguro_DAO()) { int id = Convert.ToInt32(hdnIdCompañiaSeguro.Value); db.Anular(id, hdnEstado.Value.ToUpper()); CargaListaSeguro(); } }
public List <Cia_Seguro> getLstCiabyInst(Int32 InstId) { List <Cia_Seguro> LstCia = new List <Cia_Seguro>(); using (CiaSeguro_DAO db = new CiaSeguro_DAO()) { LstCia = db.getLstbyInst(InstId); } return(LstCia); }
void CargarSeguros() { using (CiaSeguro_DAO db = new CiaSeguro_DAO()) { ddlCiaSeguros.DataSource = db.ListarSeguros(); ddlCiaSeguros.DataTextField = "Nombre"; ddlCiaSeguros.DataValueField = "ID"; ddlCiaSeguros.DataBind(); } }
public void getLstCiabyCamp(Int32 CampId) { CiaSeguro_DAO objCia = new CiaSeguro_DAO(); List <Cia_Seguro> LstCia = objCia.getLstbyCamp(CampId); ddlFiltro.DataSource = LstCia; ddlFiltro.DataTextField = "Nombre"; ddlFiltro.DataValueField = "ID"; ddlFiltro.DataBind(); ListItem lsItm = new ListItem("--TODOS--", "0"); lsItm.Selected = true; ddlFiltro.Items.Add(lsItm); }
protected void btnGuardarCiaSeguro_Click(object sender, EventArgs e) { using (CiaSeguro_DAO db = new CiaSeguro_DAO()) { CIASeguro ciaseg = new CIASeguro(); ciaseg.ID = Convert.ToInt32(Session["idCiaSeguro"]); ciaseg.Nombre = txtRazonSocial.Text; ciaseg.RUC = txtRuc.Text; ciaseg.Direccion = txtDireccion.Text; ciaseg.CodigoUbigeo = DDLDepartamento.SelectedValue.Substring(0, 2) + DDLProvincia.SelectedValue.Substring(2, 2) + DDLDistrito.SelectedValue.Substring(4, 2); //ciaseg.NombreAdj = lblArchivo.Text; ciaseg.TipoContenidoAdj = ""; ciaseg.TamanioAdj = 444; ciaseg.DatoAdj = null; if (chkEmpRecaudadora.Checked == true) { ciaseg.IsEmpresaRecaudadora = true; } else { ciaseg.IsEmpresaRecaudadora = false; } ciaseg.Estado = true; ciaseg.Codigo = null; ciaseg.TerminosCondiciones = null; ciaseg.UsuarioCreacion = null; ciaseg.FechaCreacion = DateTime.Now; ciaseg.UsuarioActualizacion = ""; ciaseg.FechaActualizacion = DateTime.Now; db.agregarSeguro(ciaseg); // string jss = "openModal()"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss, true); } }
protected void grvCiaSeguros_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Agregar") { int fila = Convert.ToInt32(e.CommandArgument); txtTipoSeguro.Text = HttpUtility.HtmlDecode(Convert.ToString(grvCiaSeguros.Rows[fila].Cells[2].Text)); txtTipoSeguro.Enabled = false; // LLenar combobox ...!! cUtil.ListarTipoSeguro(DDLTipoSeguro); cUtil.ListarTrama(DDLTrama); string jss = "openEditarTipoSeguro();"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss, true); } if (e.CommandName == "Edita") { int fila = Convert.ToInt32(e.CommandArgument); int id = Convert.ToInt32(grvCiaSeguros.Rows[fila].Cells[9].Text); using (CiaSeguro_DAO db = new CiaSeguro_DAO()) { cUtil.ListarUbigeo(DDLDepartamento, "01", "00", "00"); CIASeguro ie = db.Buscar(id); Session["idSeguro"] = ie.ID.ToString(); txtRazonSocial.Text = HttpUtility.HtmlDecode(ie.Nombre); txtRuc.Text = ie.RUC; txtDireccion.Text = ie.Direccion; byte[] imagen = db.ObtenerImagenLogo(Convert.ToInt32(grvCiaSeguros.Rows[fila].Cells[1].Text)); if (imagen != null) { img_destinoCia.ImageUrl = "data:image/jpeg;base64," + Convert.ToBase64String(imagen); } DDLDepartamento.SelectedValue = ie.CodigoUbigeo.Substring(0, 2) + "0000"; DDLDepartamento_SelectedIndexChanged(null, null); DDLProvincia.SelectedValue = ie.CodigoUbigeo.Substring(0, 2) + ie.CodigoUbigeo.Substring(2, 2) + "00"; DDLProvincia_SelectedIndexChanged(null, null); DDLDistrito.SelectedValue = ie.CodigoUbigeo.Substring(0, 2) + ie.CodigoUbigeo.Substring(2, 2) + ie.CodigoUbigeo.Substring(4, 2); chkEmpRecaudadora.Checked = ie.IsEmpresaRecaudadora; btnGuardarCiaSeguro.Text = "Editar"; MVSeguros.ActiveViewIndex = 1; } } if (e.CommandName == "Anula") { int fila = Convert.ToInt32(e.CommandArgument); Label lblestado = (Label)grvCiaSeguros.Rows[fila].FindControl("lblestado"); int id = Convert.ToInt32(grvCiaSeguros.Rows[fila].Cells[9].Text); hdnIdCompañiaSeguro.Value = id.ToString(); hdnEstado.Value = lblestado.Text; using (CiaSeguro_DAO db = new CiaSeguro_DAO()) { if (lblestado.Text.ToUpper() == "ACTIVO") { lblTitleConfirm.Text = "Desactivar Compañía de Seguros"; lblmsgConfirm.Text = "¿Desea desactivar esta compañia de seguro: " + grvCiaSeguros.Rows[fila].Cells[2].Text + " ?"; } else if (lblestado.Text == "NO ACTIVO") { lblTitleConfirm.Text = "Activar Compañía de Seguros"; lblmsgConfirm.Text = "¿Desea activar esta compañía de seguro: " + grvCiaSeguros.Rows[fila].Cells[2].Text + " ?"; } ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "openConfirm();", true); } } }