示例#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
        public ActionResult EditPageDelKitActionResult(string pagecode, string kitId)
        {
            user_account userAccount = new user_account();
            apppagebase  appPageBase = new apppagebase();
            appbase      appBase     = new appbase();
            JsonResult   jsonResult  = new JsonResult();

            jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            pagecode = DESEncrypt.Decrypt(pagecode);
            if (pagecode == null)
            {
                Msg.Result = 0;
                Msg.Msg    = "错误编码";
            }
            else
            {
                appPageBase = new Psd.H5Show.BLL.apppagebase().GetModel(int.Parse(pagecode));
                appBase     = new Psd.H5Show.BLL.appbase().GetModel(appPageBase.AppId);
                if (Request.Cookies["PsdH5ShowUserCode"] == null)
                {
                    Msg.Result = 0;
                    Msg.Msg    = "哎哟,你还未登录呢";
                }
                else
                {
                    userAccount =
                        Psd.H5Show.BLL.AppTools.GetUserCodeToUseraccountModel(
                            Request.Cookies["PsdH5ShowUserCode"].Value.ToString());
                    if (!userAccount.ID.Equals(appBase.Uid))
                    {
                        Msg.Result = 0;
                        Msg.Msg    = "无权限编辑此页面";
                    }
                    else
                    {
                        if (new Psd.H5Show.BLL.apppageinfo().Delete(int.Parse(kitId)))
                        {
                            Msg.Result = 1;
                            Msg.Msg    = "删除成功";
                        }
                        else
                        {
                            Msg.Result = 0;
                            Msg.Msg    = "删除失败";
                        }
                    }
                }
                jsonResult.Data = Msg;
            }
            return(jsonResult);
        }
示例#3
0
        public ActionResult GetAppPageKit(string pagecode, string appcode)
        {
            JsonResult json = new JsonResult();

            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            List <apppageinfo> AppPageKitList = new List <apppageinfo>();
            user_account       userAccount    = new user_account();
            apppagebase        appPageBase    = new apppagebase();
            appbase            appBase        = new appbase();
            JsonResult         jsonResult     = new JsonResult();

            jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            pagecode = DESEncrypt.Decrypt(pagecode);
            if (pagecode == null)
            {
                Msg.Result = 0;
                Msg.Msg    = "错误编码";
            }
            else
            {
                appPageBase = new Psd.H5Show.BLL.apppagebase().GetModel(int.Parse(pagecode));
                appBase     = new Psd.H5Show.BLL.appbase().GetModel(appPageBase.AppId);
                if (Request.Cookies["PsdH5ShowUserCode"] == null)
                {
                    Msg.Result = 0;
                    Msg.Msg    = "哎哟,你还未登录呢";
                }
                else
                {
                    userAccount =
                        Psd.H5Show.BLL.AppTools.GetUserCodeToUseraccountModel(
                            Request.Cookies["PsdH5ShowUserCode"].Value.ToString());
                    if (!userAccount.ID.Equals(appBase.Uid))
                    {
                        Msg.Result = 0;
                        Msg.Msg    = "无权限编辑此页面";
                    }
                    else
                    {
                        AppPageKitList = new Psd.H5Show.BLL.apppageinfo().GetModelList(" Pageid='" + pagecode + "'");

                        json.Data = AppPageKitList;
                    }
                }
            }
            return(json);
        }
示例#4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Psd.H5Show.Model.user_account model)
 {
     return(dal.Update(model));
 }
示例#5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Psd.H5Show.Model.user_account model)
 {
     return(dal.Add(model));
 }
示例#6
0
        public ActionResult EditPageCreateKitActionResult(string pagecode, string t)
        {
            user_account userAccount = new user_account();
            apppagebase  appPageBase = new apppagebase();
            appbase      appBase     = new appbase();
            JsonResult   jsonResult  = new JsonResult();

            jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            pagecode = DESEncrypt.Decrypt(pagecode);
            if (pagecode == null)
            {
                Msg.Result = 0;
                Msg.Msg    = "错误编码";
            }
            else
            {
                appPageBase = new Psd.H5Show.BLL.apppagebase().GetModel(int.Parse(pagecode));
                appBase     = new Psd.H5Show.BLL.appbase().GetModel(appPageBase.AppId);
                if (Request.Cookies["PsdH5ShowUserCode"] == null)
                {
                    Msg.Result = 0;
                    Msg.Msg    = "哎哟,你还未登录呢";
                }
                else
                {
                    userAccount =
                        Psd.H5Show.BLL.AppTools.GetUserCodeToUseraccountModel(
                            Request.Cookies["PsdH5ShowUserCode"].Value.ToString());
                    if (!userAccount.ID.Equals(appBase.Uid))
                    {
                        Msg.Result = 0;
                        Msg.Msg    = "无权限编辑此页面";
                    }
                    else
                    {
                        switch (t)
                        {
                        case "image":     //图片类型  图片控件初始化加载 配置

                            apppageinfo appPageInfo = new apppageinfo();
                            appPageInfo.PageId        = int.Parse(pagecode);
                            appPageInfo.KitAnDelay    = 0.5;
                            appPageInfo.KitAnDuration = 0.5;
                            appPageInfo.KitAnEffect   = "fadeInUp";
                            appPageInfo.KitAngleZ     = "0";
                            appPageInfo.KitLeft       = "0px";
                            appPageInfo.KitTop        = "0px";
                            appPageInfo.KitType       = t;
                            appPageInfo.KitStyle      = "";
                            appPageInfo.KitLinkUrl    = "";
                            appPageInfo.KitLinkType   = 0;
                            appPageInfo.KitWidth      = "auto";
                            appPageInfo.KitHeight     = "auto";
                            appPageInfo.KitContent    = "<img src=\"../../content/image/demo.png\">";
                            appPageInfo.ID            = Psd.H5Show.BLL.AppTools.getMaxIdToTable("apppageinfo") + 1;
                            var imgcontrol =
                                "<div class='imgview ani' swiper-animate-effect='" + appPageInfo.KitAnEffect +
                                "' swiper-animate-duration='" + appPageInfo.KitAnDuration +
                                "s' swiper-animate-delay='" + appPageInfo.KitAnDelay + "s' width='" +
                                appPageInfo.KitWidth + "' " +
                                " Ptype='imgview' link='" + appPageInfo.KitLinkType + "|" + appPageInfo.KitLinkUrl +
                                "' id='" + appPageInfo.ID.ToString() + "' style='style='left:" + appPageInfo.KitTop +
                                ";top:" + appPageInfo.KitTop +
                                ";z-index:1'>" + appPageInfo.KitContent + "</div >";
                            try
                            {
                                new Psd.H5Show.BLL.apppageinfo().Add(appPageInfo);
                                List <apppageinfo> KitList =
                                    new Psd.H5Show.BLL.apppageinfo().GetModelList(" PageId='" + pagecode + "'");
                                Msg.Result = 1;
                                Msg.Msg    = imgcontrol;
                            }
                            catch (Exception es)
                            {
                                Msg.Msg = es.ToString();
                                throw;
                            }


                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            jsonResult.Data = Msg;
            return(jsonResult);
        }
示例#7
0
        public ActionResult editAppPageBase(string appCode, string pagecode, string type)
        {
            JsonResult json = new JsonResult();

            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            if (Request.Cookies["PsdH5ShowUserCode"] == null)
            {
                Msg.Result = 0;
                Msg.Msg    = "哎哟,你还未登录呢";
            }
            else
            {
                pagecode = DESEncrypt.Decrypt(pagecode);
                appCode  = DESEncrypt.Decrypt(appCode);
                user_account userAccount =
                    Psd.H5Show.BLL.AppTools.GetUserCodeToUseraccountModel(
                        Request.Cookies["PsdH5ShowUserCode"].Value.ToString());
                if (userAccount != null)
                {
                    switch (type)
                    {
                    case "del":
                        apppagebase appPageBase = new Psd.H5Show.BLL.apppagebase().GetModel(int.Parse(pagecode));
                        appPageBase.DelFlag = true;
                        if (new Psd.H5Show.BLL.apppagebase().Update(appPageBase))
                        {
                            List <apppagebase> appPageBasesList =
                                new Psd.H5Show.BLL.apppagebase().GetModelList(" Appid='" + appCode +
                                                                              "' and DELFLAG=0 order by orderby");
                            foreach (apppagebase appPageBases in appPageBasesList)
                            {
                                if (appPageBases.OrderBy >= appPageBase.OrderBy)
                                {
                                    appPageBases.OrderBy = appPageBases.OrderBy - 1;
                                    new Psd.H5Show.BLL.apppagebase().Update(appPageBases);
                                }
                            }
                            Msg.Result = 1;
                            Msg.Msg    = "欧耶,页面删除成功";
                        }
                        else
                        {
                            Msg.Result = 0;
                            Msg.Msg    = "哎哟,页面删除失败咯";
                        }
                        break;

                    case "up":
                        Msg.Result = 1;
                        Msg.Msg    = "欧耶,向上移动";
                        changepage(appCode, pagecode, -1);
                        break;

                    case "down":
                        Msg.Result = 1;
                        Msg.Msg    = "欧耶,向下移动";
                        changepage(appCode, pagecode, 1);
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    Msg.Result = 0;
                    Msg.Msg    = "哎哟,获取用户发生错误";
                }
            }
            json.Data = Msg;
            return(json);
        }