Пример #1
0
        public ActionResult Edit(string key)
        {
            ViewBag.AState = "EDIT";
            M_CustomerInfo Cus = SQLDBHelperClient.CreateCus().Query(key);

            return(View("Edit", Cus));
        }
Пример #2
0
 public ActionResult Edit(M_CustomerInfo mcus)
 {
     if (ModelState.IsValid)
     {
         SQLDBHelperClient.CreateCus().Update(mcus);
         ViewBag.Succ = "1";
         ViewBag.Msg  = "数据编辑成功!";
         //return View("Query");
         return(View("Edit"));
     }
     else
     {
         //ViewData["succ"] = "0";
         ViewBag.Succ = "0";
         ViewBag.Msg  = "数据编辑失败!";
         return(View(mcus));
     }
 }
Пример #3
0
        public ActionResult Add(M_CustomerInfo mcus)
        {
            mcus.AddOrUpdateUserID = "";
            bool iTrue = SQLDBHelperClient.CreateCus().Add(mcus);

            if (iTrue)
            {
                ViewBag.Succ = "1";
                ViewBag.Msg  = "数据添加成功!";
                return(View(new M_CustomerInfo()));
            }
            else
            {
                ViewBag.Succ = "0";
                ViewBag.Msg  = "数据添加失败!";
                return(View(mcus));
            }
        }
Пример #4
0
        public ActionResult Delete(string keys)
        {
            bool iSucc = false;

            //if (string.IsNullOrEmpty(userid))
            //{
            if (Request.Params["keys"] != null)
            {
                string[] strUserid = Request.Params["keys"].Split(',');
                iSucc = SQLDBHelperClient.CreateCus().Remove(Request.Params["keys"].Split(',').ToList());
            }
            //}
            if (iSucc)
            {
                ViewBag.Succ = "1";
                ViewBag.Msg  = "数据删除成功!";
            }
            else
            {
                ViewBag.Succ = "0";
                ViewBag.Msg  = "数据删除失败!";
            }
            return(View("Query"));
        }