Exemple #1
0
        private void AgregarComprobantes_Click(object sender, EventArgs e)
        {
            try
            {
                if (checkBox1.Checked)
                {
                    Clase auxClase = new Clase();
                    auxClase.Profesor         = "Uniforme";
                    auxClase.Descripcion      = "Uniforme";
                    auxClase.CantidadClases   = "";
                    auxClase.ClasesTomar      = "Uniforme";
                    auxClase.cantidadElegidos = (Convert.ToInt32(numericUpDown1.Value)).ToString();
                    auxClase.Precio           = getUniformesValue();
                    ClasesList.Add(auxClase);
                    listView1.Clear();
                    FormGrid();
                    CargarDeposito(ClasesList);
                    UncheckAll();
                }
                else
                {
                    Clase auxClase = new Clase();
                    if ((checkedListBox3.CheckedItems.Count == 0))
                    {
                        auxClase.ClasesTomar = "Generico";
                        auxClase.Descripcion = "Generico";
                    }
                    else
                    {
                        auxClase.ClasesTomar = Clase.ClasesTomar;
                        auxClase.Descripcion = Clase.Descripcion;
                    }

                    auxClase.Profesor         = Clase.Profesor;
                    auxClase.CantidadClases   = Clase.CantidadClases;
                    auxClase.cantidadElegidos = Clase.cantidadElegidos;



                    /*this.Hide();
                    *  //string name, string price, string teacher, string amount, string clasesTotal)
                    *  Horarios frm3 = new Horarios(auxClase);
                    *  frm3.ShowDialog();
                    *  this.Show();*/


                    ClasesList.Add(auxClase);
                    listView1.Clear();
                    FormGrid();
                    CargarDeposito(ClasesList);
                    UncheckAll();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("No es correcto lo seleccionado");
                UncheckAll();
                Clase = new Clase();
            }
        }
Exemple #2
0
        static internal List <Clase> GET()
        {
            List <Clase> newList = new List <Clase>();
            Clase        aux     = new Clase();

            newList.Add(aux);
            return(newList);
        }
        private void button1_Click_9(object sender, EventArgs e)
        {
            Clase clase = new Clase();

            clase.IncrementServerRecibosNumber();
            var anser = clase.LastNumberServerRecibos();

            MessageBox.Show(anser.ToString());
        }
Exemple #4
0
        private void getUsuariosCursosClases()
        {
            Comprobante_Especial aux = new Comprobante_Especial();

            aux.getUsuarios().ForEach(name => comboBox1.Items.Add(name));
            Clase clase = new Clase();

            clase.getProfesoresTodos().ForEach(x => comboBox2.Items.Add(x));
            clase.getCursos().ForEach(x => comboBox2.Items.Add(x));
        }
Exemple #5
0
        private void button6_Click(object sender, EventArgs e)
        {
            Clase            newclase = new Clase();
            HashSet <string> keys     = newclase.getKeys();

            foreach (var stringkey in keys)
            {
                MessageBox.Show(stringkey);
            }
        }
Exemple #6
0
        public void completeProfesores()
        {
            checkedListBox1.Items.Clear();
            Clase hola = new Clase();

            foreach (var profesor in hola.getProfesoresTodos())
            {
                checkedListBox1.Items.Add(profesor);
            }
        }
        private void AuxMakeRec(Clase clase, string fecha, CreaTicket ticket, bool flag)
        {
            string carpeta = Global.getDire();
            string printer = Global.getImpresora();
            // genera las carpetas a guardar
            string nombreExceldia      = @carpeta + "\\Diario\\" + dateTimePicker1.Value.ToString("yyyyMMdd");
            string savedia             = nombreExceldia + ".xlsx";
            string nombreExcelmes      = @carpeta + "\\Mensual\\" + dateTimePicker1.Value.ToString("yyyyMMMM");
            string savemes             = nombreExcelmes + ".xlsx";
            string nombreExcelProfesor = @carpeta + "\\Liquidaciones\\" + DateTime.Now.ToString("yyyy") + DateTime.Now.ToString("MMMM") + clase.Profesor;
            string saveProfesor        = nombreExcelProfesor + ".xlsx";

            /*if (flag == true)
             * {
             *  claseaux.Descripcion += clase.Descripcion + ", ";
             *  claseaux.Profesor += clase.Profesor + ", ";
             *  claseaux.ClasesTomar += clase.ClasesTomar + ", ";
             *  claseaux.CantidadClases += clase.CantidadClases + ", ";
             * }*/



            ticket.TextoIzquierda(clase.cantidadElegidos + "x");

            if (!(clase.Descripcion == "Generico"))
            {
                ticket.TextoIzquierda(clase.Descripcion);
            }

            ticket.TextoIzquierda(clase.Profesor);
            if (clase.CantidadClases == "xClase")
            {
                clase.CantidadClases = "Clase";
            }
            ticket.TextoExtremos("Cantidad: " + clase.CantidadClases, clase.Precio);
            if ((clase.Horarios != null) && (clase.Horarios.Any()))
            {
                ticket.TextoIzquierda("Horario");
                foreach (var horario in clase.Horarios)
                {
                    ticket.TextoIzquierda(horario);
                }
            }

            ticket.LineasTotales(); // imprime linea

            if (clase.tiene_recargo() == true)
            {
                int recargo = Convert.ToInt32(clase.Total) - Convert.ToInt32(clase.Precio);
                ticket.TextoExtremos("Recargo Administrativo", recargo.ToString());
            }

            ticket.TextoExtremos("Importe", clase.Total);
            ticket.AgregaLinea(1);
        }
Exemple #8
0
 public Horarios(Clase clases)
 {
     this.BackgroundImage       = Properties.Resources.templo3;
     this.BackgroundImageLayout = ImageLayout.Stretch;
     this.SetStyle(
         ControlStyles.AllPaintingInWmPaint |
         ControlStyles.DoubleBuffer,
         true);
     InitializeComponent();
     clase = clases;
     fillListbox1();
 }
Exemple #9
0
        public Clase trasforToClase()
        {
            Clase resp = new Clase();

            resp.Profesor         = this.Profesor;
            resp.Precio           = this.Precio;
            resp.Total            = this.Total;
            resp.ClasesTomar      = this.ClasesTomar;
            resp.Descripcion      = this.Descripcion;
            resp.cantidadElegidos = this.cantidadElegidos;
            resp.CantidadClases   = this.CantidadClases;

            return(resp);
        }
Exemple #10
0
        public List <Clase> getProfesorListClase()
        {
            List <Clase> resp       = new List <Clase>();
            var          client     = new MongoClient(Global.Path_DataBase);
            var          database   = client.GetDatabase("app_pago");
            var          collection = database.GetCollection <BsonDocument>("profesor");
            var          filter     = Builders <BsonDocument> .Filter.Empty;
            var          result     = collection.Find(filter).ToList();

            foreach (var doc in result)
            {
                Clase aux = new Clase();
                aux.Profesor = doc.GetValue("name", "No tiene nombre").AsString;
                resp.Add(aux);
            }
            return(resp);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                var aux = Comprobante.comprobantes.ToList().First();
                //A VER CON PAU QUE PONER
                string descrp    = "Diferencia Recibo " + Comprobante.NumeroComprobante + " por el complemento de la reserva del curso";
                Clase  respClase = new Clase();
                respClase.Precio           = aux.Total;
                respClase.Total            = aux.Total;
                respClase.Profesor         = aux.Profesor;
                respClase.CantidadClases   = "Diferencia de reserva";
                respClase.cantidadElegidos = aux.cantidadElegidos;
                respClase.Descripcion      = descrp;
                respClase.ClasesTomar      = descrp;
                respClase.Diferencia_Comprobante_Numero = Comprobante.Diferencia_Comprobante_Numero;
                respClase.EsDiferencia = true;
                ListClase.Add(respClase);
            }
            else
            {
                var aux = Comprobante.comprobantes.ToList().First();

                Clase  respClase = new Clase();
                string descrp    = "Diferencia Recibo " + Comprobante.NumeroComprobante + " por " + cantidadNew;
                var    precio    = MakeDiference(aux, cantidadNew);
                respClase.Precio           = precio;
                respClase.Total            = precio;
                respClase.Profesor         = aux.Profesor;
                respClase.CantidadClases   = "Diferencia a " + cantidadNew;
                respClase.cantidadElegidos = aux.cantidadElegidos;
                respClase.Descripcion      = descrp;
                respClase.ClasesTomar      = descrp;
                respClase.Diferencia_Comprobante_Numero = Comprobante.Diferencia_Comprobante_Numero;
                respClase.EsDiferencia = true;
                ListClase.Add(respClase);
            }



            this.Hide();
            //string name, string price, string teacher, string amount, string clasesTotal)
            ImprimirTicket frm3 = new ImprimirTicket(ListClase, nombre, false);

            frm3.ShowDialog();
        }
        private void makeRecipeByClaseAux2(Clase clase, string fecha, CreaTicket ticket, bool flag)
        {
            string carpeta = Global.getDire();
            string printer = Global.getImpresora();
            // genera las carpetas a guardar
            string nombreExceldia      = @carpeta + "\\Diario\\" + dateTimePicker1.Value.ToString("yyyyMMdd") + "Test";
            string savedia             = nombreExceldia + ".xlsx";
            string nombreExcelmes      = @carpeta + "\\Mensual\\" + dateTimePicker1.Value.ToString("yyyyMMMM") + "Test";
            string savemes             = nombreExcelmes + ".xlsx";
            string nombreExcelProfesor = @carpeta + "\\Liquidaciones\\" + DateTime.Now.ToString("yyyy") + DateTime.Now.ToString("MMMM") + clase.Profesor + "Test";
            string saveProfesor        = nombreExcelProfesor + ".xlsx";

            var number = claseaux.LastNumberServerRecibos();

            if (flag == true)
            {
                claseaux.Descripcion    += clase.Descripcion + ", ";
                claseaux.Profesor       += clase.Profesor + ", ";
                claseaux.ClasesTomar    += clase.ClasesTomar + ", ";
                claseaux.CantidadClases += clase.CantidadClases + ", ";
            }

            if (clase.CantidadClases == "xClase")
            {
                clase.CantidadClases = "Clase";
            }

            if ((clase.Horarios != null) && (clase.Horarios.Any()))
            {
                ticket.TextoIzquierda("Horario");
                foreach (var horario in clase.Horarios)
                {
                    ticket.TextoIzquierda(horario);
                }
            }


            if (flag == true)
            {
                clase.CargarExcelProfesor(nombreExcelProfesor, Global, saveProfesor, DateTime.Now.ToString("dd/MM/yyyy"), number.ToString(fmt), name);
            }
        }
Exemple #13
0
        private void Imprimir_Click(object sender, EventArgs e)
        {
            try
            {
                Comprobantemin auxComprobantemin = (Comprobantemin)objectListView1.CheckedObject;
                Clase          auxClase          = auxComprobantemin.trasforToClase();
                auxClase.Descripcion    = "Nota de Credito Recibo Numero: " + Comprobante.NumeroComprobante;
                auxClase.Total          = "-" + textBox1.Text;
                auxClase.Precio         = "-" + textBox1.Text;
                auxClase.CantidadClases = "Nota de Credito Recibo Numero: " + Comprobante.NumeroComprobante;
                List <Clase> listToSend = new List <Clase>();
                listToSend.Add(auxClase);

                this.Hide();
                //string name, string price, string teacher, string amount, string clasesTotal)
                ImprimirTicket frm3 = new ImprimirTicket(listToSend, Comprobante.Nombre, false);
                frm3.ShowDialog();
                this.Show();
            }
            catch
            {
                MessageBox.Show("No selecciono la clase");
            }
        }
        private void button4_Click(object sender, EventArgs e)
        {
            bool   flag        = true;
            string descripcion = String.Empty;

            if (MessageBox.Show("Desea Imprimir el comprobante?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                string carpeta = Global.getDireTest();
                printer = Global.getImpresora();
                // genera las carpetas a guardar
                string nombreExceldia = @carpeta + "\\Diario\\" + dateTimePicker1.Value.ToString("yyyyMMdd") + "Test";
                string savedia        = nombreExceldia + ".xlsx";
                string nombreExcelmes = @carpeta + "\\Mensual\\" + dateTimePicker1.Value.ToString("yyyyMMMM") + "Test";
                string savemes        = nombreExcelmes + ".xlsx";

                Clase      claseaux2 = new Clase();
                var        number    = claseaux2.LastNumberServerRecibos();
                string     fecha     = "Fecha " + DateTime.Today.ToString("d");
                string     hora      = "Hora " + DateTime.Now.ToString("HH:mm");
                CreaTicket Ticket1   = new CreaTicket();
                //CREA EL PRIMER TICKET


                Ticket1.impresora = printer;
                Ticket1.AgregaLinea(2);
                Ticket1.TextoExtremos(fecha, hora);
                Ticket1.AgregaLinea(1);
                Ticket1.TextoIzquierda("Nro Comprobante: " + number.ToString(fmt));
                Ticket1.AgregaLinea(1);
                Ticket1.TextoIzquierda(name);
                Ticket1.AgregaLinea(1);
                Ticket1.LineasGuion();

                foreach (var clase in ClasesListFiniShed)
                {
                    makeRecipeByClaseAux(clase, dateTimePicker1.Value.ToString("yyyy/MM/dd"), Ticket1, flag);

                    string resp = string.Empty;
                    if (IsForNext)
                    {
                        DateTime date = DateTime.Now;
                        DateTime aux  = date.AddMonths(1);
                        if (!(aux.ToString("MMMM") == "enero"))
                        {
                            resp = aux.ToString("yyyy MMMM");
                        }
                        else
                        {
                            DateTime aux2 = aux.AddYears(1);
                            resp = aux2.ToString("yyyy MMMM");
                        }
                    }
                    else
                    {
                        resp = (DateTime.Now).ToString("yyyy MMMM");
                    }

                    clase.InsertMonthListRegular(resp, name);
                }
                claseaux.Total   = getTotal(ClasesListFiniShed);
                claseaux.Precio += getTotal(ClasesListFiniShed);

                Ticket1.TextoExtremos("Total", claseaux.Total);
                Ticket1.AgregaLinea(1);
                Ticket1.LineasAsterisco();
                Ticket1.AgregaLinea(2);
                Ticket1.TextoCentro("Las clases abonadas vencen");
                Ticket1.TextoCentro("el dia " + creaTextoFinal());
                Ticket1.AgregaLinea(2);
                Ticket1.TextoIzquierda(UppercaseFirst(Usuario.getUsuarioActual()));
                Ticket1.CortaTicket();

                flag = false;

                claseaux.CargaExcelDia(nombreExceldia, Global, savedia, DateTime.Now.ToString("dd/MM/yyyy"), number.ToString(fmt), name);
                claseaux.CargaExcelMes(nombreExcelmes, Global, savemes, DateTime.Now.ToString("dd/MM/yyyy"), number.ToString(fmt), name);
                claseaux.addComprobante(ClasesListFiniShed, name, number.ToString(fmt), DateTime.Now.ToString("dd/MM/yyyy"));
                claseaux.IncrementServerRecibosNumber();
                ClasesListFiniShed.Clear();
                this.DialogResult = DialogResult.OK;
            }
        }
        private void button1_Click_12(object sender, EventArgs e)
        {
            bool flag  = true;
            bool flag2 = true;

            string descripcion = String.Empty;

            if (MessageBox.Show("Desea Imprimir el comprobante?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                string carpeta = Global.getDire();
                printer = Global.getImpresora();
                // genera las carpetas a guardar
                string nombreExceldia = @carpeta + "\\Diario\\" + dateTimePicker1.Value.ToString("yyyyMMdd");
                string savedia        = nombreExceldia + ".xlsx";
                string nombreExcelmes = @carpeta + "\\Mensual\\" + dateTimePicker1.Value.ToString("yyyyMMMM");
                string savemes        = nombreExcelmes + ".xlsx";


                Clase      claseaux2 = new Clase();
                var        number    = claseaux2.LastNumberServerRecibos();
                string     fecha     = "Fecha " + DateTime.Today.ToString("d");
                string     hora      = "Hora " + DateTime.Now.ToString("HH:mm");
                CreaTicket Ticket1   = new CreaTicket();
                //CREA EL PRIMER TICKET


                string Usuarioaux = Usuario.getUsuarioActual();
                claseaux.Usuario = Usuarioaux;


                foreach (var clase in ClasesListFiniShed)
                {
                    if (!(string.IsNullOrEmpty(clase.Diferencia_Comprobante_Numero)))
                    {
                        claseaux.Diferencia_Comprobante_Numero = clase.Diferencia_Comprobante_Numero;
                        flag2 = false;
                    }
                    else
                    {
                        claseaux.Diferencia_Comprobante_Numero = string.Empty;
                    }

                    makeRecipeByClaseAux(clase, dateTimePicker1.Value.ToString("yyyy/MM/dd"), Ticket1, flag);

                    string resp = string.Empty;
                    if (IsForNext)
                    {
                        DateTime date = DateTime.Now;
                        DateTime aux  = date.AddMonths(1);
                        if (!(aux.ToString("MMMM") == "enero"))
                        {
                            resp = aux.ToString("yyyy MMMM");
                        }
                        else
                        {
                            DateTime aux2 = aux.AddYears(1);
                            resp = aux2.ToString("yyyy MMMM");
                        }
                    }
                    else
                    {
                        resp = (DateTime.Now).ToString("yyyy MMMM");
                    }

                    clase.InsertMonthListRegular(resp, name);
                }



                claseaux.CargaExcelDia(nombreExceldia, Global, savedia, DateTime.Now.ToString("dd/MM/yyyy"), number.ToString(fmt), name);
                claseaux.CargaExcelMes(nombreExcelmes, Global, savemes, DateTime.Now.ToString("dd/MM/yyyy"), number.ToString(fmt), name);
                claseaux.addComprobante(ClasesListFiniShed, name, number.ToString(fmt), DateTime.Now.ToString("dd/MM/yyyy"));
                if (flag2 == false)
                {
                    claseaux.addComprobanteDiferencia(number.ToString(fmt));
                }
                claseaux.IncrementServerRecibosNumber();
                ClasesListFiniShed.Clear();
                this.DialogResult = DialogResult.OK;
                //string name, string price, string teacher, string amount, string clasesTotal)

                /*
                 * Form1 frm4 = new Form1();
                 * frm4.Show();*/
            }
        }
Exemple #16
0
 public MyOwnListViewItem(Clase clase)
 {
     clase.getPrice();
     this.clase = clase;
     Update();
 }
            public MyOwnListViewItem(Clase clase)
            {
                this.clase = clase;

                Update();
            }
Exemple #18
0
        //HACER EL IMPRIME TODAS LAS LISTAS DE TODAS LAS CLASES
        private void button3_Click_2(object sender, EventArgs e)
        {
            var    mes       = dateTimePicker1.Value.Month;
            string monthName = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(mes);

            string direccion = string.Empty;
            FolderBrowserDialog folderBrowser = new FolderBrowserDialog();
            DialogResult        result        = folderBrowser.ShowDialog();

            if (result == DialogResult.OK)
            {
                direccion = folderBrowser.SelectedPath;
            }
            if (MessageBox.Show("Desea Imprimir la Lista de Alumnos de Todas las Clases de " + monthName + "?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                foreach (var profesor in profesores)
                {
                    Clase auxClase = new Clase();
                    auxClase.Profesor = profesor;
                    auxClase.getClases(profesor);
                    foreach (var clase in auxClase.Clases)
                    {
                        string save = DateTime.Now.ToString("yyyy ") + monthName + " " + clase + " " + profesor;
                        auxClase.getAlumnoForList(profesor, clase);

                        object            misValue = System.Reflection.Missing.Value;
                        Excel.Application xlApp    = new Excel.Application();
                        Excel.Workbook    xlWorkbook;
                        Excel._Worksheet  xlWorksheet;
                        if (!System.IO.File.Exists(save))
                        {
                            xlWorkbook  = xlApp.Workbooks.Add(misValue);
                            xlWorksheet = (Excel.Worksheet)xlWorkbook.Worksheets.get_Item(1);
                            Excel.Range xlRange  = xlWorksheet.UsedRange;
                            int         rowCount = xlRange.Rows.Count;

                            //Titulos Grandes
                            xlRange.Cells[2, "A"] = "Profesor: " + profesor;
                            xlRange.Cells[2, "C"] = "Curso: " + clase;
                            xlRange.Cells[1, "H"] = DateTime.Now.ToString("yyyy ") + monthName;

                            //Titulos Lista
                            xlRange.Cells[4, "B"] = "Nombre y Apellido";
                            xlRange.Cells[4, "C"] = "Pago";



                            Dictionary <string, int> DiasDeCurso = auxClase.RetriveDays(profesor);

                            string         First = string.Empty;
                            AllDayMinClass resp  = new AllDayMinClass();
                            foreach (var dia in DiasDeCurso)
                            {
                                DayMinClase diaSpecific = new DayMinClase(dia.Key, dia.Value, dateTimePicker1.Value.Month);
                                resp.add(diaSpecific);
                            }
                            int start    = 8;
                            int cantDias = resp.getWholeDays();
                            while (resp.Any())
                            {
                                int         amountBefore = start;
                                DayMinClase aux          = resp.getMin();
                                start += aux.CantidadDeClasesPorDia;
                                foreach (var specificDay in aux.Dias)
                                {
                                    xlRange.Cells[3, amountBefore] = aux.Day;
                                    xlRange.Cells[4, amountBefore] = specificDay;

                                    /*xlWorksheet.Range[xlWorksheet.Cells[4, (letter + amountBefore)], xlWorksheet.Cells[4, (letter + amountBefore + aux.CantidadDeClasesPorDia)]].Merge();
                                     */
                                    amountBefore += cantDias;
                                }
                            }

                            int countAlumnos = 1;
                            int place        = countAlumnos + 4;

                            foreach (var alumno in auxClase.Alumnos)
                            {
                                xlRange.Cells[place, "A"] = countAlumnos.ToString();
                                xlRange.Cells[place, "B"] = alumno;
                                place++;
                                countAlumnos++;
                            }

                            xlRange.Cells[place + 5, "A"] = "Cantidad Total de Alumnos";
                            xlRange.Cells[place + 6, "A"] = "Firma del Profesor";

                            xlWorksheet.Range[xlWorksheet.Cells[4, "C"], xlWorksheet.Cells[4, "G"]].Merge();
                            xlWorksheet.Range[xlWorksheet.Cells[place + 5, "A"], xlWorksheet.Cells[place + 5, "G"]].Merge();
                            xlWorksheet.Range[xlWorksheet.Cells[place + 6, "A"], xlWorksheet.Cells[place + 6, "G"]].Merge();

                            xlWorksheet.Range[xlWorksheet.Cells[1, "A"], xlWorksheet.Cells[3, "B"]].Merge();
                            xlWorksheet.Range[xlWorksheet.Cells[1, "C"], xlWorksheet.Cells[3, "G"]].Merge();


                            xlWorksheet.Columns[2].ColumnWidth = 20;
                            for (var i = 3; i < 35; i++)
                            {
                                if (i < 8)
                                {
                                    xlWorksheet.Columns[i].ColumnWidth = 5;
                                }
                                else
                                {
                                    xlWorksheet.Columns[i].ColumnWidth = 3.5;
                                }
                            }



                            /*
                             * xlWorksheet.Range[xlWorksheet.Cells[place + 5, "A"], xlWorksheet.Cells[3, "G"]].Merge();
                             * xlWorksheet.Range[xlWorksheet.Cells[place + 6, "A"], xlWorksheet.Cells[3, "G"]].Merge();*/



                            /*xlWorksheet.Range[xlWorksheet.Cells[1, "H"], xlWorksheet.Cells[1, 8 + resp.getTotalDays()]].Merge();
                             * xlWorksheet.Range[xlWorksheet.Cells[1, "H"], xlWorksheet.Cells[1, 8 + resp.getTotalDays()]].Font.Bold = true;
                             * xlWorksheet.Range[xlWorksheet.Cells[2, "C"], xlWorksheet.Cells[2, "G"]].Merge();
                             *
                             * xlWorksheet.Range[xlWorksheet.Cells[2, "C"], xlWorksheet.Cells[2, "D"]].Merge();
                             * xlWorksheet.Range[xlWorksheet.Cells[4, "A"], xlWorksheet.Cells[place + 6, resp.getTotalDays()]].Borders.Weight = Excel.XlBorderWeight.xlMedium;
                             * xlWorksheet.Range[xlWorksheet.Cells[1, "H"], xlWorksheet.Cells[place + 6, resp.getTotalDays()]].Borders.Weight = Excel.XlBorderWeight.xlMedium;
                             */

                            xlWorkbook.SaveAs(direccion + "\\" + save + ".xlsx");
                            xlWorkbook.Close();
                            xlApp.Quit();

                            Marshal.ReleaseComObject(xlWorksheet);
                            Marshal.ReleaseComObject(xlWorkbook);
                            Marshal.ReleaseComObject(xlApp);
                        }
                    }
                }
            }
        }
        private void button3_Click_5(object sender, EventArgs e)
        {
            bool   flag2       = true;
            bool   flag        = true;
            string descripcion = String.Empty;

            if (MessageBox.Show("Desea Imprimir el comprobante?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                string carpeta = Global.getDire();
                printer = Global.getImpresora();
                // genera las carpetas a guardar
                string nombreExceldia = @carpeta + "\\Diario\\" + dateTimePicker1.Value.ToString("yyyyMMdd");
                string savedia        = nombreExceldia + ".xlsx";
                string nombreExcelmes = @carpeta + "\\Mensual\\" + dateTimePicker1.Value.ToString("yyyyMMMM");
                string savemes        = nombreExcelmes + ".xlsx";

                Clase      claseaux2 = new Clase();
                var        number    = claseaux2.LastNumberServerRecibos();
                string     fecha     = "Fecha " + DateTime.Today.ToString("d");
                string     hora      = "Hora " + DateTime.Now.ToString("HH:mm");
                CreaTicket Ticket1   = new CreaTicket();
                //CREA EL PRIMER TICKET


                Ticket1.impresora = printer;
                Ticket1.AgregaLinea(2);
                Ticket1.TextoExtremos(fecha, hora);
                Ticket1.AgregaLinea(1);
                Ticket1.AgregaLinea(1);
                Ticket1.TextoIzquierda(name);
                Ticket1.AgregaLinea(1);
                Ticket1.LineasGuion();


                foreach (var clase in ClasesListFiniShed)
                {
                    if (!(string.IsNullOrEmpty(clase.Diferencia_Comprobante_Numero)))
                    {
                        claseaux.Diferencia_Comprobante_Numero = clase.Diferencia_Comprobante_Numero;
                        flag2 = false;
                    }
                    else
                    {
                        claseaux.Diferencia_Comprobante_Numero = string.Empty;
                    }



                    AuxMakeRec(clase, dateTimePicker1.Value.ToString("yyyy/MM/dd"), Ticket1, flag);
                }

                Ticket1.TextoExtremos("Total", claseaux.Total);
                Ticket1.AgregaLinea(1);
                Ticket1.LineasAsterisco();
                Ticket1.AgregaLinea(2);
                Ticket1.TextoCentro("Las clases abonadas vencen");
                Ticket1.TextoCentro("el dia " + creaTextoFinal());
                Ticket1.AgregaLinea(2);
                try
                {
                    Ticket1.TextoIzquierda(UppercaseFirst(Usuario.getUsuarioActual()));
                }
                catch { }
                Ticket1.TextoIzquierda(UppercaseFirst(Usuario.getUsuarioActual()));
                Ticket1.CortaTicket();

                flag = false;
            }
        }
Exemple #20
0
        private void form()
        {
            /*
             * ClaseParaEnviar.ClasesTomar = checkedListBox1.CheckedItems.Cast<object>().Aggregate(string.Empty, (current, item) => current + item.ToString());
             * if (ClaseParaEnviar.ClasesTomar == "")
             *  //ClaseParaEnviar.Precio = checkedListBox2.CheckedItems.Cast<object>().Aggregate(string.Empty, (current, item) => current + item.ToString());
             * ClaseParaEnviar.Precio = checkedListBox2.SelectedItem.ToString();
             * MessageBox.Show(checkedListBox2.SelectedItem.ToString());
             * int cantidad = Convert.ToInt32(checkedListBox3.CheckedItems.Cast<object>().Aggregate(string.Empty, (current, item) => current + item.ToString()));
             * ClaseParaEnviar.Total =  ((Convert.ToInt32(ClaseParaEnviar.Precio)) * cantidad).ToString();
             * ClaseParaEnviar.CantidadClases = "Cuota Curso";
             * ClaseParaEnviar.cantidadElegidos = checkedListBox3.CheckedItems.Cast<object>().Aggregate(string.Empty, (current, item) => current + item.ToString());
             * ClaseParaEnviar.Descripcion = "Curso de " + checkedListBox1.CheckedItems.Cast<object>().Aggregate(string.Empty, (current, item) => current + item.ToString());
             */
            Clase claseAux = new Clase();

            claseAux.Precio           = checkedListBox2.SelectedItem.ToString();
            claseAux.ClasesTomar      = checkedListBox1.SelectedItem.ToString();
            claseAux.cantidadElegidos = checkedListBox3.SelectedItem.ToString();
            claseAux.CantidadClases   = "Curso";
            double total = Convert.ToInt32(claseAux.Precio) * Convert.ToInt32(claseAux.cantidadElegidos);

            if (checkBox1.Checked)
            {
                total            = total * 0.5;
                claseAux.EsSenia = true;
            }
            claseAux.Total       = total.ToString();
            claseAux.Descripcion = "Curso de: " + claseAux.ClasesTomar;


            Curso auxCurso = new Curso();

            auxCurso.Nombre = claseAux.ClasesTomar;
            auxCurso.getPrecio();
            auxCurso.getProfesor(); string aux = string.Empty;
            if (auxCurso.Profesor == "Aldo")
            {
                claseAux.Profesor = "Profesor Aldo";
            }
            else
            {
                claseAux.Profesor = auxCurso.Profesor;
            }

            if (auxCurso.Horarios.Any())
            {
                this.Hide();
                Horario_Curso_Select newCurso = new Horario_Curso_Select(auxCurso.Horarios);
                newCurso.ShowDialog();
                this.Show();
                claseAux.Horarios = newCurso.HorarioSelect;
            }
            else
            {
                List <string> horariosaux = new List <string>();
                horariosaux.Add(auxCurso.Horario);
                claseAux.Horarios = horariosaux;
            }



            ClasesList.Add(claseAux);
        }