コード例 #1
0
 public IActionResult Sign_up(Member model)
 {
     if (ModelState.IsValid)
     {
         using (var db = new DBServer())
         {
             db.Members.Add(model);
             db.SaveChanges();
         }
         return(RedirectToAction("Sign_upComplete"));
     }
     return(View(model));
 }
コード例 #2
0
        public IActionResult Order3_Add(Order model)
        {
            if (HttpContext.Session.GetInt32("User_Login_Key") == null)
            {
                return(RedirectToAction("Login", "Account"));
            }
            model.User_No      = int.Parse(HttpContext.Session.GetInt32("User_Login_Key").ToString());
            model.Product_Code = "1003";
            model.Product_Name = "설중산호";
            model.Product_Cost = "99000";
            model.Order_Time   = DateTime.Now;

            using (var db = new DBServer())
            {
                db.Orders.Add(model);
                if (db.SaveChanges() > 0)
                {
                    return(RedirectToAction("OrderSuccess3", "ProductOrder"));
                }
            }
            return(View());
        }