protected void lnkBtnSave_Click(object sender, EventArgs e)
    {
        string promoteName = PromoteName.Text;
        string discount    = Discount.Text;

        if ((!promote.PromoteName.Equals(promoteName)) && (BLLPromote.checkPromoteExistName(promoteName) != 0))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Notify", "alert('!!!Promote Name existed. Please try again');", true);
        }
        else
        {
            Promote newPromote = new Promote();
            newPromote.PromoteID   = promote.PromoteID;
            newPromote.PromoteName = promoteName;
            newPromote.Discount    = Int32.Parse(discount);
            if (cbStatus.Checked)
            {
                newPromote.Status = true;
            }
            else
            {
                newPromote.Status = false;
            }
            BLLPromote.UpdatePromote(newPromote);
            Response.Redirect("PromoteList.aspx");
        }
    }
Esempio n. 2
0
    protected void lnkBtnSave_Click(object sender, EventArgs e)
    {
        string promoteName = PromoteName.Text;
        string discount    = Discount.Text;

        if (BLLPromote.checkPromoteExistName(promoteName) != 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Notify", "alert('!!!Promote Name existed. Please try again');", true);
        }
        else
        {
            Promote promote = new Promote();
            promote.PromoteName = promoteName;
            promote.Discount    = Int32.Parse(discount);
            promote.Status      = true;
            BLLPromote.InsertPromote(promote);
            Response.Redirect("PromoteList.aspx");
        }
    }