示例#1
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,CompanyName")] Company company)
        {
            if (ModelState.IsValid)
            {
                db.Entry(company).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(company));
        }
示例#2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,FirstName,SurName,DOB,HouseNumber")] Customer customers)
        {
            if (ModelState.IsValid)
            {
                db.Entry(customers).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(customers));
        }
示例#3
0
        public async Task <ActionResult> Edit([Bind(Include = "ContactId,Firstname,Surname,ContactTypeId,Phone,TwitterHandle,GenderTypeId,IsActive")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                db.Entry(contact).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(contact));
        }
示例#4
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Volume,CompanyId")] Coffee coffee)
        {
            if (ModelState.IsValid)
            {
                db.Entry(coffee).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.CompanyId = new SelectList(db.Companies, "Id", "CompanyName", coffee.CompanyId);
            return(View(coffee));
        }