예제 #1
0
파일: grupoBO.cs 프로젝트: tinovo/Sitio
        //public DataTable BuscaGruposxGrupo(grupos objGrupos)
        //{
        //    grupoOracleDO MyGrupoDO = new grupoOracleDO();
        //    return MyGrupoDO.BuscaGruposxGrupo(objGrupos);

        //}


        public DataTable BuscaGruposxGrupo(String obStrjGrupos)
        {
            
            //grupoOracleDO MyGrupoDO = new grupoOracleDO();
            grupos objGrupos = new grupos();
            objGrupos.Idgrupo = obStrjGrupos;

            grupoOracleDO MyGrupoDO = new grupoOracleDO();
            return MyGrupoDO.BuscaGruposxGrupo(objGrupos);

        }
예제 #2
0
        public DataTable BuscaGruposxGrupo(grupos objGrupos)
        {
            try
            {

                System.Data.DataTable table = new DataTable();

                if (objGrupos.Idgrupo != null && (objGrupos.Idgrupo.Trim() == "GER" || objGrupos.Idgrupo.Trim() == "DIR" || objGrupos.Idgrupo.Trim() == "JCS" || objGrupos.Idgrupo.Trim() == "JACK"))
                {
                    DataColumn column;
                    DataRow row;

                    column = new DataColumn();
                    column.DataType = System.Type.GetType("System.String");
                    column.ColumnName = "idgrupo";
                    // Add the Column to the DataColumnCollection.
                    table.Columns.Add(column);

                    // Create second column.
                    column = new DataColumn();
                    column.DataType = System.Type.GetType("System.String");
                    column.ColumnName = "grupo";
                    // Add the column to the table.
                    table.Columns.Add(column);

                    //for (int i = 0; i <= 2; i++)
                    //{
                    row = table.NewRow();
                    row["idgrupo"] = "0";
                    row["grupo"] = "-- Seleccione --";
                    table.Rows.Add(row);

                    row = table.NewRow();
                    row["idgrupo"] = "ALMV";
                    row["grupo"] = "ALIMENTOS POR VIATICOS";
                    table.Rows.Add(row);

                    row = table.NewRow();
                    row["idgrupo"] = "HTL";
                    row["grupo"] = "GASTOS DE HOTEL";
                    table.Rows.Add(row);

                    row = table.NewRow();
                    row["idgrupo"] = "AUTO";
                    row["grupo"] = "COMBUSTIBLE";
                    table.Rows.Add(row);

                    row = table.NewRow();
                    row["idgrupo"] = "REA";
                    row["grupo"] = "RENTA DE ATOMOVILES";
                    table.Rows.Add(row);

                    row = table.NewRow();
                    row["idgrupo"] = "TAXI";
                    row["grupo"] = "SERVICIO DE TAXI";
                    table.Rows.Add(row);

                    row = table.NewRow();
                    row["idgrupo"] = "TRAN";
                    row["grupo"] = "PASAJE TERRESTRE";
                    table.Rows.Add(row);

                    row = table.NewRow();
                    row["idgrupo"] = "GPA";
                    row["grupo"] = "PASAJES AEREOS";
                    table.Rows.Add(row);

                    row = table.NewRow();
                    row["idgrupo"] = "PEA";
                    row["grupo"] = "PEAJES";
                    table.Rows.Add(row);
                }
                else
                {
                    if (objGrupos.Idgrupo.Trim() == "C5MA" || objGrupos.Idgrupo.Trim() == "C5MO" || objGrupos.Idgrupo.Trim() == "C5MJ" || objGrupos.Idgrupo.Trim() == "C5MG" || objGrupos.Idgrupo.Trim() == "C5MD")
                    {
                        DataColumn column;
                        DataRow row;

                        column = new DataColumn();
                        column.DataType = System.Type.GetType("System.String");
                        column.ColumnName = "idgrupo";
                        // Add the Column to the DataColumnCollection.
                        table.Columns.Add(column);

                        // Create second column.
                        column = new DataColumn();
                        column.DataType = System.Type.GetType("System.String");
                        column.ColumnName = "grupo";
                        // Add the column to the table.
                        table.Columns.Add(column);

                        //for (int i = 0; i <= 2; i++)
                        //{

                        row = table.NewRow();
                        row["idgrupo"] = "0";
                        row["grupo"] = "-- Seleccione --";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5001";
                        row["grupo"] = "COMBUSTIBLES Y LUBRICANTES";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5002";
                        row["grupo"] = "HOSPEDAJE";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5003";
                        row["grupo"] = "LAVANDERIA";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5004";
                        row["grupo"] = "ALIMENTACION";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5005";
                        row["grupo"] = "PEAJE Y ESTACIONAMIENTO";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5006";
                        row["grupo"] = "TAXI";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5007";
                        row["grupo"] = "RENTA DE VEHICULO";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5008";
                        row["grupo"] = "PASAJE TERRESTRE";
                        table.Rows.Add(row);

                        row = table.NewRow();
                        row["idgrupo"] = "5009";
                        row["grupo"] = "PASAJE AEREO";
                        table.Rows.Add(row);


                    }

                    else
                    {



                        if (objGrupos.Idgrupo != null && (objGrupos.Idgrupo.Trim() == "OP" || objGrupos.Idgrupo.Trim() == "AS" || objGrupos.Idgrupo.Trim() == "SIN" || objGrupos.Idgrupo.Trim() == "SIN2"))
                        {
                            DataColumn column;
                            DataRow row;

                            column = new DataColumn();
                            column.DataType = System.Type.GetType("System.String");
                            column.ColumnName = "idgrupo";
                            // Add the Column to the DataColumnCollection.
                            table.Columns.Add(column);

                            // Create second column.
                            column = new DataColumn();
                            column.DataType = System.Type.GetType("System.String");
                            column.ColumnName = "grupo";
                            // Add the column to the table.
                            table.Columns.Add(column);

                            //for (int i = 0; i <= 2; i++)
                            //{

                            row = table.NewRow();
                            row["idgrupo"] = "0";
                            row["grupo"] = "-- Seleccione --";
                            table.Rows.Add(row);

                            row = table.NewRow();
                            row["idgrupo"] = "ALMV";
                            row["grupo"] = "ALIMENTOS POR VIATICOS";
                            table.Rows.Add(row);

                            row = table.NewRow();
                            row["idgrupo"] = "HTL";
                            row["grupo"] = "GASTOS DE HOTEL";
                            table.Rows.Add(row);

                            row = table.NewRow();
                            row["idgrupo"] = "AUTO";
                            row["grupo"] = "COMBUSTIBLE";
                            table.Rows.Add(row);

                            row = table.NewRow();
                            row["idgrupo"] = "TAXI";
                            row["grupo"] = "SERVICIO DE TAXI";
                            table.Rows.Add(row);

                            row = table.NewRow();
                            row["idgrupo"] = "TRAN";
                            row["grupo"] = "PASAJE TERRESTRE";
                            table.Rows.Add(row);

                            row = table.NewRow();
                            row["idgrupo"] = "GPA";
                            row["grupo"] = "PASAJES AEREOS";
                            table.Rows.Add(row);

                            row = table.NewRow();
                            row["idgrupo"] = "PEA";
                            row["grupo"] = "PEAJES";
                            table.Rows.Add(row);

                        }
                        else

                        {
                            DataColumn column;
                            DataRow row;

                            column = new DataColumn();
                            column.DataType = System.Type.GetType("System.String");
                            column.ColumnName = "idgrupo";
                            // Add the Column to the DataColumnCollection.
                            table.Columns.Add(column);

                            // Create second column.
                            column = new DataColumn();
                            column.DataType = System.Type.GetType("System.String");
                            column.ColumnName = "grupo";
                            // Add the column to the table.
                            table.Columns.Add(column);


                            row = table.NewRow();
                            row["idgrupo"] = "0";
                            row["grupo"] = "-- Seleccione --";
                            table.Rows.Add(row);


                        }
                    }
                }
                return table;


            }
            catch (Exception e)
            {
                throw new Exception("Usuario.", e);
            }

        }