partial void DeleteTbl_UserPersonalDetail(Tbl_UserPersonalDetail instance);
partial void UpdateTbl_UserPersonalDetail(Tbl_UserPersonalDetail instance);
private void detach_Tbl_UserPersonalDetails(Tbl_UserPersonalDetail entity) { this.SendPropertyChanging(); entity.Tbl_UserAccess = null; }
partial void InsertTbl_UserPersonalDetail(Tbl_UserPersonalDetail instance);
public int RegisterUser(string UserName,string Password, string Email,int UserType,string MobileNumber,DateTime DateOfBirth) { using (var context = DataAccess.GetDataContext()) { if (!UserCompiledQueries.FunCheckUserExists(context, UserName)) { return 2; } if (!UserCompiledQueries.FunCheckEmailExists(context, Email)) { return 3; } var UserDetails = new Tbl_UserAccess { UserLoginName = UserName, UserPassword = Password, Email = Email, IsUserValid = true, LastLoginDateTime = DateTime.Now, UserRoleID = UserType, DateOfBirth = DateOfBirth.Date }; var UserpersonalDetails = new Tbl_UserPersonalDetail { UserAddress = string.Empty, MobileNumber = MobileNumber }; var UserProfile = new Tbl_UserProfile { DealsCount = 0, CommentsCount = 0, VouchersCount = 0, BadgeID = 1 }; UserDetails.Tbl_UserPersonalDetails.Add(UserpersonalDetails); UserDetails.Tbl_UserProfiles.Add(UserProfile); context.Tbl_UserAccesses.InsertOnSubmit(UserDetails); context.SubmitChanges(); } return 1; }