/// <summary> /// Transforma un DDPNotificationType en un DDPNotification /// </summary> /// <param name="ddpNotification">DDPNotificationType</param> /// <returns>DDPNotification</returns> public static DDPNotification Map2DB(DataCenterLogic.DataCenterTypes.DDPNotificationType ddpNotification) { DDPNotification retDDPNotification = new DDPNotification(); retDDPNotification.Message = ddpNotification.Message; retDDPNotification.MessageId = ddpNotification.MessageId; retDDPNotification.MessageType = ToInt(ddpNotification.MessageType); retDDPNotification.NewVersionNum = ddpNotification.NewVersionNum; retDDPNotification.schemaVersion = ddpNotification.schemaVersion; retDDPNotification.test = ToInt(ddpNotification.test); retDDPNotification.TimeStamp = ddpNotification.TimeStamp; retDDPNotification.UpdateType = ToInt(ddpNotification.UpdateType); return(retDDPNotification); }
/// <summary> /// Crea un nuevo DDPNotification en la base de datos /// </summary> /// <param name="ddpNotification">DDPNotification</param> public void Create(DDPNotification ddpNotification, int inOut) { ddpNotification.MsgInOut = new MsgInOut(); ddpNotification.MsgInOut.DDPVersion = ""; ddpNotification.MsgInOut.Destination = ""; ddpNotification.MsgInOut.InOut = inOut; ddpNotification.MsgInOut.MsgId = ddpNotification.MessageId; ddpNotification.MsgInOut.MsgType = ddpNotification.MessageType; ddpNotification.MsgInOut.RefId = ""; ddpNotification.MsgInOut.Source = ""; ddpNotification.MsgInOut.TimeStamp = ddpNotification.TimeStamp; context.DDPNotifications.InsertOnSubmit(ddpNotification); context.SubmitChanges(); }