Example #1
0
        public ActionResult Create([Bind(Include = "PaymentStatusID,Name,Note,CreateDate,CreateUser,ModifiedDate,ModifiedUser,IsActive")] PaymentStatu paymentStatu)
        {
            var UserSession = (UserLogin)Session[TechDeviShopVs002.Common.CommonConstants.USER_SESSION];

            if (ModelState.IsValid)
            {
                var _dal = new PaymentStatusDAL();

                paymentStatu.CreateUser = UserSession.UserID;

                int id = _dal.Insert(paymentStatu);
                if (id > 0)
                {
                    return(RedirectToAction("Index", "PaymentStatus"));
                }
                else
                {
                    ModelState.AddModelError("", "Thêm trạng thái thanh toán ko thành công");
                }
            }

            return(View(paymentStatu));
        }