Пример #1
0
        /// <summary>
        /// 配置插件的使用方式
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult PeiZhiExtends(int extid)
        {
            //查询该插件的信息
            normal_extends ne = ExtendsBll.GetNormal_ExtendsById(extid);
            normal_EmpExtendsContract neec = new normal_EmpExtendsContract();
            normal_EmpExtends nee = EmpExtendsBll.GetEmpExtendsByExtendsID2(extid, (Session["user"] as UsersContract).EId);
            if (nee != null)
            {
                neec.Id = nee.Id;
                neec.Info = nee.Info;
                neec.Enabled = int.Parse(nee.Enabled.ToString());//1启用,0禁用
            }
            else
            {
                neec.Info = ne.Info;
                neec.Enabled = 0;//1启用,0禁用
                neec.Id = 0;
            }

            ViewData["title"] = ne.Title;
            neec.extendID = extid;

            return View(neec);
        }
 public int Update(normal_EmpExtendsContract neec)
 {
     return EmpExDao.Update(neec.ToPO<normal_EmpExtends>());
 }
Пример #3
0
 public ActionResult PeiZhiExtends(int extid, normal_EmpExtendsContract neec)
 {
     neec.eid = (Session["user"] as UsersContract).EId;
     if (neec.Id == 0)
     {
         //添加
         if (EmpExtendsBll.Insert(neec) > 0)
         {
             ViewData["msg"] = "保存成功!";
             ViewData["url"] = Url.Action("Extends");
             return View("Success");
         }
         else
         {
             return View(neec);
         }
     }
     else
     {
         //修改
         if (EmpExtendsBll.Update(neec) > 0)
         {
             ViewData["msg"] = "保存成功!";
             ViewData["url"] = Url.Action("Extends");
             return View("Success");
         }
         else
         {
             return View(neec);
         }
     }
 }
 public int Insert(normal_EmpExtendsContract neec)
 {
     return EmpExDao.Insert(neec.ToPO<normal_EmpExtends>());
 }