Пример #1
0
 partial void DeleteTbl_UserPersonalDetail(Tbl_UserPersonalDetail instance);
Пример #2
0
 partial void UpdateTbl_UserPersonalDetail(Tbl_UserPersonalDetail instance);
Пример #3
0
		private void detach_Tbl_UserPersonalDetails(Tbl_UserPersonalDetail entity)
		{
			this.SendPropertyChanging();
			entity.Tbl_UserAccess = null;
		}
Пример #4
0
 partial void InsertTbl_UserPersonalDetail(Tbl_UserPersonalDetail instance);
Пример #5
0
        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;
        }