/// <summary> /// Transforma un PricingNotificationType en un PricingNotification /// </summary> /// <param name="pricingNotification">PricingNotificationType</param> /// <returns>PricingNotification</returns> static public PricingNotification Map2DB(DataCenterLogic.DataCenterTypes.PricingNotificationType pricingNotification) { PricingNotification retPricingNotification = new PricingNotification(); retPricingNotification.DDPVersion = pricingNotification.DDPVersionNum; retPricingNotification.Message = pricingNotification.Message; retPricingNotification.MessageId = pricingNotification.MessageId; retPricingNotification.MessageType = (int)pricingNotification.MessageType; retPricingNotification.schemaVersion = pricingNotification.schemaVersion; retPricingNotification.Test = (int)pricingNotification.test; retPricingNotification.TimeStamp = pricingNotification.TimeStamp; return(retPricingNotification); }
/// <summary> /// Crea un nuevo PricingNotification en base de datos /// </summary> /// <param name="pricingNotification">PricingNotification</param> public void Create(PricingNotification pricingNotification, int inOut) { pricingNotification.MsgInOut = new MsgInOut(); pricingNotification.MsgInOut.DDPVersion = pricingNotification.DDPVersion; pricingNotification.MsgInOut.Destination = ""; pricingNotification.MsgInOut.InOut = inOut; pricingNotification.MsgInOut.MsgId = pricingNotification.MessageId; pricingNotification.MsgInOut.MsgType = pricingNotification.MessageType; pricingNotification.MsgInOut.RefId = ""; pricingNotification.MsgInOut.Source = ""; pricingNotification.MsgInOut.TimeStamp = pricingNotification.TimeStamp; context.PricingNotifications.InsertOnSubmit(pricingNotification); context.SubmitChanges(); }