コード例 #1
0
ファイル: PeopleController.cs プロジェクト: LIT-W01/Jan-10th
 public ActionResult Save(string name, string address, string nopoint)
 {
     var db = new PeopleDb(@"Data Source=.\sqlexpress;Initial Catalog=Food;Integrated Security=True");
     Customer c = new Customer();
     c.Name = name;
     c.Address = address;
     db.Add(c);
     return RedirectToAction("Index");
 }
コード例 #2
0
ファイル: PeopleController.cs プロジェクト: LIT-W01/Jan-10th
 public ActionResult Edit(string name, string address, int customerId)
 {
     var db = new PeopleDb(@"Data Source=.\sqlexpress;Initial Catalog=Food;Integrated Security=True");
     Customer c = new Customer();
     c.Name = name;
     c.Address = address;
     c.Id = customerId;
     db.Update(c);
     return RedirectToAction("Index");
 }
コード例 #3
0
ファイル: PeopleController.cs プロジェクト: LIT-W01/Jan-10th
 public ActionResult Delete(int id)
 {
     var db = new PeopleDb(@"Data Source=.\sqlexpress;Initial Catalog=Food;Integrated Security=True");
     db.Delete(id);
     return RedirectToAction("Index");
 }
コード例 #4
0
ファイル: PeopleController.cs プロジェクト: LIT-W01/Jan-10th
 public ActionResult Edit(int personId)
 {
     var db = new PeopleDb(@"Data Source=.\sqlexpress;Initial Catalog=Food;Integrated Security=True");
     Customer c = db.FindById(personId);
     return View(c);
 }
コード例 #5
0
ファイル: PeopleController.cs プロジェクト: LIT-W01/Jan-10th
 public ActionResult Index()
 {
     var db = new PeopleDb(@"Data Source=.\sqlexpress;Initial Catalog=Food;Integrated Security=True");
     var ppl = db.GetAll();
     return View(ppl);
 }