예제 #1
0
        public static void gdvEffectivePeriod_CustomButtonInitialize(object sender, ASPxGridViewCustomButtonEventArgs e)
        {
            ASPxGridView gdv = (ASPxGridView)sender;

            iSabaya.TimeInterval effectivePeriod = (iSabaya.TimeInterval)gdv.GetRowValues(e.VisibleIndex, "EffectivePeriod");
            SetGridButton(ref e, effectivePeriod.EffectiveDate, effectivePeriod.ExpiryDate);
        }
예제 #2
0
 private static void SetGridButton(ref ASPxGridViewCustomButtonEventArgs e, iSabaya.TimeInterval effectivePeriod)
 {
     if ((effectivePeriod.EffectiveDate <= DateTime.Now && effectivePeriod.ExpiryDate >= DateTime.Now))
     {
         if (e.ButtonID.Contains("btnEdit"))
         {
             e.Visible   = DevExpress.Utils.DefaultBoolean.True;
             e.Image.Url = ResImageURL.Edit;
             if (string.IsNullOrEmpty(e.Text))
             {
                 e.Text = ResGeneral.Edit;
             }
         }
         else if (e.ButtonID.Contains("btnExpire"))
         {
             e.Visible   = DevExpress.Utils.DefaultBoolean.True;
             e.Image.Url = ResImageURL.Expire;
             if (string.IsNullOrEmpty(e.Text))
             {
                 e.Text = ResGeneral.Expire;
             }
         }
         else if (e.ButtonID.Contains("btnPerson"))
         {
             e.Visible   = DevExpress.Utils.DefaultBoolean.True;
             e.Image.Url = "~/Images/led_icon/employee_account.png";
             if (string.IsNullOrEmpty(e.Text))
             {
                 e.Text = ResGeneral.Edit;
             }
         }
     }
     else
     {
         if (e.ButtonID.Contains("btnEdit"))
         {
             e.Visible = DevExpress.Utils.DefaultBoolean.False;
         }
         else if (e.ButtonID.Contains("btnExpire"))
         {
             e.Visible = DevExpress.Utils.DefaultBoolean.False;
         }
         else if (e.ButtonID.Contains("btnPerson"))
         {
             e.Visible = DevExpress.Utils.DefaultBoolean.False;
         }
     }
 }
예제 #3
0
 public static void gdvEffectivePeriod_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.Data)
     {
         ASPxGridView         gdv             = (ASPxGridView)sender;
         iSabaya.TimeInterval effectivePeriod = (iSabaya.TimeInterval)gdv.GetRowValues(e.VisibleIndex, "EffectivePeriod");
         // not effective
         if (!(effectivePeriod.IsEffectiveOn(DateTime.Now)))
         {
             // pass
             if (effectivePeriod.ExpiryDate < DateTime.Now)
             {
                 e.Row.ForeColor = System.Drawing.Color.Red;
             }
             // future
             else
             {
                 e.Row.ForeColor = System.Drawing.Color.Blue;
             }
         }
     }
 }
예제 #4
0
 public static bool IsEffectiveOn(this TimeInterval m, DateTime datetime)
 {
     return(m == null ? false : m.From <= datetime && datetime <= m.To);
 }
예제 #5
0
 public ScheduleMonthlyRelativeToEOM(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval,
                                     TreeListNode timeCategory, int leadDays)
     : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory)
 {
     //dayNo = 31 => end-of-month
     this.LeadDays = leadDays;
 }
예제 #6
0
 public ScheduleDayOfWeek(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval,
                          TreeListNode timeCategory, DayOfWeek dayOfWeek)
     : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory)
 {
     this.DayOfWeek = dayOfWeek;
 }
예제 #7
0
 public PersistentTemporalEntity(TimeInterval effectivePeriod, String reference, String remark)
     : base(reference, remark)
 {
     this.EffectivePeriod = effectivePeriod;
 }
예제 #8
0
 public PersistentTemporalEntity(PersistentTemporalEntity original)
     : base(original)
 {
     this.EffectivePeriod = TimeInterval.Clone(original.EffectivePeriod);
 }
예제 #9
0
 public PartyIdentity(Party party, TreeListNode identityCategory, String identityNo, TimeInterval effectivePeriod)
     : base(party, identityCategory, null, null, null, effectivePeriod, null)
 {
     this.IdentityNo = identityNo;
 }
예제 #10
0
 public ScheduleSpecificDate(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval,
                             TreeListNode timeCategory, DateTime date, MultilingualString title)
     : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory, title)
 {
     this.date = date;
 }