示例#1
0
        public string MemberSave(string salut, string familyName, string fName, string pwd, string email, string address, string ph, string country)
        {
            string id;
            ThreeHotelEntities2 ct = new ThreeHotelEntities2();
            Guest g = new Guest();
            User user = new User();

            id = getMemberId();
            g.GuestId = id;

            g.Salutation = salut;
            g.FamilyName = familyName;
            g.FirstName = fName;
            user.MembershipId = id;
            user.Password = Encrypt(pwd);
            g.Email = email;
            g.Address = address;
            g.PhoneNo = ph;
            g.Country = country;

            ct.Guests.Add(g);
            ct.Users.Add(user);
            ct.SaveChanges();

            SendMail(fName,familyName,email,id);
            return id;
        }
示例#2
0
        public void MemberUpdate(string id, string salut, string familyName, string fName, string email, string address, string ph, string country)
        {
            ThreeHotelEntities2 ct = new ThreeHotelEntities2();
            Guest g = new Guest();

            g = (from x in ct.Guests
                 where x.GuestId == id
                 select x).First();

            g.Salutation = salut;
            g.FamilyName = familyName;
            g.FirstName = fName;

            g.Email = email;
            g.Address = address;
            g.PhoneNo = ph;
            g.Country = country;

            ct.SaveChanges();
        }
示例#3
0
        public void MemberChangePwd(string id, string newpwd)
        {
            ThreeHotelEntities2 ct = new ThreeHotelEntities2();
            User g = new User();

            g = (from x in ct.Users
                 where x.MembershipId == id
                 select x).First();

            g.Password = Encrypt(newpwd);

            ct.SaveChanges();
        }