コード例 #1
0
        public ActionResult PostEdit(RequestModel model)
        {
            AspNetUsers aspNetUsers = new AspNetUsers();

            aspNetUsers.Id                = model.Id;
            aspNetUsers.Name              = model.Name;
            aspNetUsers.UserName          = model.UserName;
            aspNetUsers.phNumber          = model.phNumber;
            aspNetUsers.Birthday          = model.Birthday;
            aspNetUsers.Email             = model.Email;
            aspNetUsers.AccessFailedCount = 0;

            db.Entry(aspNetUsers).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();

            var data = db.AspNetUsers.Where(x => x.Id.Equals(aspNetUsers.Id)).Select(x => new RequestModel
            {
                Id       = x.Id,
                Birthday = x.Birthday,
                Email    = x.Email,
                Name     = x.Name,
                phNumber = x.phNumber,
                UserName = x.UserName
            }).OrderBy(x => x.Id).ToPagedList(1, l_pageSize);

            var viewModel = new SampleUserViewModel
            {
                requestModel = data,
                PageIndex    = 1
            };


            return(View("Index", viewModel));
        }
コード例 #2
0
        public ActionResult PostEdit(RequestPay model)
        {
            paymenttbl paymenttbl = new paymenttbl();

            paymenttbl.payid   = model.payid;
            paymenttbl.mid     = model.mid;
            paymenttbl.name    = model.name;
            paymenttbl.phone   = model.phone;
            paymenttbl.addr    = model.addr;
            paymenttbl.pay     = model.payid;
            paymenttbl.paydate = model.paydate;
            paymenttbl.memo    = model.memo;

            db.Entry(paymenttbl).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();

            var data = db.paymenttbl.Where(x => x.payid.Equals(paymenttbl.payid)).Select(x => new RequestPay
            {
                payid   = x.payid,
                mid     = x.mid,
                name    = x.name,
                phone   = x.phone,
                addr    = x.addr,
                pay     = x.payid,
                paydate = x.paydate,
                memo    = x.memo
            }).OrderBy(x => x.payid).ToPagedList(1, l_pageSize);

            var viewModel = new paymenttblsViewModel
            {
                RequestPay = data,
                PageIndex  = 1
            };

            return(View("Index", viewModel));
        }