Beispiel #1
0
 /// <summary>
 /// 新增CP
 /// </summary>
 /// <param name="acp"></param>
 /// <returns></returns>
 public bool AddCP(Admin_ChannelInfo acp)
 {
     DataAccess.Admin_ChannelInfo cp = new DataAccess.Admin_ChannelInfo();
     cp.ChannelName = acp.ChannelName;
     cp.AddTime = DateTime.Now;
     _db.Admin_ChannelInfo.AddObject(cp);
     int result = _db.SaveChanges();
     if (result == 1)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Beispiel #2
0
 public ActionResult AddChannel(FormCollection form)
 {
     string ChannelName = form["CPName"] ?? "";
     if (ChannelName == "")
     {
         ViewBag.msg = "渠道名称不能为空";
         return View();
     }
     else
     {
         Admin_ChannelInfo acp = new Admin_ChannelInfo();
         acp.ChannelName = ChannelName;
         if (new Admin_ChannelInfoLogic().AddCP(acp))
         {
             ViewBag.msg = "渠道添加成功";
         }
         else
         {
             ViewBag.msg = "渠道添加失败";
         }
         return View();
     }
 }
Beispiel #3
0
 public ActionResult EditChannel(FormCollection form)
 {
     int id = int.Parse(form["cpid"]);
     string cpname = form["cpname"];
     if (new Admin_ChannelInfoLogic().UpdateCPbyID(id, cpname))
     {
         ViewBag.msg = "渠道更新成功";
     }
     else
     {
         ViewBag.msg = "渠道更新失败";
     }
     Admin_ChannelInfo mm = new Admin_ChannelInfo();
     return View(mm);
 }