protected void gridConsultaClientes_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Pendencias") { UsuarioWeb objUsuario = (UsuarioWeb)Session["ObjetoUsuario"]; CliforDAO objCliente = ClienteDAOWeb.GetInstanciaClienteDAOWeb(Session, objUsuario); int index = Convert.ToInt32(e.CommandArgument); DataTable dtClientes = (DataTable)Session["DadosConsultaClientes"]; GridViewRow RegistroAtual = gridConsultaClientes.Rows[index]; DataRow Registro = dtClientes.Rows[RegistroAtual.DataItemIndex]; Session["CD_ALTER"] = Registro["CD_ALTER"]; string sCdClifor = objUsuario.oTabelas.hlpDbFuncoes.qrySeekValue("CLIFOR", "CD_CLIFOR", "CD_ALTER = '" + Registro["CD_ALTER"] + "'"); DataTable dtRet = objUsuario.oTabelas.hlpDbFuncoes.qrySeekRet(string.Format("select count(NR_DOC)TOTAL from doc_ctr where coalesce(st_baixa,'') <> 'B' and cd_empresa = '{0}' and cd_cliente = '{1}' and dt_venci < current_date", objUsuario.oTabelas.sEmpresa, sCdClifor)); int QtdePendencias = Convert.ToInt32(dtRet.Rows[0]["TOTAL"]); if (QtdePendencias > 0) { GridDuplicatas.DataSource = GetDuplicatasAbertas(); GridDuplicatas.DataBind(); } else { lblCliente.Text = ""; GridDuplicatas.DataSource = null; GridDuplicatas.DataBind(); MessageHLP.ShowPopUpMsg("Não existem pendências para esse cliente!", this.Page); } } }
protected void gridConsultaClientes_PageIndexChanging(object sender, GridViewPageEventArgs e) { lblCliente.Text = ""; GridDuplicatas.DataSource = null; GridDuplicatas.DataBind(); gridConsultaClientes.PageIndex = e.NewPageIndex; ProcessaDataBind(); }
protected void btnVerificarPendencias_Click(object sender, EventArgs e) { if (Session["QtdePendencias"] != null) { if (Convert.ToInt32(Session["QtdePendencias"].ToString()) > 0) { MultiViewItensPed.ActiveViewIndex = 3; GridDuplicatas.DataSource = GetDuplicatasAbertas(); GridDuplicatas.DataBind(); } else { MessageHLP.ShowPopUpMsg("Não existem pendências para esse cliente!", this.Page); } } }
protected void GridDuplicatas_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridDuplicatas.PageIndex = e.NewPageIndex; GridDuplicatas.DataSource = (DataTable)Session["DadosConsultaDuplicatas"]; GridDuplicatas.DataBind(); }