Exemplo n.º 1
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_wjcd_class Hyoa_wjcd_class = new HyoaClass.Hyoa_wjcd_class();
        if (this.txtop.Value == "add")
        {
            Hyoa_wjcd_class.ID = Hyoa_global.GetRandom();
            Hyoa_wjcd_class.ClassName = this.txtname.Value;
            Hyoa_wjcd_class.ClassSort = System.Int32.Parse(this.txtsort.Value);
            Hyoa_wjcd_class.Insert();
        }
        else
        {
            Hyoa_wjcd_class.ID = this.txtdocid.Value;
            Hyoa_wjcd_class.ClassName = this.txtname.Value;
            Hyoa_wjcd_class.ClassSort = System.Int32.Parse(this.txtsort.Value);
            Hyoa_wjcd_class.Update();
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }