Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public ActionResult GetPageList(string appCode)
        {
            JsonResult json = new JsonResult();

            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;

            appCode = DESEncrypt.Decrypt(appCode);
            if (appCode != null)
            {
                apppagebase appPageBase = new apppagebase();
                DataTable   dataTable   =
                    new Psd.H5Show.BLL.apppagebase().GetList(" appid='" + appCode + "' and DELFLAG=0 order by orderby")
                    .Tables[0];

                if (dataTable.Rows.Count > 0)
                {
                    string result = "{\"pagelist\": [";
                    Msg.Result = 1;
                    foreach (DataRow datarow in dataTable.Rows)
                    {
                        string str = "{\"name\": \"@name\",\"pagecode\": \"@pagecode\",\"index\": \"@index\"},";
                        str     = str.Replace("@name", datarow["TITLE"].ToString());
                        str     = str.Replace("@pagecode", DESEncrypt.Encrypt(datarow["ID"].ToString()));
                        str     = str.Replace("@index", datarow["orderby"].ToString());
                        result += str;
                    }
                    result  = result.Substring(0, result.Length - 1);
                    result += "]}";
                    Msg.Msg = result;
                }
                else
                {
                    Msg.Result = 0;
                    Msg.Msg    = "无页面,请添加";
                }
            }
            else
            {
                Msg.Result = 0;
                Msg.Msg    = "appCode错误";
            }
            json.Data = Msg;
            return(json);
        }
Beispiel #4
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);
        }