public Comprobante_Para_Reimpresion(MinComprobante compr) { this.BackgroundImage = Properties.Resources.templo3; this.BackgroundImageLayout = ImageLayout.Stretch; this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); InitializeComponent(); this.comprobante = compr; label1.Text = compr.Nombre; label2.Text = compr.Fecha; Numero_Comprobante = compr.NumeroComprobante; label3.Text = "N°: " + compr.NumeroComprobante; label5.Text = compr.getTotal(); InitializeListView(); if (string.IsNullOrWhiteSpace(this.comprobante.Diferencia_Comprobante_Numero)) { label6.Text = null; } else { label6.Text = "Posee Diferencia N°:" + this.comprobante.Diferencia_Comprobante_Numero; } }
public void borrarComprobateProfesor(MinComprobante MinComprobanteAll, string motivo, string responsable) { string carpeta = Global.getDire(); DateTime oDate = Convert.ToDateTime(MinComprobanteAll.Fecha); string fecha = oDate.ToString("yyyy") + oDate.ToString("MMMM") + this.Profesor; string direccion = @carpeta + "\\Liquidaciones\\" + fecha; try { File.Copy(Global.LiquidacionesServer + Path.GetFileName(direccion + ".xlsx"), Global.Liquidaciones + Path.GetFileName(direccion + ".xlsx"), true); } catch (System.IO.FileNotFoundException) { } object misValue = System.Reflection.Missing.Value; Excel.Application xlApp = new Excel.Application(); Excel.Workbook xlWorkbook; Excel._Worksheet xlWorksheet; try { xlWorkbook = xlApp.Workbooks.Open(direccion, Type.Missing, Type.Missing, Type.Missing, Global.Connect()); xlWorksheet = (Excel.Worksheet)xlWorkbook.Worksheets.get_Item(1); Excel.Range xlRange = xlWorksheet.UsedRange; int rowNumber = xlRange.Rows.Count + 1; xlRange.Cells[rowNumber, "A"] = MinComprobanteAll.Fecha; xlRange.Cells[rowNumber, "B"] = MinComprobanteAll.Nombre; xlRange.Cells[rowNumber, "C"] = motivo; xlRange.Cells[rowNumber, "D"] = this.CantidadClases; xlRange.Cells[rowNumber, "E"] = this.Profesor; xlRange.Cells[rowNumber, "F"] = "-" + this.Total; xlRange.Cells[rowNumber, "G"] = "C" + MinComprobanteAll.NumeroComprobante; xlRange.Cells[rowNumber, "H"] = responsable; xlApp.DisplayAlerts = false; xlWorkbook.SaveAs(direccion); xlWorkbook.Close(); xlApp.Quit(); Marshal.ReleaseComObject(xlWorksheet); Marshal.ReleaseComObject(xlWorkbook); Marshal.ReleaseComObject(xlApp); File.Copy(Global.Liquidaciones + Path.GetFileName(direccion + ".xlsx"), Global.LiquidacionesServer + Path.GetFileName(direccion + ".xlsx"), true); } catch { MessageBox.Show("No existe ese archivo"); } }
public Contraseña_Nota_De_Credito(MinComprobante compr) { this.BackgroundImage = Properties.Resources.templo3; this.BackgroundImageLayout = ImageLayout.Stretch; this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); InitializeComponent(); auxCompor = compr; }
public Confirmar_Cancelar_Comprobante(MinComprobante comprobanteRecibe) { this.BackgroundImage = Properties.Resources.templo3; this.BackgroundImageLayout = ImageLayout.Stretch; this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); InitializeComponent(); this.comprobante = comprobanteRecibe; firstInitialize(); }
public Diferencia_Recibos(MinComprobante comprobante, string namePersona) { this.BackgroundImage = Properties.Resources.templo3; this.BackgroundImageLayout = ImageLayout.Stretch; this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); InitializeComponent(); Comprobante = comprobante; nombre = namePersona; label7.Text = comprobante.Nombre; label6.Text = comprobante.NumeroComprobante; }
private void label6_DoubleClick(object sender, EventArgs e) { MinComprobante comprobante = new MinComprobante(); if (MessageBox.Show("Abrir el comprobante?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { comprobante.Nombre = label1.Text; comprobante.NumeroComprobante = this.comprobante.Diferencia_Comprobante_Numero; comprobante.retriveComprobante(); this.Hide(); //string name, string price, string teacher, string amount, string clasesTotal) Comprobante_Para_Reimpresion frm3 = new Comprobante_Para_Reimpresion(comprobante); frm3.ShowDialog(); this.Show(); } }
private void button1_Click_4(object sender, EventArgs e) { try { MinComprobante auxComprobante = new MinComprobante(); var client = new MongoClient(Global.Path_DataBase); var database = client.GetDatabase("Personas"); var collection = database.GetCollection <BsonDocument>("Comprobantes"); var builder = Builders <BsonDocument> .Filter; var filter = builder.Eq("NumeroComprobante", textBox1.Text); var result = collection.Find(filter).ToList(); foreach (var doc in result) { auxComprobante.Fecha = doc.GetValue("Fecha", "no posee").AsString; auxComprobante.NumeroComprobante = doc.GetValue("NumeroComprobante", "no posee").AsString; auxComprobante.Nombre = doc.GetValue("Nombre", "no posee").AsString; var clase = doc.GetValue("Clases", "No posee").AsBsonArray; foreach (var doc2 in clase) { var clase2 = doc2.AsBsonDocument; Comprobantemin comprobanteaux = new Comprobantemin(); comprobanteaux.CantidadClases = clase2.GetValue("CantidadClases", "No Posee").AsString; comprobanteaux.Profesor = clase2.GetValue("Profesor", "No Posee").AsString; comprobanteaux.Precio = clase2.GetValue("Precio", "No Posee").AsString; comprobanteaux.ClasesTomar = clase2.GetValue("ClasesTomar", "No Posee").AsString; comprobanteaux.Descripcion = clase2.GetValue("Descripcion", "No Posee").AsString; comprobanteaux.cantidadElegidos = clase2.GetValue("cantidadElegidos", "No Posee").AsString; comprobanteaux.Total = clase2.GetValue("Total", "No Posee").AsString; auxComprobante.comprobantes.Add(comprobanteaux); } } this.Hide(); //string name, string price, string teacher, string amount, string clasesTotal) Comprobante_Para_Reimpresion frm3 = new Comprobante_Para_Reimpresion(auxComprobante); frm3.ShowDialog(); this.Show(); } catch { MessageBox.Show("El Numero de recibo es incorrecto o el recibo no existe"); } }
private void objectListView1_CellToolTipShowing(object sender, BrightIdeasSoftware.ToolTipShowingEventArgs e) { try { string exit = "Clases con los Profesores: "; MinComprobante comprobante = new MinComprobante(); comprobante = ((MinComprobante)objectListView1.SelectedObject); comprobante.retriveComprobante(); foreach (var compr in comprobante.comprobantes) { exit += compr.Profesor + ", "; } int aux = exit.Count(); exit = exit.Substring(0, aux - 2); e.Text = exit; } catch { } }
private void button1_Click(object sender, EventArgs e) { comprobantes.Clear(); string dateSelected = monthCalendar1.SelectionRange.Start.ToString("dd/MM/yyyy"); var client = new MongoClient(Global.Path_DataBase); var database = client.GetDatabase("Personas"); var collection = database.GetCollection <BsonDocument>("Comprobantes"); var builder = Builders <BsonDocument> .Filter; var filter = builder.Eq("Fecha", dateSelected); var result = collection.Find(filter).ToList(); foreach (var doc in result) { MinComprobante auxComprobante = new MinComprobante(); auxComprobante.Fecha = doc.GetValue("Fecha", "No posee").AsString; auxComprobante.Nombre = doc.GetValue("Nombre", "No posee").AsString; auxComprobante.NumeroComprobante = doc.GetValue("NumeroComprobante", "No posee").AsString; comprobantes.Add(auxComprobante); } InitializeListView(); }
private void objectListView1_DoubleClick(object sender, EventArgs e) { MinComprobante comprobante = new MinComprobante(); try { if (MessageBox.Show("Desea Abrir el comprobante?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { comprobante = ((MinComprobante)objectListView1.SelectedObject); comprobante.retriveComprobante(); this.Hide(); //string name, string price, string teacher, string amount, string clasesTotal) Comprobante_Para_Reimpresion frm3 = new Comprobante_Para_Reimpresion(comprobante); frm3.ShowDialog(); this.Show(); } } catch { } }
private void button1_Click(object sender, EventArgs e) { Comprobantemin auxClase = (Comprobantemin)objectListView1.CheckedObject; MinComprobante resp = new MinComprobante(); resp = this.comprobante; resp.Diferencia_Comprobante_Numero = Numero_Comprobante; resp.comprobantes.Clear(); resp.comprobantes.Add(auxClase); if (auxClase == null) { MessageBox.Show("No Selecciono una clase para generar la diferencia"); } else { this.Hide(); //string name, string price, string teacher, string amount, string clasesTotal) Diferencia_Recibos frm3 = new Diferencia_Recibos(resp, comprobante.Nombre); frm3.ShowDialog(); this.Show(); } }
public void CargarComprobanteEnAlumno(Stack <string> comprobantes) { Stack <MinComprobante> stackComprobantes = new Stack <MinComprobante>(); var client = new MongoClient(Global.Path_DataBase); var database = client.GetDatabase("Personas"); var collection = database.GetCollection <BsonDocument>("Comprobantes"); foreach (var recibo in comprobantes) { var builder = Builders <BsonDocument> .Filter; var filter = builder.Eq("NumeroComprobante", recibo) & builder.Eq("Nombre", this.Name); var result = collection.Find(filter).ToList(); MinComprobante auxComprobante = new MinComprobante(); foreach (var doc in result) { auxComprobante.Fecha = doc.GetValue("Fecha", "no posee").AsString; auxComprobante.NumeroComprobante = doc.GetValue("NumeroComprobante", "no posee").AsString; auxComprobante.Nombre = doc.GetValue("Nombre", "no posee").AsString; var clase = doc.GetValue("Clases", "No posee").AsBsonArray; foreach (var doc2 in clase) { var clase2 = doc2.AsBsonDocument; Comprobantemin comprobanteaux = new Comprobantemin(); comprobanteaux.CantidadClases = clase2.GetValue("CantidadClases", "No Posee").AsString; comprobanteaux.Profesor = clase2.GetValue("Profesor", "No Posee").AsString; comprobanteaux.Precio = clase2.GetValue("Precio", "No Posee").AsString; comprobanteaux.ClasesTomar = clase2.GetValue("ClasesTomar", "No Posee").AsString; comprobanteaux.Descripcion = clase2.GetValue("Descripcion", "No Posee").AsString; comprobanteaux.cantidadElegidos = clase2.GetValue("cantidadElegidos", "No Posee").AsString; comprobanteaux.Total = clase2.GetValue("Total", "No Posee").AsString; auxComprobante.comprobantes.Add(comprobanteaux); } this.ComprobantesCompletosAlumnos.Add(auxComprobante); } } }
public Nota_De_Credito(MinComprobante compr) { InitializeComponent(); Comprobante = compr; InitializeListView(); }