public void OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction) { try { Mensajes_Models M = new Mensajes_Models().SelectMensaje(int.Parse(context.BackgroundJob.Id)); if (M != null) { M.men_fechamodif = DateTime.Now; M.men_estado = context.NewState.Name; M.InsertUpdateMensajes(M); } var failedState = context.NewState as FailedState; if (failedState != null) { Logger.ErrorException( String.Format("Background job #{0} was failed with an exception.", context.BackgroundJob.Id), failedState.Exception); } else { } } catch (Exception) { throw; } }
// SMS Envio public static Resultados_Models EnviarSMS(string phone, string port, string mensaje, int men_id = 0) { Resultados_Models R = SynWayAPI_models.EnvioSMS(SynWayAPI_models.Envios_Types.SendSMS, phone, port, mensaje); if (men_id > 0) { Mensajes_Models M = new Mensajes_Models().SelectMensajexID(men_id); M.men_resultado = R.res_cantidad + ":" + "[" + R.res_contenido.result + "]" + R.res_contenido.content; M.InsertUpdateMensajes(M); } return(R); }