コード例 #1
0
        public ActionResult Guidang(CustomerGuidangViewModel model)
        {
            Message msg = new Message();
            string CustomerGuidang = Request.Form["CustomerGuidang"];
            try
            {
                msg = CMSService.UpdateFieldOneByOne("Customer", "CMSCustomer", "CustomerId=" + model.CustomerId, "CustomerGuidang", CustomerGuidang);
                return RedirectToAction("Index", new { category="全部",guidang="0"});
               // return RedirectTo("/Customer/Index?category=全部&guidang=0", msg.MessageInfo);
            }

            catch
            {

                msg.MessageStatus = "Error";
                msg.MessageInfo = "操作出错了";
                ViewBag.Status = msg.MessageStatus;
                ViewBag.msg = msg.MessageInfo;
                return View();
            }
        }
コード例 #2
0
        public ActionResult Guidang(int id)
        {
            CustomerGuidangViewModel model = new CustomerGuidangViewModel();
            DataTable dt = CMSService.SelectOne("Customer", "CMSCustomer", "CustomerId=" + id);
            foreach (DataRow dr in dt.Rows)
            {
                CustomerDto dto = new CustomerDto();
                dto = CustomerMapping.getDTO(dr);
                model.CustomerId = dto.CustomerId;
                model.CustomerName = dto.CustomerName;
                model.CustomerGuidang = dto.CustomerGuidang;

            }
            ViewData["ListGuidang"] = MyService.GetCategoryList("CategoryParentId=30");
            return View(model);
        }