Beispiel #1
0
        public ActionResult ChangedAccIformation()
        {
            string         maTK   = Request.Cookies["MaTK"]["MaTK"];
            THONGTINMEMBER member = db.THONGTINMEMBERs.SingleOrDefault(p => p.MaTK == maTK);

            return(View(member));
        }
Beispiel #2
0
        public ActionResult ChangedAccIformation(FormCollection collection)
        {
            string         maTK     = Request.Cookies["MaTK"]["MaTK"];
            THONGTINMEMBER member   = db.THONGTINMEMBERs.SingleOrDefault(p => p.MaTK == maTK);
            TAIKHOAN       taiKhoan = db.TAIKHOANs.SingleOrDefault(p => p.MaTK == maTK);

            string DiaChi   = collection["DiaChi"];
            string phuong   = collection["Phuong"];
            string quan     = collection["Quan"];
            string thanhPho = collection["ThanhPho"];

            member.DiaChi = DiaChi + " phường " + phuong + " Quận " + quan + " thành phố " + thanhPho;
            member.Email  = collection["Email"];
            var gioiTinh = ValueProvider.GetValue("GioiTinh");

            if (gioiTinh != null)
            {
                string gt = gioiTinh.AttemptedValue;
                if (gt == "Nam")
                {
                    member.GioiTinh = true;
                }
                else
                {
                    member.GioiTinh = false;
                }
            }

            string ngaySinh  = collection["Ngay"];
            string thangSinh = collection["Thang"];
            string namSinh   = collection["Nam"];

            member.NgaySinh = DateTime.Parse(thangSinh + "/" + ngaySinh + "/" + namSinh);
            member.Ten      = collection["Ten"];

            taiKhoan.DiaChi = member.DiaChi;
            taiKhoan.Email  = member.Email;
            taiKhoan.SDT    = collection["SDT"];

            db.SaveChanges();
            return(RedirectToAction("AccountInformation", "Home"));
        }
Beispiel #3
0
        public ActionResult NewAccount(FormCollection collection)
        {
            THONGTINMEMBER member = new THONGTINMEMBER();

            member.Avatar   = null;
            member.UserName = collection["UserName"];
            member.Email    = collection["Email"];
            var gioiTinh = ValueProvider.GetValue("Gender");

            if (gioiTinh != null)
            {
                string gt = gioiTinh.AttemptedValue;
                if (gt == "Nam")
                {
                    member.GioiTinh = true;
                }
                else
                {
                    member.GioiTinh = false;
                }
            }

            member.MaTK = "MB" + (db.LaySoLuongMember() + 1).ToString();
            member.MaTT = "TT01";
            string ngaySinh  = collection["Date"];
            string thangSinh = collection["Month"];
            string namSinh   = collection["Year"];

            member.NgaySinh = DateTime.Parse(thangSinh + "/" + ngaySinh + "/" + namSinh);
            member.Password = collection["Password"];

            member.SDT = collection["Phone"];
            member.Ten = collection["Name"];


            bool res = db.ThemMember(member);

            return(RedirectToAction("MemberManager", "Admin"));
        }
Beispiel #4
0
        public ActionResult Register(FormCollection col)
        {
            THONGTINMEMBER member = new THONGTINMEMBER();

            member.Avatar   = null;
            member.UserName = col["TenDangNhap"];
            member.Email    = col["RegisterModel.EmailRegister"];
            var gioiTinh = ValueProvider.GetValue("RegisterModel.Gender");

            if (gioiTinh != null)
            {
                string gt = gioiTinh.AttemptedValue;
                if (gt == "Nam")
                {
                    member.GioiTinh = true;
                }
                else
                {
                    member.GioiTinh = false;
                }
            }

            member.MaTK = "MB" + (db.LaySoLuongMember() + 1).ToString();
            member.MaTT = "TT01";
            string ngaySinh  = col["RegisterModel.CurrentDate"];
            string thangSinh = col["RegisterModel.CurrentMonth"];
            string namSinh   = col["RegisterModel.CurrentYear"];

            member.NgaySinh = DateTime.Parse(thangSinh + "/" + ngaySinh + "/" + namSinh);
            member.Password = col["RegisterModel.PasswordRegister"];

            member.SDT = col["RegisterModel.Phone"];
            member.Ten = col["RegisterModel.Name"];


            bool res = db.ThemMember(member);

            return(RedirectToAction("Index", "Home"));
        }
Beispiel #5
0
        public ActionResult Register()
        {
            THONGTINMEMBER register = new THONGTINMEMBER();

            return(View(register));
        }