Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Tarea17
  12. {
  13. public partial class frmInformaciondelproducto : Form
  14. {
  15. public frmInformaciondelproducto()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void cmdSalida_Click(object sender, EventArgs e)
  21. {
  22. //Salida del programa
  23. Close();
  24.  
  25. }
  26.  
  27. private void cmdCalcular_Click(object sender, EventArgs e)
  28. {
  29. //Programa que calcule la informacion del precio al contado y en abonos
  30. //Camacho Herrera Felipe 16212638
  31. //Tarea17
  32.  
  33. //Declaracion de variables
  34. float Precio_producto;
  35. //Asignacion de valores a las variables
  36. Precio_producto = System.Single.Parse(txtPrecio_producto.Text);
  37. //Llamar procedimiento
  38. Pagocontado (Precio_producto);
  39. Abonos (Precio_producto);
  40. }
  41. float Iva (float Precio1)
  42. {
  43. //Funcion para sacar Iva
  44. return Precio1 * 0.16f;
  45. }
  46. void Pagocontado (float Pc)
  47. {
  48. //Declaracion de variables en los procedimientos
  49. float Totalc, Imp;
  50.  
  51. //Llamada a la funcion
  52. Imp = Iva (Pc) ;
  53. //Calcular
  54. Totalc = Pc + Imp;
  55. //Salida del resultado
  56. txtImp.Text = Imp.ToString();
  57. txtTotalc.Text = Totalc.ToString();
  58. }
  59. void Abonos (float Pa)
  60. {
  61.  
  62. }
  63.  
  64. private void txtContado_TextChanged(object sender, EventArgs e)
  65. {
  66. //Declaracion de las variables
  67. float Pol, Impu, Total1, Mens,Pa;
  68.  
  69. //Asignacion de valores a las variables
  70. Pol = System.Single.Parse(txtPol.Text);
  71. Impu = System.Single.Parse(txtImpu.Text);
  72. Total1 = System.Single.Parse(txtTotal1.Text);
  73. Mens = System.Single.Parse(txtMens.Text);
  74. Pa = System.Single.Parse(txtPa.Text);
  75.  
  76. //Calculo
  77. Pol = Pa * 0.20f;
  78. Mens = Pol + Pa;
  79. Impu = Iva(Mens);
  80. Total1 = Mens + Impu + Pa;
  81. Mens = Total1 / 6;
  82. //Salida del resultado
  83. txtPol.Text = Pol.ToString();
  84. txtImpu.Text = Impu.ToString();
  85. txtTotal1.Text = Total1.ToString();
  86. txtPa.Text = Pa.ToString();
  87. txtMens.Text = Mens.ToString();
  88. }
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement