Skip to content

Instantly share code, notes, and snippets.

@chaintng
Last active September 17, 2015 03:05
Show Gist options
  • Save chaintng/56bc3ba7db1129b7c506 to your computer and use it in GitHub Desktop.
Save chaintng/56bc3ba7db1129b7c506 to your computer and use it in GitHub Desktop.
CreateUserUnique
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