void carga_grid()
        {
            try
            {
                string mensaje = "";
                lista = new List <cp_orden_giro_Info>();
                lista = bus_ogiro.Get_List_orden_giro_x_Pagar(param.IdEmpresa, chk_mostrar_fact_en_conciliacion_Caja.Checked, ref mensaje);
                info_parametros_cp = bus_parametros_cp.Get_Info_parametros(param.IdEmpresa);

                if (lista.Count != 0)
                {
                    factura_x_pagar = new BindingList <cp_orden_giro_Info>(lista);

                    foreach (var item in factura_x_pagar)
                    {
                        item.IdBanco = info_parametros_cp.pa_IdBancoCuenta_default_para_OP == null?lista_ban.FirstOrDefault().IdBanco : Convert.ToInt32(info_parametros_cp.pa_IdBancoCuenta_default_para_OP);

                        item.IdFormaPago = lista_FormaPago.FirstOrDefault().IdFormaPago = "CHEQUE";

                        //Saco la diferencia entre el vencimiento y la fecha de corte
                        TimeSpan Diferencia = item.co_FechaFactura_vct - Convert.ToDateTime(dte_Fecha.EditValue == null ? DateTime.Now.Date : dte_Fecha.EditValue);
                        item.Dias_Vencidos = Diferencia.Days;

                        if (item.Dias_Vencidos < 0) //Por vencer
                        {
                            item.Icono = (Bitmap)imageList1.Images[1];
                        }
                        else
                        if (item.Dias_Vencidos < 5) //normal
                        {
                            item.Icono = (Bitmap)imageList1.Images[2];
                        }
                        else
                        if (item.Dias_Vencidos > 0) // vencido
                        {
                            item.Icono = (Bitmap)imageList1.Images[0];
                        }
                    }
                    gridControl_Factura_x_Pagar.DataSource = factura_x_pagar;
                }


                if (string.IsNullOrEmpty(StringBusqueda) == false)
                {
                    this.gridView_Factura_x_Pagar.ActiveFilterString = "[InfoProveedor.pr_nombre] like '" + StringBusqueda + "'";

                    if (gridView_Factura_x_Pagar.RowCount == 0)
                    {
                        this.gridView_Factura_x_Pagar.ActiveFilterString = "";
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
 private void Cargar_Grid()
 {
     try
     {
         list_OG = bus_OG.Get_List_orden_giro_x_Pagar(param.IdEmpresa, true, ref MensajeError);
         gridControlOrdenGiro.DataSource = list_OG;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }