Esempio n. 1
0
    protected void btn_delete_Click(object sender, EventArgs e)
    {
        int id = SiteAbout.gInt("id");

        bll.Delete(id);
        Response.Redirect("./tbl_xueyuan.aspx");
    }
Esempio n. 2
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\"}");
            }
        }
    }
Esempio n. 3
0
    private void DeleteGuideDetail()
    {
        int id = SiteAbout.gInt("id");

        Response.ContentType = "application/json";
        if (bllGuide.Delete(id))
        {
            Response.Write("{\"status\":\"true\"}");
        }
        else
        {
            Response.Write("{\"status\":\"false\"}");
        }
    }
Esempio n. 4
0
    private void GetGuideDetail()
    {
        int id = SiteAbout.gInt("id");

        zs.Model.Tbl_Guide modelGuide = bllGuide.GetModel(id);
        string             temp       = "";

        if (modelGuide != null)
        {
            temp = ("{\"id\":\"" + id +
                    "\",\"name\":\"" + modelGuide.name +
                    "\",\"url\":\"" + modelGuide.url +
                    "\",\"type\":\"" + modelGuide.type +
                    "\",\"sortid\":\"" + modelGuide.sortid.ToString() + "\"}");
        }
        Response.ContentType = "application/json";
        Response.Write(temp);
    }