예제 #1
0
        public ActionResult CreateAppPage(string PageName, string appCode)
        {
            try
            {
                appCode = DESEncrypt.Decrypt(appCode);
            }
            catch (Exception)
            {
                Msg.Result = 0;
                Msg.Msg    = "不要乱修改信息嘛,不然我会中毒的";
                throw;
            }
            JsonResult json = new JsonResult();

            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            if (Request.Cookies["PsdH5ShowUserCode"] == null)
            {
                Msg.Result = 0;
                Msg.Msg    = "哎哟,你还未登录呢";
            }
            else
            {
                user_account userAccount =
                    Psd.H5Show.BLL.AppTools.GetUserCodeToUseraccountModel(
                        Request.Cookies["PsdH5ShowUserCode"].Value.ToString());
                if (userAccount != null)
                {
                    List <apppagebase> appPageBasesList =
                        new Psd.H5Show.BLL.apppagebase().GetModelList(" Appid='" + appCode +
                                                                      "' and DELFLAG=0 order by orderby");
                    int maxindex = 0;
                    foreach (apppagebase appPageBases in appPageBasesList)
                    {
                        if (maxindex < appPageBases.OrderBy)
                        {
                            maxindex = appPageBases.OrderBy;
                        }
                    }

                    Psd.H5Show.Model.apppagebase appPageBase = new Psd.H5Show.Model.apppagebase();
                    appPageBase.AppId      = int.Parse(appCode);
                    appPageBase.CreateTime = DateTime.Now;
                    appPageBase.Title      = PageName;
                    appPageBase.OrderBy    = maxindex + 1;
                    if (new Psd.H5Show.BLL.apppagebase().Add(appPageBase))
                    {
                        Msg.Result = 1;
                        Msg.Msg    = "哎哟,已经为您创建了新的页面,快去发挥您的洪荒之力吧!";
                    }
                    else
                    {
                        Msg.Result = 0;
                        Msg.Msg    = "报告大王,页面创建失败!";
                    }
                }
            }
            json.Data = Msg;
            return(json);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Psd.H5Show.Model.apppagebase model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Psd.H5Show.Model.apppagebase model)
 {
     return(dal.Add(model));
 }