using CKUERA; //using RJTextBox; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Reflection.Emit; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace ECV { public partial class Faltante : Form { public Faltante() { InitializeComponent(); } private void Faltante_Activated(object sender, EventArgs e) { this.Width = 20; } public Ventas ven; public Faltante(Ventas ven) { InitializeComponent(); this.ven = ven; } private void Faltante_Resize(object sender, EventArgs e) { Principal fp = new Principal(); this.Top = fp.Height / 2 - this.Height / 2; this.FormBorderStyle = FormBorderStyle.FixedToolWindow; Label6.Top = 9; Label6.Left = Label6.Top; this.Width = Label6.Width + Label6.Left + 25;// * (3.8); this.BackColor = Global.ColorSistema; this.Height = Label6.Height + Label6.Top + 48; this.StartPosition = FormStartPosition.Manual; btn_procesar.BackColor = Global.ColorSistema; btn_procesar.ForeColor= Color.White; Left = (fp.Width / 2)+20; } private void Faltante_Load(object sender, EventArgs e) { Ventas ventas = new Ventas(); lab_faltante1.Text = Global.SIMB_ + " " + Ventas.faltante1; lab_faltante2.Text = Global.simboloMoneda2 + " " + Ventas.faltante2; lab_faltante3.Text = Global.simboloMoneda3 + " " + Ventas.faltante3; lab_faltante4.Text = Global.simboloMoneda4 + " " + Ventas.faltante4; //ventas.colorVueltos(); lab_faltante1.BackColor = Global.ColorSistema; Txt_faltanteVal1.BackColor = lab_faltante1.BackColor; lab_faltante2.BackColor = Color.Maroon; Txt_faltanteVal2.BackColor = lab_faltante2.BackColor; lab_faltante3.BackColor = Color.Blue; Txt_faltanteVal3.BackColor = lab_faltante3.BackColor; lab_faltante4.BackColor = Color.Green; //Color.Green; Color.Blue; Color.Maroon; Txt_faltanteVal4.BackColor = lab_faltante4.BackColor; } private void btn_procesar_Click(object sender, EventArgs e) { if (Txt_faltanteVal2.Text == "") { Txt_faltanteVal2.Text = "0"; //Txt_faltanteVal2.Focus(); //return; } if (double.Parse(Txt_faltanteVal2.Text) > 0) { Ventas.faltanteVal2 = double.Parse(Txt_faltanteVal2.Text); ven.faltante2Escribir(); Close(); } ////////////////////////////////////////////////////////////// if (Txt_faltanteVal3.Text == "") { Txt_faltanteVal3.Text = "0"; Txt_faltanteVal3.Focus(); return; } if (double.Parse(Txt_faltanteVal3.Text) > 0) { Ventas.faltanteVal3 = double.Parse(Txt_faltanteVal3.Text); ven.faltante3Escribir(); Close(); } ////////////////////////////////////////////////////////////// if (Txt_faltanteVal4.Text == "") { Txt_faltanteVal4.Text = "0"; Txt_faltanteVal4.Focus(); return; } if (double.Parse(Txt_faltanteVal4.Text) > 0) { Ventas.faltanteVal4 = double.Parse(Txt_faltanteVal4.Text); ven.faltante4Escribir(); Close(); } ////////////////////////////////////////////////////////////// if (Txt_faltanteVal1.Text == "") { Txt_faltanteVal1.Text = "0"; Txt_faltanteVal1.Focus(); return; } if (double.Parse(Txt_faltanteVal1.Text) > 0) { Ventas.faltanteVal1 = double.Parse(Txt_faltanteVal1.Text); ven.faltante1Escribir(); Close(); } if (double.Parse(Txt_faltanteVal1.Text) == 0) { if (double.Parse(Txt_faltanteVal2.Text) == 0) { if (double.Parse(Txt_faltanteVal3.Text) == 0) { if (double.Parse(Txt_faltanteVal4.Text) == 0) { Close(); } } } } } private void button1_Click(object sender, EventArgs e) { Close(); } private void Txt_faltanteVal1_TextChanged(object sender, EventArgs e) { try { double d = double.Parse(Txt_faltanteVal1.Text); } catch { Txt_faltanteVal1.Text = ""; Txt_faltanteVal1.Focus(); } } private void Txt_faltanteVal2_TextChanged(object sender, EventArgs e) { try { double d = double.Parse(Txt_faltanteVal2.Text); } catch { Txt_faltanteVal2.Text = ""; Txt_faltanteVal2.Focus(); } } private void Txt_faltanteVal3_TextChanged(object sender, EventArgs e) { try { double d = double.Parse(Txt_faltanteVal3.Text); } catch { Txt_faltanteVal3.Text = ""; Txt_faltanteVal3.Focus(); } } private void Txt_faltanteVal4_TextChanged(object sender, EventArgs e) { try { double d = double.Parse(Txt_faltanteVal4.Text); } catch { Txt_faltanteVal4.Text = ""; Txt_faltanteVal4.Focus(); } } } }