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); }
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; } } }
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; } } } }
public static bool IsEffectiveOn(this TimeInterval m, DateTime datetime) { return(m == null ? false : m.From <= datetime && datetime <= m.To); }
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; }
public ScheduleDayOfWeek(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval, TreeListNode timeCategory, DayOfWeek dayOfWeek) : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory) { this.DayOfWeek = dayOfWeek; }
public PersistentTemporalEntity(TimeInterval effectivePeriod, String reference, String remark) : base(reference, remark) { this.EffectivePeriod = effectivePeriod; }
public PersistentTemporalEntity(PersistentTemporalEntity original) : base(original) { this.EffectivePeriod = TimeInterval.Clone(original.EffectivePeriod); }
public PartyIdentity(Party party, TreeListNode identityCategory, String identityNo, TimeInterval effectivePeriod) : base(party, identityCategory, null, null, null, effectivePeriod, null) { this.IdentityNo = identityNo; }
public ScheduleSpecificDate(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval, TreeListNode timeCategory, DateTime date, MultilingualString title) : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory, title) { this.date = date; }