Exemplo n.º 1
0
 partial void DeleteTbl_UserAccess(Tbl_UserAccess instance);
Exemplo n.º 2
0
 partial void UpdateTbl_UserAccess(Tbl_UserAccess instance);
Exemplo n.º 3
0
		private void detach_Tbl_UserAccesses(Tbl_UserAccess entity)
		{
			this.SendPropertyChanging();
			entity.Tbl_UserRole = null;
		}
Exemplo n.º 4
0
 partial void InsertTbl_UserAccess(Tbl_UserAccess instance);
Exemplo n.º 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;
        }