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
    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;
            }
            }
        }
    }
Esempio n. 4
0
 /// <summary>
 /// 注销
 /// </summary>
 public static void LogOut()
 {
     System.Web.HttpContext context = System.Web.HttpContext.Current;
     context.Session.Abandon();
     SiteAbout.DeleteCookie("UserId");
     SiteAbout.DeleteCookie("LoginName");
     SiteAbout.DeleteCookie("UserName");
     SiteAbout.DeleteCookie("IsSuper");
 }
Esempio n. 5
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. 6
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);
    }