public UserInfo UserLoginInfoCreate(string externalid, string source, string gender, string preference, string age, string onlinestatus) { try { UserLogin userLogin = new UserLogin() { ExternalID = externalid, UserSourceType = (SourceType)Enum.Parse(typeof(SourceType), source) }; UserService userService = new UserService(); userLogin = userService.LoginCreate(userLogin); UserInfo userInfo = new UserInfo() { UserID = userLogin.UserID, Age = short.Parse(age), Preference = (PreferenceType)Enum.Parse(typeof(PreferenceType), preference), Gender = (GenderType)Enum.Parse(typeof(GenderType), gender), OnlineStatusID = short.Parse("0" + onlinestatus) }; return userService.UserInfoCreate(userInfo); } catch (Exception e) { Logging.WriteToEventLog("USER UserLoginInfoCreate " + e.Message); return null; } }
static void CreateUser(bool male, string url, string loc, int busid, int count) { int age = 30 + count; Incyte.GenderType gend = Incyte.GenderType.FEMALE; if(male) gend = Incyte.GenderType.MALE; UserService uss = new UserService(); UserLogin ul = uss.LoginCreate(new UserLogin() { ExternalID = "EX" + count.ToString(), UserSourceType = Incyte.SourceType.Facebook }); Console.WriteLine("USERID = " + ul.UserID + " ISNEW = " + ul.IsNew.ToString()); UserInfo uf = uss.UserInfoCreate(new UserInfo() { UserID = ul.UserID, Age = short.Parse(age.ToString()), Gender = gend, OnlineStatusID = 1, PictureLocation = url + "/pic" + ul.UserID.ToString() + ".Jpeg", Preference = (gend == Incyte.GenderType.MALE? Incyte.PreferenceType.FEMALE:Incyte.PreferenceType.MALE), EmailAddress = "testemail" + ul.UserID.ToString() + "@mynglz.com", Handle = "Handle " + ul.UserID + " ISNEW : " + ul.IsNew.ToString(), InstantTitle = "Title " + ul.UserID.ToString() }); if (System.IO.File.Exists(loc + @"\pic" + ul.UserID.ToString() + ".Jpeg")) System.IO.File.Delete(loc + @"\pic" + ul.UserID.ToString() + ".Jpeg"); Bitmap bmp = CreateBitmapImage("USER ID " + ul.UserID.ToString() + " : " + gend.ToString()); bmp.Save(loc + @"\pic" + ul.UserID.ToString() + ".Jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); uss.CheckinCreate(uf.UserID, busid); }
public UserLogin UserLoginCreate(string externalid, string source) { try { UserLogin userLogin = new UserLogin() { ExternalID = externalid, UserSourceType = (SourceType)Enum.Parse(typeof(SourceType), source) }; UserService userService = new UserService(); userLogin = userService.LoginCreate(userLogin); return userLogin; } catch (Exception e) { Logging.WriteToEventLog("USER UserLoginCreate " + e.Message); return null; } }
private int CreateUserLogin() { //IUserResource userResource = new MockUserResource(); IUserService userService = new UserService(); int i = new Random().Next(1000); UserLogin ul = new UserLogin(); ul.ExternalID = "wwwwwwwwww" + i.ToString(); ul.UserSourceType = Incyte.SourceType.Facebook; ul.UserName = ""; ul.Password = ""; userService.LoginCreate(ul); return ul.UserID; }