public static void AddRepaymentAlarmNotification(Repayment repayment, bool useAlarm)
 {
     string name = repayment.Id.ToString();
     if (ScheduledActionService.GetActions<ScheduledNotification>().FirstOrDefault<ScheduledNotification>(p => (p.Name == name)) != null)
     {
         try
         {
             ScheduledActionService.Remove(name);
         }
         catch (System.Exception)
         {
         }
     }
     ScheduledNotification action = null;
     if (useAlarm)
     {
         Alarm alarm = new Alarm(name)
         {
             Sound = LocalizedStrings.GetLocailizedResourceUriFrom("/Resources/sounds/RepaymentNotification/RepaymentArrive.{0}.mp3", new object[0])
         };
         action = alarm;
     }
     else
     {
         Reminder reminder = new Reminder(name)
         {
             NavigationUri = new Uri("/Pages/RepaymentManagerViews/RepaymentItemEditor.xaml?action={0}&itemId={1}".FormatWith(new object[] { PageActionType.Edit, repayment.Id }), UriKind.RelativeOrAbsolute),
             Title = LocalizedStrings.GetLanguageInfoByKey("RepaymentNotificationList")
         };
         action = reminder;
     }
     action.RecurrenceType = WarpFrequency(repayment.Frequency);
     action.BeginTime = repayment.RepayAt;
     action.ExpirationTime = repayment.DueDate;
     action.Content = repayment.GetContentUsedForNotification();
     try
     {
         ScheduledActionService.Add(action);
     }
     catch (System.Exception)
     {
     }
 }