public int Remove(InterestRateAdjustmentModel interestRateAdjustment)
 {
     interestRateAdjustment.RecordStatus       = RecordStatus.Deleted;
     interestRateAdjustment.LastModifyTime     = DateTime.Now;
     interestRateAdjustment.LastModifyUserName = UserInfo.UserName;
     return(m_db.Update(m_defaultTableName, m_defaultPrimaryKey, interestRateAdjustment.GetTableObject()));
 }
 public InterestRateAdjustmentModel Update(InterestRateAdjustmentModel adjustment)
 {
     adjustment.LastModifyTime     = DateTime.Now;
     adjustment.LastModifyUserName = UserInfo.UserName;
     m_db.Update(m_defaultTableName, m_defaultPrimaryKey, adjustment.GetTableObject());
     return(adjustment);
 }
        public InterestRateAdjustmentModel New(int interestRateAdjustmentSetId,
                                               PrimeInterestRate interestRateType, DateTime adjustmentDate, double interestRate)
        {
            var now = DateTime.Now;

            var interestRateAdjustment = new InterestRateAdjustmentModel();

            interestRateAdjustment.Guid = Guid.NewGuid().ToString();

            interestRateAdjustment.InterestRateAdjustmentSetId = interestRateAdjustmentSetId;
            interestRateAdjustment.InterestRateType            = interestRateType;
            interestRateAdjustment.AdjustmentDate   = adjustmentDate;
            interestRateAdjustment.InterestRate     = interestRate;
            interestRateAdjustment.InterestRateName = CommUtils.ToCnString(interestRateType);

            interestRateAdjustment.CreateTime         = now;
            interestRateAdjustment.CreateUserName     = UserInfo.UserName;
            interestRateAdjustment.LastModifyTime     = now;
            interestRateAdjustment.LastModifyUserName = UserInfo.UserName;
            interestRateAdjustment.RecordStatus       = RecordStatus.Valid;
            interestRateAdjustment.Id = Insert(interestRateAdjustment.GetTableObject());
            return(interestRateAdjustment);
        }