Ejemplo n.º 1
0
 public static PaymentAppointment ConvertToAppointPayment(PaymentAppointment appointment,
     PaymentScheduleLineDTO schedule)
 {
     appointment.Subject = schedule.Subject;
     appointment.Body = schedule.Body;
     appointment.End = schedule.End;
     appointment.Start = schedule.Start;
     appointment.Amount = schedule.Amount;
     appointment.IsAllDayEvent = schedule.IsAllDayEvent;
     appointment.UniqueId = schedule.PaymentScheduleLineId.ToString(CultureInfo.InvariantCulture);
     appointment.TimeMarker = GetTimeMarker(schedule.Importance);
     appointment.Category = GetCategory(schedule.ProcessStatus);
     return appointment;
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     实现Appointment转化Appointment
 /// </summary>
 /// <param name="schedule"></param>
 /// <returns></returns>
 public static PaymentAppointment ConvertToAppointPayment(PaymentScheduleLineDTO schedule)
 {
     var appointment = new PaymentAppointment
     {
         Subject = schedule.Subject,
         Body = schedule.Body,
         End = schedule.End,
         Start = schedule.Start,
         Amount = schedule.Amount,
         IsAllDayEvent = schedule.IsAllDayEvent,
         UniqueId = schedule.PaymentScheduleLineId.ToString(CultureInfo.InvariantCulture),
         TimeMarker = GetTimeMarker(schedule.Importance),
         Category = GetCategory(schedule.ProcessStatus)
     };
     return appointment;
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     PaymentAppointment信息复制到PaymentScheduleLineDTO
 /// </summary>
 /// <param name="appointment"></param>
 /// <param name="schedule"></param>
 /// <returns></returns>
 public static PaymentScheduleLineDTO ConvertToPaymentScheduleLine(PaymentAppointment appointment,
     PaymentScheduleLineDTO schedule)
 {
     if (appointment == null)
         throw new Exception("日程不能为空");
     if (schedule == null)
         throw new Exception("付款计划行不能为空");
     schedule.Subject = appointment.Subject;
     schedule.Body = appointment.Body;
     schedule.End = appointment.End;
     schedule.Start = appointment.Start;
     schedule.ScheduleDate = appointment.Start;
     schedule.Amount = appointment.Amount;
     schedule.IsAllDayEvent = schedule.IsAllDayEvent;
     if (appointment.TimeMarker != null)
         schedule.Importance = appointment.TimeMarker.TimeMarkerName;
     if (appointment.Category != null)
         schedule.ProcessStatus = appointment.Category.CategoryName;
     return schedule;
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     获取循环的付款计划Appointment
 /// </summary>
 /// <returns></returns>
 public static List<PaymentAppointment> GetOccurrences(PaymentAppointment appointment,
     IEnumerable<DateTime> occurrenceDateTimes)
 {
     var occurrencePaymentAppointment = new List<PaymentAppointment>();
     occurrenceDateTimes.ToList().ForEach(p =>
     {
         var subPaymentAppointment = new PaymentAppointment
         {
             Subject = appointment.Subject,
             Body = appointment.Body,
             End = p,
             Start = p,
             Amount = appointment.Amount,
             IsAllDayEvent = true,
             UniqueId = RandomHelper.Next().ToString(CultureInfo.InvariantCulture),
             TimeMarker = appointment.TimeMarker,
             Category = appointment.Category,
         };
         occurrencePaymentAppointment.Add(subPaymentAppointment);
     });
     return occurrencePaymentAppointment;
 }
Ejemplo n.º 5
0
 /// <summary>
 ///     把Appointment转化PaymentScheduleLineDTO
 /// </summary>
 /// <param name="appointment"></param>
 /// <returns></returns>
 public static PaymentScheduleLineDTO ConvertToPaymentScheduleLine(PaymentAppointment appointment)
 {
     var schedule = new PaymentScheduleLineDTO
     {
         Body = appointment.Body,
         Subject = appointment.Subject,
         ScheduleDate = appointment.Start,
         Start = appointment.Start,
         End = appointment.End,
         IsAllDayEvent = appointment.IsAllDayEvent,
         Amount = appointment.Amount,
         PaymentScheduleLineId = int.Parse(appointment.UniqueId)
     };
     if (appointment.TimeMarker != null)
         schedule.Importance = appointment.TimeMarker.TimeMarkerName;
     if (appointment.Category != null)
         schedule.ProcessStatus = appointment.Category.CategoryName;
     return schedule;
 }
Ejemplo n.º 6
0
 public override IAppointment Copy()
 {
     var newAppointment = new PaymentAppointment();
     newAppointment.CopyFrom(this);
     return newAppointment;
 }