Esempio n. 1
0
    protected void btnType_Click(object sender, EventArgs e)
    {
        MyHomeType type = new MyHomeType();

        type.TypeName  = txtType.Text;
        type.Datatimes = DateTime.Now;
        type.LoginID   = 1;
        type.LoginName = "admin";// Page.User.Identity.Name.Trim();
        type.sort      = Convert.ToInt32(txtTypeSort.Text);

        int num = TypeManager.InsertHomeType(type);

        if (num > 0)
        {
            Response.Write("<script>alert('添加成功!');</script>");
        }
        else
        {
            Response.Write("<script>alert('添加失败!');</script>");
        }
    }
Esempio n. 2
0
    protected void btnType_Click(object sender, EventArgs e)
    {
        MyHomeType type = new MyHomeType();

        type.TypeName  = txtType.Text;
        type.Datatimes = DateTime.Now;
        type.LoginID   = 1;
        type.LoginName = Page.User.Identity.Name.Trim();
        type.sort      = Convert.ToInt32(txtTypeSort.Text);

        int num = TypeManager.InsertHomeType(type);

        if (num > 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功!');", true);
            TypeBind();
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加失败,或者数量已超过6条');", true);
        }
    }