예제 #1
0
        private void btnRefrescar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //Validar los datos

            int idCentro = (this.slkupCentroCosto.EditValue == null) ? -1: Convert.ToInt32(this.slkupCentroCosto.EditValue);

            DataSet DS = new DataSet();

            DS            = ConsultasDAC.GetSaldosByCentroCuenta(-1, idCentro, Convert.ToDateTime(this.dtDesde.EditValue), Convert.ToDateTime(this.dtHasta.EditValue));
            dtConsolidado = DS.Tables[0];
            dtDetallado   = DS.Tables[1];



            //this.gridView1.Columns["Debitos"].FieldName = (sTipoMoneda == "L") ? "DebitoLocal" : "DebitoDolar";
            //this.gridView1.Columns["Creditos"].FieldName =(sTipoMoneda == "L") ? "CreditoLocal" : "CreditoDolar";
            //this.gridView1.Columns["SaldoInicial"].FieldName = (sTipoMoneda == "L") ? "SaldoAnteriorLocal" : "SaldoAnteriorDolar";
            //this.gridView1.Columns["SaldoLocal"].FieldName = (sTipoMoneda == "L") ? "SaldoLocal" : "SaldoDolar";

            //if (dtConsolidado.Rows.Count > 0)
            //{
            //    this.txtSaldoInicial.Text = dtConsolidado.Rows[0][(sTipoMoneda=="L")? "SaldoAnteriorLocal" : "SaldoAnteriorDolar"].ToString();
            //    this.txtSaldoFinal.Text = dtConsolidado.Rows[0][(sTipoMoneda=="L")? "SaldoLocal":"SaldoDolar"].ToString();
            //    this.txtTotalCredito.Text = dtConsolidado.Rows[0][(sTipoMoneda=="L")? "CreditoLocal":"CreditoDolar"].ToString();
            //    this.txtTotalDebitos.Text = dtConsolidado.Rows[0][(sTipoMoneda=="L")? "DebitoLocal":"DebitoDolar"].ToString();
            //}
            this.grid.DataSource = dtDetallado;
            CargarDatosSegunMoneda(dtConsolidado);
        }
예제 #2
0
        private void  ShowData()
        {
            try
            {
                this.txtCentroCosto.Text         = drFila["Centro"].ToString();
                this.txtDescrCentroCosto.Text    = drFila["DescrCentroCosto"].ToString();
                this.txtCuentaContable.Text      = drFila["Cuenta"].ToString();
                this.txtDescrCuentaContable.Text = drFila["DescrCuenta"].ToString();

                Util.Util.SetFormatTextEdit(this.txtSaldoInicial, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                Util.Util.SetFormatTextEdit(this.txtTotalCredito, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                Util.Util.SetFormatTextEdit(this.txtTotalDebito, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                Util.Util.SetFormatTextEdit(this.txtSaldoFinal, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");

                this.txtSaldoInicial.Text = drFila[(sTipoMoneda == "L") ? "SaldoAnteriorLocal" : "SaldoAnteriorDolar"].ToString();
                this.txtTotalCredito.Text = drFila[(sTipoMoneda == "L") ? "CreditoLocal" : "CreditoDolar"].ToString();
                this.txtTotalDebito.Text  = drFila[(sTipoMoneda == "L") ? "DebitoLocal" : "DebitoDolar"].ToString();
                this.txtSaldoFinal.Text   = drFila[(sTipoMoneda == "L") ? "SaldoLocal" : "SaldoDolar"].ToString();

                Util.Util.SetFormatTextEditGrid(this.txtGridCredito, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                Util.Util.SetFormatTextEditGrid(this.txtGridDebito, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                Util.Util.SetFormatTextEdit(this.txtTotalCredito, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                this.gridView1.Columns[8].FieldName = (sTipoMoneda == "L") ? "CreditoLocal" : "CreditoDolar";
                this.gridView1.Columns[7].FieldName = (sTipoMoneda == "L") ? "DebitoLocal" : "DebitoDolar";

                this.txtTC.Text = "$" + this.TC.ToString("N2");

                this.txtDel.Text = this.FechaInicial.ToShortDateString();
                this.txtAl.Text  = this.FechaFinal.ToShortDateString();


                int idCentro = Convert.ToInt32(drFila["IDCentro"]);
                int idCuenta = Convert.ToInt32(drFila["IDCuenta"]);


                DataSet DS = new DataSet();

                DS          = ConsultasDAC.GetMovimientosByCentroCuenta(idCuenta, idCentro, FechaInicial, FechaFinal);
                dtDetallado = DS.Tables[0];

                this.grid.DataSource = dtDetallado;
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #3
0
        private void btnRefrescar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                String sCuenta    = (this.chkComboCuenta.EditValue == null) ? "" : this.chkComboCuenta.EditValue.ToString();
                bool   bEsDeMayor = Convert.ToBoolean(this.chkCuentasMayor.EditValue);

                DataSet DS = new DataSet();
                // this.chkComboCuenta.EditValue;
                String[]  lstCuenta = sCuenta.Split('|');
                DataTable dt        = new DataTable();
                dt.Columns.Add("IDCuenta", typeof(int));
                if (sCuenta != "")
                {
                    foreach (string ele in lstCuenta)
                    {
                        dt.Rows.Add(Convert.ToUInt32(ele));
                    }
                }

                DS          = ConsultasDAC.ConsultaLibroMayor((bEsDeMayor) ? 1 : 0, Convert.ToDateTime(this.dtpFechaInicial.EditValue), Convert.ToDateTime(this.dtpFechaFinal.EditValue), dt);
                dtDetallado = DS.Tables[0];

                Util.Util.SetFormatTextEditGrid(this.txtGridSaldoInicial, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                Util.Util.SetFormatTextEditGrid(this.txtGridCreditos, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                Util.Util.SetFormatTextEditGrid(this.txtGridDebito, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");
                Util.Util.SetFormatTextEditGrid(this.txtGridSaldoFinal, (sTipoMoneda == "L") ? Util.Util.FormatType.MonedaLocal : Util.Util.FormatType.MonedaExtrangera, "");


                this.gridView.Columns[5].FieldName = (sTipoMoneda == "L") ? "DebitoLocal" : "DebitoDolar";
                this.gridView.Columns[6].FieldName = (sTipoMoneda == "L") ? "CreditoLocal" : "CreditoDolar";
                this.gridView.Columns[4].FieldName = (sTipoMoneda == "L") ? "SaldoAnteriorLocal" : "SaldoAnteriorDolar";
                this.gridView.Columns[7].FieldName = (sTipoMoneda == "L") ? "SaldoLocal" : "SaldoDolar";


                this.grid.DataSource = dtDetallado;
                this.gridView.Columns[0].SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }