Esempio n. 1
0
        private void button_Usos_Click(object sender, EventArgs e)
        {
            switch (frmPpal.USUARIO)
            {
            case "3":      //ENDUMAR
                frmEmpr03 frmEmpr03 = new frmEmpr03();
                frmEmpr03.CnO = CnO;
                frmEmpr03.Show();
                break;

            case "4":      //BOTELLA
                frmEmpr04 frmEmpr04 = new frmEmpr04();
                frmEmpr04.Show();
                break;

            case "5":      //DIALPESCA
                frmEmpr05 frmEmpr05 = new frmEmpr05();
                frmEmpr05.CnO = CnO;
                frmEmpr05.Show();
                break;

            case "6":      //ABT
                frmEmpr05 frmEmpr06 = new frmEmpr05();
                frmEmpr06.CnO = CnO;
                frmEmpr06.Show();
                break;

            case "7":      //FRIOMED
                break;

            case "8":      //VALPEIX
                frmEmpr05 frmEmpr08 = new frmEmpr05();
                frmEmpr08.CnO = CnO;
                frmEmpr08.Show();
                break;

            case "9":      //CEFALOPODOS
                frmEmpr09 frmEmpr09 = new frmEmpr09();
                frmEmpr09.Show();
                //Form1 f1 = new Form1();
                //f1.Show();
                break;

            default:
                break;
            }
        }  //private void button_Usos_Click(object sender, EventArgs e)
        private void button_Exportar_Click(object sender, EventArgs e)
        {
            string gIdent = this.GetType().FullName + " " + System.Reflection.MethodBase.GetCurrentMethod().Name;

            GloblaVar.gUTIL.ATraza(gIdent + "Click en exportar ");

            switch (GloblaVar.TIPO_REPORT)
            {
            case 1:
                break;

            case 2:
                break;

            case 3:
                break;

            case 4:
                GloblaVar.sQReport  = "SELECT     VENALB_CABE.VenAlb, VENALB_CABE.VenFec, VENALB_CABE.DetCod, VENALB_CABE.VenTve, VENALB_CABE.VenBru, VENALB_CABE.VenIva, ";
                GloblaVar.sQReport += " VENALB_CABE.VenRec, VENALB_CABE.VenTot, VENALB_CABE.FechaDiskette, VENALB_CABE.Anulado, VENALB_CABE.IdCobro, ";
                GloblaVar.sQReport += "VENALB_CABE.FechaCobro, DETALLISTAS.DetNom, DETALLISTAS.DetMay,VENALB_CABE.ValidacionTarjeta ";
                GloblaVar.sQReport += " FROM         VENALB_CABE INNER JOIN";
                GloblaVar.sQReport += " DETALLISTAS ON VENALB_CABE.DetCod = DETALLISTAS.DetCod";
                GloblaVar.sQReport += " WHERE ";
                GloblaVar.sQReport += " (VENALB_CABE.VenFec BETWEEN '" + dateTimePicker_Inicio.Value.Date.ToShortDateString() + "' AND '" + dateTimePicker_Fin.Value.ToShortDateString() + "') ";
                GloblaVar.sQReport += " AND ";
                GloblaVar.sQReport += " VENALB_CABE.Anulado<>1 ";
                GloblaVar.sQReport += " AND ";
                GloblaVar.sQReport += " VENALB_CABE.VenTve=4 ";
                GloblaVar.sQReport += " AND ";
                GloblaVar.sQReport += " DETALLISTAS.DetCod IN ";
                GloblaVar.sQReport += "(SELECT DetCod FROM DETALLISTAS WHERE DetMay<>'' AND (DetCod BETWEEN " + tDetIni.Text + " AND " + tDetFin.Text + "))";
                if (ListDetExc.Items.Count > 0)
                {
                    GloblaVar.sQReport += " AND DETALLISTAS.DetCod NOT IN ( ";
                    foreach (object item in ListDetExc.Items)
                    {
                        //L1.Items.Add(Funciones.DameNomDet(item.ToString()));
                        GloblaVar.sQReport += item.ToString() + ",";
                    }
                    GloblaVar.sQReport  = GloblaVar.sQReport.Substring(0, GloblaVar.sQReport.Length - 1);
                    GloblaVar.sQReport += ")";
                }
                if (ListDetInc.Items.Count > 0)
                {
                    GloblaVar.sQReport += " AND DETALLISTAS.DetCod  IN ( ";
                    foreach (object item in ListDetInc.Items)
                    {
                        //L1.Items.Add(Funciones.DameNomDet(item.ToString()));
                        GloblaVar.sQReport += item.ToString() + ",";
                    }
                    GloblaVar.sQReport  = GloblaVar.sQReport.Substring(0, GloblaVar.sQReport.Length - 1);
                    GloblaVar.sQReport += ")";
                }
                GloblaVar.TeMp = "INFORME ENVIO OREMAPE 1";
                frmEmpr04 frm2 = new frmEmpr04();
                frm2.Show();
                this.Close();

                break;

            default:
                break;
            }
        } //private void tArtFin_KeyPress(object sender, KeyPressEventArgs e)