public static WFSublimacionPedidos ObtenerPedido(int transId) { WFSublimacionPedidos pedido = null; SqlDataReader dr = SqlHelper.ExecuteReader(ConfigurationManager.AppSettings[Global.CfgKeyConnString], Queries.WF_ObtenerTransaccion, transId); if (dr.Read()) { pedido = new WFSublimacionPedidos(); pedido._transId = dr.GetInt32(0); pedido._tipoTransId = dr.GetBoolean(1) ? 1 : 0; pedido._motivoId = dr.GetInt32(2); pedido._empleadoId = dr.GetInt32(3); pedido._centroId = dr.GetInt32(4); pedido._estatusId = dr.GetInt32(5); pedido._ultimoUsuarioId = dr.GetInt32(6); pedido._numTrans = dr.GetString(7); pedido._ivaAplicable = dr.GetDecimal(8); pedido._montoTotal = dr.GetDecimal(9); pedido._fechaTrans = dr.GetDateTime(10); pedido._fechaActual = dr.GetDateTime(11); pedido._fechaDeEntrega = dr.GetDateTime(12); pedido._observaciones = dr.GetString(13); } return(pedido); }
public static int InsertarPedido(WFSublimacionPedidos pedido) { int nResultado = 0; try { object obj = SqlHelper.ExecuteScalar(ConfigurationManager.AppSettings[Global.CfgKeyConnString], Queries.WF_InsertarTransaccion, pedido._transId, pedido._tipoTransId == 1 ? true : false, pedido._motivoId, pedido._empleadoId, pedido._centroId, pedido._estatusId, pedido._ultimoUsuarioId, pedido._numTrans, pedido._ivaAplicable, pedido._montoTotal, pedido._fechaTrans, pedido._fechaActual, pedido._fechaDeEntrega, pedido._observaciones ); if (obj != null) { nResultado = Convert.ToInt32(obj); } } catch (Exception) //ex) { //String cm = String.Empty; //EventLog.WriteEntry("Clever", "Clase Bonos: " + ex.Message, EventLogEntryType.Error, 232); } pedido._transId = nResultado; return(nResultado); }