Beispiel #1
0
 protected void lnkUpdate_Click(object sender, EventArgs e)
 {
     if ((!place.PlaceName.Equals(PlaceName.Text.Trim())) && (BLLPlace.checkPlaceExist(PlaceName.Text) != 0))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "Notify", "alert('!!!Place Name existed. Please try again');", true);
     }
     else
     {
         Place newPlace = new Place();
         newPlace.PlaceID   = place.PlaceID;
         newPlace.PlaceName = PlaceName.Text.Trim();
         int k = BLLPlace.UpdatePlace(newPlace);
         Response.Redirect("PlaceList.aspx");
     }
 }
Beispiel #2
0
    protected void lnkBtnSave_Click(object sender, EventArgs e)
    {
        string name = PlaceName.Text.Trim();

        if (BLLPlace.checkPlaceExist(name) != 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Notify", "alert('!!!Place Name existed. Please try again');", true);
        }
        else
        {
            Place place = new Place();
            place.PlaceName = name;
            BLLPlace.InsertPlace(place);
            Response.Redirect("PlaceList.aspx");
        }
    }