Exemplo n.º 1
0
    private void SetGuideDetail()
    {
        int    id     = SiteAbout.gInt("id");
        string name   = SiteAbout.gStr("name");
        string url    = SiteAbout.gStr("url");
        string type   = SiteAbout.gStr("type");
        int    sortid = SiteAbout.gInt("sortid");

        if (id > 0)
        {
            zs.Model.Tbl_Guide modelGuide = bllGuide.GetModel(id);
            modelGuide.sortid    = sortid;
            modelGuide.type      = type;
            modelGuide.url       = url;
            modelGuide.name      = name;
            Response.ContentType = "application/json";
            if (bllGuide.Update(modelGuide))
            {
                if (type == "news")
                {
                    modelGuide.url = "./newslist.aspx?id=" + ApplicationMethod.encript(id.ToString());
                    bllGuide.Update(modelGuide);
                }
                Response.Write("{\"status\":\"true\"}");
            }
            else
            {
                Response.Write("{\"status\":\"false\"}");
            }
        }
        else
        {
            if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(url) || string.IsNullOrEmpty(type))
            {
                return;
            }
            zs.Model.Tbl_Guide modelGuide = new zs.Model.Tbl_Guide();
            modelGuide.pid       = 0;
            modelGuide.sortid    = sortid;
            modelGuide.type      = type;
            modelGuide.url       = url;
            modelGuide.name      = name;
            Response.ContentType = "application/json";
            int ret = bllGuide.Add(modelGuide);
            if (ret > 0)
            {
                if (type == "news")
                {
                    modelGuide.id  = ret;
                    modelGuide.url = "./newslist.aspx?id=" + ApplicationMethod.encript(ret.ToString());
                    bllGuide.Update(modelGuide);
                }
                Response.Write("{\"status\":\"true\"}");
            }
            else
            {
                Response.Write("{\"status\":\"false\"}");
            }
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string op = SiteAbout.gStr("op");

        if (!IsPostBack)
        {
            switch (op)
            {
            case "GetGuideForZtree":
            {
                GetGuideForZtree();
                break;
            }

            case "GetGuideDetail":
            {
                GetGuideDetail();
                break;
            }

            case "SetGuideDetail":
            {
                SetGuideDetail();
                break;
            }

            case "DeleteGuideDetail":
            {
                DeleteGuideDetail();
                break;
            }
            }
        }
    }