コード例 #1
0
        public HttpResponseMessage UpdateProfile([FromBody] AccountDetailModel model)
        {
            model.AccountId = UserService.GetCurrentUser().Id;
            adSvc.Update(model);
            ItemResponse <AccountDetailViewModel> resp = new ItemResponse <AccountDetailViewModel>();

            resp.Item = adSvc.SelectByAccountId(model.AccountId);
            return(Request.CreateResponse(HttpStatusCode.OK, resp));
        }
コード例 #2
0
        public ActionResult Index([Bind(Include = ("Name,Email,Phone,Address,Birthday,Mobile,Gender"))] Account_List_ViewModel account_detail)
        {
            if (TempData["ID"] != null)
            {
                var user_name = HttpContext.User.Identity.Name;
                var viewmodel = Account.get_account_detail(user_name);
                var _order    = Account.Get_order(viewmodel.Cust_id);
                var _Coupon   = Account.Coupon(viewmodel.Cust_id);
                ViewBag.Order           = _order;
                account_detail.Discount = _Coupon.Discount;
                account_detail.Cust_id  = Convert.ToInt32(TempData["ID"]);
                var service = new AccountDetailService();
                service.Update(account_detail);
            }
            int ID = Convert.ToInt32(TempData["ID"]);



            return(View(account_detail));
        }