Example #1
0
        public Product ReceiveCoupon(ReceiveCoupon receiveInfo)
        {
            var result = CouponDB.ReceiveCoupon(receiveInfo);

            if (result != null)
            {
                return(result);
            }
            return(null);
        }
Example #2
0
        public string Register(_Member member)
        {
            var status = CouponDB.RegistAccount(member);

            if (status != null)
            {
                return(status.Account);
            }
            return(null);
        }
Example #3
0
        public bool Login(_Member member)
        {
            var status = CouponDB.CheckLogin(member);

            if (status == true)
            {
                return(status);
            }
            return(status);
        }
Example #4
0
        public IActionResult CouponSite(string id)
        {
            var result = new Product();

            if (id != null)
            {
                result       = CouponDB.GetSingleProductDetail(id);
                ViewBag.Tree = "~/images/" + result.Picture;
            }
            return(View(result));
        }
Example #5
0
        public bool InsertCouponDetail(CouponSite.Models.InsertProduct products)
        {
            //if (products.Picture.Length > 1100000) // >1.1mb
            //{
            //    return false;
            //};
            var x = DateTime.Now;
            var n = CouponDB.InsertCouponDetail(products, _environment);

            return(n);
        }
Example #6
0
        public bool PostProductInfo(ProductCouponTable product)
        {
            var result = CouponDB.InsertIntoProduct(product);

            if (result)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #7
0
        public bool PostUserInfo(MemberTable memberinfo)
        {
            var InsertMember      = CouponDB.InsertIntoMember(memberinfo);
            var AlterCouponStatus = CouponDB.AlterCouponStatus(memberinfo.PCoupon);

            if (InsertMember == true && AlterCouponStatus == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #8
0
        public string checkLogin(MemberTable member)
        {
            var account  = member.Email;
            var password = member.password;

            var result = CouponDB.CheckLogin(account, password);

            if (result == "y")
            {
                return("y");
            }

            return(null);
        }
Example #9
0
        public IEnumerable <Models.ProductCouponTable> GetProduct(string productid)
        {
            var result = CouponDB.GetSingleProduct(productid);
            var test   = CouponDB.GetAll();

            foreach (var item in test)
            {
                var x = item;
            }
            if (result.Count() > 0)
            {
                return(result);
            }
            else
            {
                return(null);
            }
        }
Example #10
0
        public IEnumerable <Product> GetAllProducts()
        {
            var result = CouponDB.GetProducts();

            return(result);
        }
Example #11
0
        public IEnumerable <Product> Get()
        {
            var n = CouponDB.GetData();

            return(n);
        }