protected void btnGuardarModificar_Click(object sender, EventArgs e) { try { IClientesValorDeclarado clientesValorDeclarado = ClientesValorDeclaradoFactory.GetClientesValorDeclarado(); clientesValorDeclarado.ClienteID = Convert.ToInt32(this.lblClienteID.Text); if (this.chkEstado.Checked == true) { clientesValorDeclarado.Estado = 1; } else { clientesValorDeclarado.Estado = 0; } IUsuarios usuario = (IUsuarios)Session["Usuario"]; clientesValorDeclarado.UsuarioID = usuario.UsuarioID; if (clientesValorDeclarado.GuardarClientesValorDeclarado()) { this.txtCodigoCliente.Text = ""; this.txtRazonSocialCliente.Text = ""; this.txtCuitCliente.Text = ""; this.chkEstado.Checked = false; this.lblClienteID.Text = ""; this.tblCliente.Visible = false; this.txtCodigo.Text = ""; this.txtRazonSocial.Text = ""; this.txtCuit.Text = ""; this.BindGrid(0); ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Estado Cliente Guardado Correctamente');", true); } } catch (Exception ex) { throw ex; } }
private void BindGrid(int currentPage) { try { DataSet ds = new DataSet(); IClientesValorDeclarado clientesValorDeclarado = ClientesValorDeclaradoFactory.GetClientesValorDeclarado(); clientesValorDeclarado.Codigo = txtCodigo.Text == "" ? "" : txtCodigo.Text.Trim(); clientesValorDeclarado.RazonSocial = txtRazonSocial.Text == "" ? "" : txtRazonSocial.Text.Trim(); clientesValorDeclarado.Cuit = txtCuit.Text == "" ? "" : txtCuit.Text.Trim(); ds = clientesValorDeclarado.GetClientesValorDeclarado(); this.Session["dtgClientesValoresDeclarado"] = ds; SisPackController.AdministrarGrillas.Configurar(dtgClientesValoresDeclarado, "clienteid", 100); this.dtgClientesValoresDeclarado.DataSource = ds; this.dtgClientesValoresDeclarado.CurrentPageIndex = 0; this.dtgClientesValoresDeclarado.DataBind(); } catch (Exception ex) { throw ex; } }