Пример #1
0
 private void btnCalcular_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtTotalIngresos.Text == string.Empty)
         {
             MessageBox.Show("No se han Registrado ingresos", "Informacion Ingresos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             txtTotalIngresos.Focus();
         }
         else if (txtDescuentos.Text == string.Empty)
         {
             MessageBox.Show("No se han detectado descuentos, Digite una cantidad valida", "Informacion Ingresos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             txtDescuentos.Focus();
         }
         else
         {
             double TI, D, TG;
             TI = double.Parse(txtTotalIngresos.Text);
             D  = double.Parse(txtDescuentos.Text);
             TG = TI - D;
             txtTotalGanancias.Text = TG.ToString("f2");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
        public void cargar_cobranzas(string ncontrato)
        {
            dtgCCanceladas.DataSource = null;
            dtgCPendientes.DataSource = null;
            txtTotCanCobranzas.Text   = "";
            txtGLCobranzas.Text       = "";
            txtICCobranzas.Text       = "";
            txtGICobranzas.Text       = "";
            txtFECobranzas.Text       = "";
            txtTGCobranzas.Text       = "";
            txtObsCobranzas.Text      = "";
            double TC, GL, IC, GI, FE, TG;

            TC = GL = IC = GI = FE = TG = 0;
            lblNContratoCobranzas.Text = "Contrato N° " + ncontrato;
            string txtSQL = "Select TipoCuota,NroCuota,TotalCuotas,MontoCuota,FechaCuota from Giros where NroContrato='" + ncontrato + "' and Estatus='PENDIENTE' Order by FechaCuota,TotalCuotas";

            if (Globales.BD.nregistros(txtSQL) > 0)
            {
                Globales.BD.dtt           = Globales.BD.generar_datatable(txtSQL, CommandType.Text, new List <Clases.Parameters>());
                dtgCPendientes.DataSource = Globales.BD.dtt;
                //dtgCPendientes.Columns[4].Visible = false;
                foreach (DataRow row in Globales.BD.dtt.Rows)
                {
                    if (row["TipoCuota"] != DBNull.Value)
                    {
                        if (Convert.ToString(row["TipoCuota"]) == "GIRO")
                        {
                            GI += Convert.ToDouble(row["MontoCuota"]);
                        }

                        else if (Convert.ToString(row["TipoCuota"]) == "COMPLEMENTARIA")
                        {
                            IC += Convert.ToDouble(row["MontoCuota"]);
                        }
                        else if (Convert.ToString(row["TipoCuota"]) == "GASTOSLEGALES")
                        {
                            GL += Convert.ToDouble(row["MontoCuota"]);
                        }
                        else if (Convert.ToString(row["TipoCuota"]).Length > 21)
                        {
                            if (Convert.ToString(row["TipoCuota"]).Substring(0, 21) == "FINANCIAMIENTOESPECIAL")
                            {
                                FE += Convert.ToDouble(row["MontoCuota"]);
                            }
                        }
                    }
                    TG += Convert.ToDouble(row["MontoCuota"]);
                }
                txtGLCobranzas.Text = GL.ToString("N2") + " Bs.";
                txtICCobranzas.Text = IC.ToString("N2") + " Bs.";
                txtGICobranzas.Text = GI.ToString("N2") + " Bs.";
                txtFECobranzas.Text = FE.ToString("N2") + " Bs.";
                txtTGCobranzas.Text = TG.ToString("N2") + " Bs.";
            }

            txtSQL = "Select TipoCuota,NroCuota,TotalCuotas,MontoCuota,FechaCancelado from Giros where NroContrato='" + ncontrato + "' and Estatus='CANCELADO' Order by FechaCuota,TotalCuotas";
            if (Globales.BD.nregistros(txtSQL) > 0)
            {
                Globales.BD.dtt           = Globales.BD.generar_datatable(txtSQL, CommandType.Text, new List <Clases.Parameters>());
                dtgCCanceladas.DataSource = Globales.BD.dtt;
                //dtgCCanceladas.Columns[4].Visible = false;

                foreach (DataRow row in Globales.BD.dtt.Rows)
                {
                    TC += Convert.ToDouble(row["MontoCuota"]);
                }
                txtTotCanCobranzas.Text = TC.ToString("N2") + " Bs.";
            }
        }
Пример #3
0
 baseGrades.Add(new BaseValue()
 {
     Key   = "TG",
     Value = TgGrade != null && decimal.TryParse(TgGrade, out decimal TG) ? TG.ToString() : "0"
 });