Exemplo n.º 1
0
        public ActionResult CustomerCreate(CCustomer c)
        {
            List <CCustomer> lsCustomers = CCustomerFactory.fn顧客查詢();
            CCustomer        ccustomer   = lsCustomers.FirstOrDefault(m => m.fCustomerEmail == c.fCustomerEmail);

            CCustomerFactory.fn顧客新增(c);
            ViewBag.message = "新增成功";
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult CustomerEdit(CCustomerEditor c)
        {
            List <CCustomer> lsCustomers = CCustomerFactory.fn顧客查詢();
            CCustomer        ccustomer   = lsCustomers.FirstOrDefault(m => m.fCustomerId == c.fCustomerId);
            var data = "";

            if (ccustomer != null)
            {
                ccustomer.fCustomerName    = c.fCustomerName;
                ccustomer.fCustomerBirth   = c.fCustomerBirth;
                ccustomer.fCustomerGender  = c.fCustomerGender;
                ccustomer.fCustomerEmail   = c.fCustomerEmail;
                ccustomer.fCustomerAddress = c.fCustomerAddress;
                ccustomer.fCustomerPhone   = c.fCustomerPhone;
                CCustomerFactory.fn顧客更新(ccustomer);
                return(RedirectToAction("CustomerEdit"));
            }
            else
            {
                return(RedirectToAction("CustomerData"));
            }
        }
Exemplo n.º 3
0
 public ActionResult CustomerDelete(CCustomer c)
 {
     CCustomerFactory.fn顧客刪除(c);
     return(View());
 }
Exemplo n.º 4
0
        public ActionResult CustomerData()
        {
            var customerdata = CCustomerFactory.fn顧客查詢().ToList();

            return(View(customerdata));
        }