public Boolean EntregaFinalNew(EntregaFinalBE eBE) { con.ConnectionString = conection.GetCon(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "DOCUMENTO.EntregaFinalNew"; bool success; try { cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@id_proyecto", eBE.Id_proyecto); cmd.Parameters.AddWithValue("@id_encargado", eBE.Id_encargado); cmd.Parameters.AddWithValue("@fecha", eBE.Fecha); cmd.Parameters.AddWithValue("@path_scan_reporte", eBE.Path_scan_reporte); con.Open(); cmd.ExecuteNonQuery(); success = true; } catch (SqlException x) { success = false; throw new Exception(x.Message); } finally { if (con.State == ConnectionState.Open) { con.Close(); } cmd.Parameters.Clear(); } return(success); }
public EntregaFinalBE ListarEntregaPorId(int idDocumento) { EntregaFinalBE entBE = new EntregaFinalBE(); try { con.ConnectionString = conection.GetCon(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "DOCUMENTO.ListarEntregaFinalPorId"; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@id_documento", idDocumento); con.Open(); SqlDataReader dtr = cmd.ExecuteReader(); if (dtr.HasRows == true) { dtr.Read(); entBE.Id_documento = int.Parse(dtr["id_documento"].ToString()); entBE.Id_proyecto = int.Parse(dtr["id_proyecto"].ToString()); entBE.Id_encargado = int.Parse(dtr["id_encargado"].ToString()); entBE.Path_scan_reporte = dtr["path_scan_reporte"].ToString(); entBE.Fecha = Convert.ToDateTime(dtr["fecha"]); } else { throw new Exception("Error al buscar el documento."); } dtr.Close(); } catch (Exception ex) { throw new Exception(ex.Message); } finally { if (con.State == ConnectionState.Open) { con.Close(); } cmd.Parameters.Clear(); } return(entBE); }
public Boolean ModificarEntregaFinal(EntregaFinalBE eBE) { return(entregaFinal.ModificarEntregaFinal(eBE)); }
public Boolean EntregaFinalNew(EntregaFinalBE eBE) { return(entregaFinal.EntregaFinalNew(eBE)); }