Exemplo n.º 1
0
        public ActionResult Save(Model.NewsBase model)
        {
            bool result = false;
            Model.MenuBase mb = new Model.MenuBase();
            try
            {
                if (Request.Form["txbotype"] == "add")
                {
                    Model.NewsBase nb = new Model.NewsBase();

                    //根据菜单id得到菜单名称供返回
                    mb = mebll.GetModel(new Guid(RequestBase.GetString("mid")));

                    //menuBase.m_ID = Guid.NewGuid();
                    nb.m_ID = new Guid(RequestBase.GetString("mid").ToString());//菜单id
                    nb.n_Content = model.n_Content;
                    nb.n_CreatedBy = base.EmployeeBase.e_ID;
                    nb.n_PicUrl = Request.Form["FileInputEId"].ToString();
                    nb.n_QRCode = model.n_QRCode;
                    nb.n_RedirectUrl = model.n_RedirectUrl;
                    nb.n_Sort = model.n_Sort;
                    nb.n_Title = model.n_Title;
                    nb.n_Writer = base.EmployeeBase.e_MingC;
                    result = newsbll.Add(nb) > 0 ? true : false;
                }
                else
                {
                    Guid userid = base.EmployeeBase.e_ID;//用户id
                    Model.NewsBase nb = newsbll.GetModel(model.n_ID);
                    nb.n_Title = model.n_Title;
                    nb.n_RedirectUrl = model.n_RedirectUrl;
                    nb.n_QRCode = model.n_QRCode;
                    nb.n_Sort = model.n_Sort;
                    nb.n_PicUrl = Request.Form["FileInputEId"].ToString();
                    nb.n_Content = model.n_Content;
                    nb.n_CreatedBy = userid;
                    nb.n_Writer = base.EmployeeBase.e_MingC;
                    result = newsbll.Update(nb);
                }
                if (result)
                {
                    return Content(DWZUtil.GetResultJson("200", "操作成功!!", "w_" + mb.m_MingCh, "", "closeCurrent"));
                }
                else
                {
                    return Content(DWZUtil.GetResultJson("300", "保存失败!!", "", "", ""));
                }
            }
            catch
            {
                return Content(DWZUtil.GetResultJson("300", "保存失败!!", "", "", ""));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加友情链接方法
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult YouQingAdd(Model.NewsBase model)
        {
            bool result = false;
            Model.MenuBase mb = new Model.MenuBase();
            try
            {
                if (Request.Form["txbotype"] == "add")
                {
                    Model.NewsBase nb = new Model.NewsBase();

                    nb.m_ID = new Guid(RequestBase.GetString("mid").ToString());//菜单id
                    nb.n_CreatedBy = base.EmployeeBase.e_ID;
                    nb.n_RedirectUrl = model.n_RedirectUrl;
                    nb.n_Sort = model.n_Sort;
                    nb.n_Title = model.n_Title;
                    result = newsbll.Add(nb) > 0 ? true : false;
                }
                else
                {
                    Guid userid = base.EmployeeBase.e_ID;//用户id
                    Model.NewsBase nb = newsbll.GetModel(model.n_ID);
                    nb.n_Title = model.n_Title;
                    nb.n_RedirectUrl = model.n_RedirectUrl;
                    nb.n_Sort = model.n_Sort;
                    nb.n_Synopsis = model.n_Synopsis;
                    result = newsbll.Update(nb);
                }
                if (result)
                {
                    return Content(DWZUtil.GetResultJson("200", "操作成功!!", "w_友情链接", "", "closeCurrent"));
                }
                else
                {
                    return Content(DWZUtil.GetResultJson("300", "保存失败!!", "", "", ""));
                }
            }
            catch
            {
                return Content(DWZUtil.GetResultJson("300", "保存失败!!", "", "", ""));
            }
        }
Exemplo n.º 3
0
 public ActionResult MenuBaseEdit()
 {
     ViewData["IsShow"] = false;//是否显示资讯信息(顶级或系统管理不显示)
     ViewData["hfShow"] = true;
     BindControl bc = new BindControl();
     ViewData["mPageType"] = bc.BindSysCodeBase("0001", 2, false, false);//资讯类型
     // ViewData["IsHasFunRole"] = Rolemanager.IsHasFunRole(EmployeeInfo.e_ID, "001001001");//是否拥有管理的权限
     ViewData["IsHasFunRole"] = true;
     Model.MenuBase model = new Model.MenuBase();
     this.ViewData["texOtype"] = RequestBase.GetString("otype");
     switch (RequestBase.GetString("otype"))
     {
         case "modify":
             string ids = RequestBase.GetString("dli_id");
             Guid id = new Guid(ids.Split('|')[0]);
             model = mbBLL.GetModel(id);
             ViewData["hfShow"] = model.m_IsShow;//是否显示导航
             //系统管理
             string bianm = model.m_BianM.Trim();
             if (bianm.Substring(0, 3) == "002" && bianm.Length != 3)
             { ViewData["IsShow"] = true; }
             return View(model);
         default:
             string pids = RequestBase.GetString("dli_id");
             ViewData["hfPId"] = pids;
             string pid = pids.Split('|')[0];
             if (pid != "00000000-0000-0000-0000-000000000000")
             {
                 string pbianm = pids.Split('|')[2];
                 if (pbianm.Substring(0, 3) == "002")
                     ViewData["IsShow"] = true;
             }
             return View();
     }
 }