コード例 #1
0
        public void GetPrendaxCod(Int32 CodPrenda)
        {
            txtFecha.Text = DateTime.Now.ToShortDateString();
            Clases.cPrenda prenda = new Clases.cPrenda();
            DataTable      trdo   = prenda.GetPrendaxCodigo(CodPrenda);

            Clases.cFunciones fun = new Clases.cFunciones();
            if (trdo.Rows.Count > 0)
            {
                txtDescripcion.Text = trdo.Rows[0]["Descripcion"].ToString();
                txtNombre.Text      = trdo.Rows[0]["Nombre"].ToString();
                txtApellido.Text    = trdo.Rows[0]["Apellido"].ToString();
                txtCodCliente.Text  = trdo.Rows[0]["CodCliente"].ToString();
                if (trdo.Rows[0]["CodPrenda"].ToString() != "")
                {
                    CargarPrenda(Convert.ToInt32(trdo.Rows[0]["CodPrenda"].ToString()));
                }
                txtPatente.Text = trdo.Rows[0]["Patente"].ToString();
                txtImporte.Text = trdo.Rows[0]["Importe"].ToString();
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.ParteEntera(txtImporte.Text);
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }
                txtCodVenta.Text   = trdo.Rows[0]["CodVenta"].ToString();
                txtDiferencia.Text = trdo.Rows[0]["Diferencia"].ToString();
                if (trdo.Rows[0]["ImportePagado"].ToString() != "")
                {
                    txtImporteaPagar.Text = trdo.Rows[0]["ImportePagado"].ToString();
                    txtImporteaPagar.Text = fun.ParteEntera(txtImporteaPagar.Text);
                    txtImporteaPagar.Text = fun.FormatoEnteroMiles(txtImporteaPagar.Text);
                }
                if (txtDiferencia.Text != "")
                {
                    txtDiferencia.Text = fun.ParteEntera(txtDiferencia.Text);
                    txtDiferencia.Text = fun.FormatoEnteroMiles(txtDiferencia.Text);
                }
                if (trdo.Rows[0]["FechaPago"].ToString() != "")
                {
                    DateTime fec = Convert.ToDateTime(trdo.Rows[0]["FechaPago"].ToString());
                    txtFecha.Text            = fec.ToShortDateString();
                    btnGrabar.Enabled        = false;
                    btnAnular.Enabled        = true;
                    txtImporteaPagar.Enabled = false;
                }
                else
                {
                    btnGrabar.Enabled        = true;
                    btnAnular.Enabled        = false;
                    txtImporteaPagar.Enabled = true;
                }
            }
            else
            {
                txtDescripcion.Text = "";
                txtNombre.Text      = "";
                txtApellido.Text    = "";
                Grilla.DataSource   = null;
            }
        }
コード例 #2
0
        private void BuscarCheques(Int32 CodPrenda)
        {
            Clases.cCheque cheque = new Clases.cCheque();
            DataTable      trdo   = cheque.GetChequexCodPrenda(CodPrenda);

            Clases.cFunciones fun = new Clases.cFunciones();
            trdo = fun.TablaaMiles(trdo, "Importe");
            GrillaCheques.DataSource            = trdo;
            GrillaCheques.Columns[0].HeaderText = "Cheque";
            GrillaCheques.Columns[2].HeaderText = "Vencimiento";
            GrillaCheques.Columns[3].Visible    = false;
            GrillaCheques.Columns[4].Width      = 310;
            GrillaCheques.Columns[1].Width      = 100;
            txtImporteCheque.Text    = "";
            txtCheque.Text           = "";
            txtFechaVencimiento.Text = "";
            double TotalCheques = 0;

            for (int i = 0; i < trdo.Rows.Count; i++)
            {
                TotalCheques = TotalCheques + Convert.ToDouble(trdo.Rows[i][1].ToString());
            }
            txtTotalCheque.Text = TotalCheques.ToString();
            //Clases.cFunciones fun = new Clases.cFunciones();
            txtTotalCheque.Text = fun.ParteEntera(txtTotalCheque.Text);
            txtTotalCheque.Text = fun.FormatoEnteroMiles(txtTotalCheque.Text);
            CalcularDiferencias();
        }
コード例 #3
0
ファイル: cGrilla.cs プロジェクト: pablomartinzabala2/AG
        public static void FormatoColumnasMiles(DataGridView Grilla, string Columna)
        {
            cFunciones fun   = new cFunciones();
            string     Valor = "";

            for (int i = 0; i < Grilla.Rows.Count - 1; i++)
            {
                Valor = Grilla.Rows[i].Cells[Columna].Value.ToString();
                Valor = fun.ParteEntera(Valor);
                Grilla.Rows[i].Cells[Columna].Value = fun.FormatoEnteroMiles(Valor);
            }
        }
コード例 #4
0
        public void GetDatosxPrestamo(Int32 CodPrestamo)
        {
            VerificarPagoInteres(CodPrestamo);
            Clases.cFunciones fun      = new Clases.cFunciones();
            Clases.cPrestamo  prestamo = new Clases.cPrestamo();
            DataTable         trdo     = prestamo.GetPrestamoxCodigo(CodPrestamo);

            if (trdo.Rows.Count > 0)
            {
                txtNombre.Text           = trdo.Rows[0]["Nombre"].ToString();
                txtDireccion.Text        = trdo.Rows[0]["Direccion"].ToString();
                txtFecha.Text            = trdo.Rows[0]["Fecha"].ToString();
                txtPorcentaje.Text       = trdo.Rows[0]["PorcentajeInteres"].ToString();
                txtTelefono.Text         = trdo.Rows[0]["Telefono"].ToString();
                txtFechaVencimiento.Text = trdo.Rows[0]["FechaVencimiento"].ToString();
                txtMontoApagar.Text      = trdo.Rows[0]["ImporteaPagar"].ToString();
                txtImporte.Text          = trdo.Rows[0]["Importe"].ToString();
                if (txtMontoApagar.Text != "")
                {
                    txtMontoApagar.Text = fun.ParteEntera(txtMontoApagar.Text);
                }
                if (txtMontoApagar.Text != "")
                {
                    txtMontoApagar.Text = fun.FormatoEnteroMiles(txtMontoApagar.Text);
                }

                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.ParteEntera(txtImporte.Text);
                }
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }
            }
            CargarGrilla(CodPrestamo);
            CargarDetalle(CodPrestamo);
        }
コード例 #5
0
        private void BtnAgregarCheque_Click(object sender, EventArgs e)
        {
            if (txtCheque.Text == "")
            {
                MessageBox.Show("Debe ingresr un número de cheque", Clases.cMensaje.Mensaje());
                return;
            }

            if (txtImporteCheque.Text == "")
            {
                MessageBox.Show("Debe ingresr un importe de cheque", Clases.cMensaje.Mensaje());
                return;
            }

            if (CmbBanco.SelectedIndex < 1)
            {
                MessageBox.Show("Debe seleccionar un banco para continuar", Clases.cMensaje.Mensaje());
                return;
            }
            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFechaVencimiento.Text) == false)
            {
                MessageBox.Show("Debe ingresr una fecha de vencimiento para continuar", Clases.cMensaje.Mensaje());
                return;
            }

            DataTable tbCheques = new DataTable();

            tbCheques.Columns.Add("NroCheque");
            tbCheques.Columns.Add("Importe");
            tbCheques.Columns.Add("FechaVencimiento");
            tbCheques.Columns.Add("CodBanco");
            tbCheques.Columns.Add("Banco");
            int i = 0;

            for (i = 0; i < GrillaCheques.Rows.Count - 1; i++)
            {
                string Cheque           = GrillaCheques.Rows[i].Cells[0].Value.ToString();
                string Importe          = GrillaCheques.Rows[i].Cells[1].Value.ToString();
                string FechaVencimiento = GrillaCheques.Rows[i].Cells[2].Value.ToString();
                string CodBanco         = GrillaCheques.Rows[i].Cells[3].Value.ToString();
                string sBanco           = GrillaCheques.Rows[i].Cells[4].Value.ToString();

                DataRow r = tbCheques.NewRow();
                r[0] = Cheque;
                r[1] = Importe;
                r[2] = FechaVencimiento;
                r[3] = CodBanco;
                r[4] = sBanco;
                tbCheques.Rows.Add(r);
            }
            Clases.cBanco objBanco = new Clases.cBanco();
            string        banco    = objBanco.GetBancoxCodigo(Convert.ToInt32(CmbBanco.SelectedValue));
            DataRow       r1       = tbCheques.NewRow();

            r1[0] = txtCheque.Text;
            r1[1] = txtImporteCheque.Text;
            r1[2] = txtFechaVencimiento.Text;
            r1[3] = CmbBanco.SelectedValue;
            r1[4] = banco;
            tbCheques.Rows.Add(r1);
            GrillaCheques.DataSource            = tbCheques;
            GrillaCheques.Columns[0].HeaderText = "Cheque";
            GrillaCheques.Columns[2].HeaderText = "Vencimiento";
            GrillaCheques.Columns[3].Visible    = false;
            GrillaCheques.Columns[4].Width      = 310;
            GrillaCheques.Columns[1].Width      = 100;
            txtImporteCheque.Text    = "";
            txtCheque.Text           = "";
            txtFechaVencimiento.Text = "";
            double TotalCheques = 0;

            for (i = 0; i < tbCheques.Rows.Count; i++)
            {
                TotalCheques = TotalCheques + fun.ToDouble(tbCheques.Rows[i][1].ToString());
            }
            txtTotalCheque.Text = TotalCheques.ToString();
            //Clases.cFunciones fun = new Clases.cFunciones();
            txtTotalCheque.Text = fun.ParteEntera(txtTotalCheque.Text);
            txtTotalCheque.Text = fun.FormatoEnteroMiles(txtTotalCheque.Text);
            CalcularDiferencias();
        }