public int Remove(AssetDefaultModel assetDefault) { assetDefault.RecordStatus = RecordStatus.Deleted; assetDefault.LastModifyTime = DateTime.Now; assetDefault.LastModifyUserName = UserInfo.UserName; return(m_db.Update(m_defaultTableName, m_defaultPrimaryKey, assetDefault.GetTableObject())); }
public AssetDefaultModel New(int assetDefaultSetId, int assetId, DateTime assetDefaultDate, double recoveryRate, double recoveryLag, DateTime recoveryDate) { var now = DateTime.Now; var assetDefault = new AssetDefaultModel(); assetDefault.Guid = Guid.NewGuid().ToString(); assetDefault.AssetDefaultSetId = assetDefaultSetId; assetDefault.AssetId = assetId; assetDefault.AssetDefaultDate = assetDefaultDate; assetDefault.RecoveryRate = recoveryRate; assetDefault.RecoveryLag = recoveryLag; assetDefault.RecoveryDate = recoveryDate; assetDefault.CreateTime = now; assetDefault.CreateUserName = UserInfo.UserName; assetDefault.LastModifyTime = now; assetDefault.LastModifyUserName = UserInfo.UserName; assetDefault.RecordStatus = RecordStatus.Valid; assetDefault.Id = Insert(assetDefault.GetTableObject()); return(assetDefault); }