public override void AfterConstruction() { base.AfterConstruction(); RequestDate = DateTime.Now; RequestBy = Session.GetObjectByKey <Employee>(Session.GetKeyValue(SecuritySystem.CurrentUser)); Status = RequisitonStatus.Pending; RequisitionCode = string.Format("R{0}", RequestDate.ToString("yyMMddHHmmssfff")); CreateDate = DateTime.Now; }
private IEnumerable <RequestDate> GetDates() { for (int i = 0; i < 7; i++) { var dates = new RequestDate { Date = DateTime.Now.AddDays(i).ToString("MM/dd/yyyy hh:mm") }; yield return(dates); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (CurrencyCode != null) { hashCode = hashCode * 59 + CurrencyCode.GetHashCode(); } if (Amount != null) { hashCode = hashCode * 59 + Amount.GetHashCode(); } if (CVC != null) { hashCode = hashCode * 59 + CVC.GetHashCode(); } if (CardNumber != null) { hashCode = hashCode * 59 + CardNumber.GetHashCode(); } if (FullName != null) { hashCode = hashCode * 59 + FullName.GetHashCode(); } if (CardExpiryDate != null) { hashCode = hashCode * 59 + CardExpiryDate.GetHashCode(); } if (RequestDate != null) { hashCode = hashCode * 59 + RequestDate.GetHashCode(); } if (SendingBankName != null) { hashCode = hashCode * 59 + SendingBankName.GetHashCode(); } if (RecievingBankName != null) { hashCode = hashCode * 59 + RecievingBankName.GetHashCode(); } return(hashCode); } }
protected override string GetDisplayText() { return(RequestDate.ToStandardDateFormat()); }