public CorteDTO ObtenerCorteProceso(int idcorte) { Ob.CorteDTO corte = new Ob.CorteDTO(); try { IDataParameter[] parametros = new IDataParameter[1]; parametros[0] = new SqlParameter("id", SqlDbType.SmallInt); parametros[0].Value = idcorte; DataTable resultado = conexionbd.EjecutarSPResultSet("corteObtenerCorte", parametros); foreach (DataRow renglon in resultado.Rows) { corte.Id = (short)renglon[0]; corte.IdCorte = (string)renglon[1]; corte.Piezas = (int)renglon[2]; corte.prendaIdDiseño = Convert.ToInt32(renglon[3]); corte.IdPrenda = Convert.ToInt32(renglon[4]); } } catch (Exception ex) { throw ex; } //borra finally { GC.Collect(); } return(corte); }
/// <summary> /// Actualiza el proceso a terminado y no volvera a parecer en la lista de corte /// </summary> /// <param name="corte"></param> /// <returns></returns> public bool ActualizarCorteTerminado(Ob.CorteDTO corte) { try { IDataParameter[] parametros = new IDataParameter[3]; parametros[0] = new SqlParameter("id", SqlDbType.VarChar); parametros[0].Value = corte.Id; parametros[1] = new SqlParameter("FechaEntrega", SqlDbType.DateTime); parametros[1].Value = corte.FechaEntrega; parametros[2] = new SqlParameter("Estado", SqlDbType.Bit); parametros[2].Value = corte.Estado; return(conexionbd.EjecutarSPSinRetorno("ActualizarCorteTerminado", parametros)); } catch (Exception) { throw; } }