/// <summary> /// Copy the values from the parameter object to self /// </summary> /// <param name="original">The original object to copy from</param> public void Copy(UserCategory original) { UserID = original.UserID; CategoryID = original.CategoryID; User = original.User; Category = original.Category; ExcludeFromCalculation = original.ExcludeFromCalculation; Priority = original.Priority; Limit = original.Limit; CreateDate = original.CreateDate; LastModify = original.LastModify; }
/// <summary> /// Check if the current category is modified by comparing it with the given original category /// </summary> /// <param name="original">The original category, which need to be compared with self</param> /// <returns></returns> public bool IsModified(UserCategory original) { // compare the properties if (original.Category.CategoryName != Category.CategoryName || original.Category.CategoryDirections.DirectionID != Category.CategoryDirections.DirectionID || original.ExcludeFromCalculation != ExcludeFromCalculation || original.Priority != Priority || original.Limit != Limit) { return(true); } return(false); }