예제 #1
0
        public ActionResult Index()
        {
            var CusData = new CusomerDTO()
            {
                customerList = _db.customers.ToList()
            };

            //var results = (from row in _db.customers select row).ToList();
            return(View(CusData));
        }
예제 #2
0
        public ActionResult EditCustomer(CusomerDTO s, int id)
        {
            customer result = _db.customers.Single(customer => customer.id == id);

            result.name       = s.customerData.name;
            result.gender     = s.customerData.gender;
            result.email      = s.customerData.email;
            result.address    = s.customerData.address;
            result.contact_no = s.customerData.contact_no;
            _db.SaveChanges();
            return(RedirectToAction("Index", "Customer"));
        }
예제 #3
0
 public ActionResult AddCustomer(CusomerDTO c)
 {
     _db.customers.Add(c.customerData);
     _db.SaveChanges();
     return(RedirectToAction("Index", "Customer"));
 }