Ejemplo n.º 1
0
 partial void DeleteTbl_UserProfile(Tbl_UserProfile instance);
Ejemplo n.º 2
0
 partial void UpdateTbl_UserProfile(Tbl_UserProfile instance);
Ejemplo n.º 3
0
 partial void InsertTbl_UserProfile(Tbl_UserProfile instance);
Ejemplo n.º 4
0
		private void detach_Tbl_UserProfiles(Tbl_UserProfile entity)
		{
			this.SendPropertyChanging();
			entity.Tbl_UserAccess = null;
		}
Ejemplo n.º 5
0
		private void attach_Tbl_UserProfiles(Tbl_UserProfile entity)
		{
			this.SendPropertyChanging();
			entity.Tbl_Badge = this;
		}
Ejemplo n.º 6
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;
        }