public List <filas> Datos_Tabla_1(List <string> Todos_Carriles, List <string> Carriles, DateTime Fecha, string Turno, string Plaza) { string Fecha_List = Fecha.ToString("dd/MM/yyyy"); int _Turno = Convert.ToInt32(Turno); ListaCarrilesExclusivos = Busca_Carriles_Exclusivos(Plaza); DataTable dt = new DataTable(); dt = Llena_Table(Carriles, Fecha, Turno, Plaza); try { Lista = (from DataRow item in dt.Rows select new Linq { Carril = Convert.ToString(item["VOIE"]), TipoCarril = Convert.ToString(item["ID_VOIE"]), Turno = Convert.ToString(item["SHIFT_NUMBER"]), Pago = Convert.ToString(item["ID_PAIEMENT"]), Transacion = Convert.ToString(item["EVENT_NUMBER"]), Fecha = Convert.ToString(item["DATE_DEBUT_POSTE"]), Hora = Convert.ToString(item["DATE_TRANSACTION"]), Pre = Convert.ToString(item["ID_CLASSE"]), Cajero = Convert.ToString(item["TAB_ID_CLASSE"]), Post = Convert.ToString(item["ACD_CLASS"]), }).ToList(); var Carriles_Linq = Lista.GroupBy(x => x.Carril) .Select(g => g.Key) .ToList(); var noExisten = Carriles_Linq.Except(Carriles).ToList(); for (int i = 0; i < Carriles.Count; i++) { filas newfila = new filas(); newfila.Id = i; newfila.Carril = Carriles[i].ToString(); newfila.Fecha = Fecha_List; newfila.Turno = Busca_Turno(Turno); newfila.Discrepancias_Pre = Discrepancias_Pre(Carriles, i, _Turno); newfila.Eficiencia_Pre = Eficiencia_Pre(Carriles, i, _Turno); newfila.Eficiencia_Dia_Pre = "-"; newfila.Discrepancias_Post = Discrepancias_Post(Carriles, i, _Turno); newfila.Eficiencia_Post = Eficiencia_Post(Carriles, i, _Turno); newfila.Eficiencia_Dia_Post = "-"; newfila.Cruces = Cruces(Carriles, i, _Turno); Lista_Completa.Add(newfila); } } catch (Exception ex) { } return(Lista_Completa); }
/// <summary> /// Validar Comentarios /// </summary> /// <param name="FechaInicioD"></param> /// <param name="FechaSelect"></param> /// <param name="TempTurno"></param> /// <returns></returns> //public List<filas> ValidarComentarios(DateTime FechaInicioD, DateTime FechaSelect, string TempTurno) public string ValidarComentarios(DateTime FechaSelect, string TempTurno, string Conexion) { OracleCommand Cmd = new OracleCommand(); OracleConnection Connection = new OracleConnection(Conexion); BanValidaciones = true; DataSet ds = new DataSet(); DataTable dt = new DataTable(); //Connection.ConnectionString = ConfigurationManager.ConnectionStrings["OracleDbContext"].ConnectionString; string rpt = string.Empty; string FechaInicio = string.Empty; string FechaFinal = string.Empty; string TurnoP = string.Empty; switch (TempTurno) { case "22:00 - 06:00": TurnoP = "1"; FechaInicio = FechaSelect.AddDays(-1).ToString("MM/dd/yyyy") + " 22:00:00"; FechaFinal = FechaSelect.ToString("MM/dd/yyyy") + " 05:59:59"; break; case "06:00 - 14:00": TurnoP = "2"; FechaInicio = FechaSelect.ToString("MM/dd/yyyy") + " 06:00:00"; FechaFinal = FechaSelect.ToString("MM/dd/yyyy") + " 13:59:59"; break; case "14:00 - 22:00": TurnoP = "3"; FechaInicio = FechaSelect.ToString("MM/dd/yyyy") + " 14:00:00"; FechaFinal = FechaSelect.ToString("MM/dd/yyyy") + " 21:59:59"; break; } // Valida que se hayan capturado los comentarios en la entrega de Bolsa // SE MODIFICIO DATE_FIN_POSTE POR C.DATE_DEBUT_POSTE [RODRIGO] string Query = @"SELECT " + "C.COMMENTAIRE AS COMENTARIOS, " + "C.SAC AS BOLSA, " + "C.OPERATING_SHIFT AS TURNO, " + "C.DATE_REDDITION AS FECHA, " + "C.RED_TXT1, " + "''||C.RED_TXT1||' bolsa '||TO_CHAR(C.SAC)||' '||A.MATRICULE||'/'|| A.NOM ||' ' AS Aviso " + "FROM REDDITION C " + "LEFT JOIN TABLE_PERSONNEL A ON C.Matricule = A.Matricule " + "WHERE DATE_REDDITION " + "BETWEEN to_date('" + FechaInicio + "' ,'mm-dd-yyyy HH24:mi:SS') " + "AND to_date('" + FechaFinal + "' ,'mm-dd-yyyy HH24:mi:SS') " + " AND COMMENTAIRE IS NULL AND C.OPERATING_SHIFT = " + TurnoP; Connection.Open(); Cmd.CommandText = Query; Cmd.Connection = Connection; OracleDataAdapter myAdapter = new OracleDataAdapter(Cmd); OracleDataReader DataReader = Cmd.ExecuteReader(); while (DataReader.Read()) { BanValidaciones = false; myAdapter.Fill(dt); Message += DataReader["Aviso"].ToString(); // break; } //List<filas> filass = new List<filas>(); foreach (DataRow indi in dt.Rows) { filas datos = new filas(); datos.bolsa = indi["BOLSA"].ToString(); datos.red = indi["RED_TXT1"].ToString(); datos.turno = indi["TURNO"].ToString(); listass.Add(datos); break; } ControlesExportar model = new ControlesExportar(); model.Listacomentarios = listass; Connection.Close(); rpt = BanValidaciones == true ? "OK" : "STOP"; return(rpt); //return listass; }