Last active
September 17, 2015 03:05
-
-
Save chaintng/56bc3ba7db1129b7c506 to your computer and use it in GitHub Desktop.
CreateUserUnique
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public UserUnique CreateUserUniqueIfNotExisted(CustomerInsight_DBEntities refDb, Dictionary<int, UserUnique> existedUserUnique) | |
{ | |
UserUnique tmpUu; | |
if (!existedUserUnique.TryGetValue(this.user_unique_id, out tmpUu)) | |
{ | |
tmpUu = UserUnique.CreateUserUniqueFromUui(this.user_unique_id, refDb); | |
existedUserUnique.Add(tmpUu.user_unique_id, tmpUu); | |
} | |
return tmpUu; | |
} | |
public static UserUnique CreateUserUniqueFromUui(int uui, CustomerInsight_DBEntities refDb) | |
{ | |
var tmpUu = new UserUnique(); | |
tmpUu.user_unique_id = uui; | |
tmpUu.prospect = 0; | |
tmpUu.last_activity = Utils.getCurrentDateTime(); | |
tmpUu.timestamp = Utils.getCurrentDateTime(); | |
refDb.UserUniques.Add(tmpUu); | |
return tmpUu; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment