Ejemplo n.º 1
0
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            RatingManager manager = new RatingManager();
            int           id      = Convert.ToInt32(RatingDropDownList.SelectedValue);

            manager.Delete(id);
            DoDataBind();
            RatingTextBox.Text = string.Empty;
            manager.Dispose();
        }
Ejemplo n.º 2
0
        protected void AddButton_Click(object sender, EventArgs e)
        {
            RatingManager manager = new RatingManager();
            Rating        rating  = new Rating {
                Description = RatingTextBox.Text
            };

            manager.Create(rating);
            DoDataBind();
            manager.Dispose();
        }
Ejemplo n.º 3
0
        private void DoDataBind()
        {
            RatingManager manager = new RatingManager();

            RatingDropDownList.DataValueField = "Id";
            RatingDropDownList.DataTextField  = "Description";
            RatingDropDownList.DataSource     = manager.GetAll();
            RatingDropDownList.DataBind();
            UpdateTextBoxes();
            manager.Dispose();
        }
Ejemplo n.º 4
0
        protected void EditButton_Click(object sender, EventArgs e)
        {
            RatingManager manager = new RatingManager();
            Rating        rating  = new Rating {
                Description = RatingTextBox.Text
            };

            rating.Id = Convert.ToInt32(RatingDropDownList.SelectedValue);
            manager.Update(rating);
            DoDataBind();
            manager.Dispose();
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RatingManager manager = new RatingManager();

            AllRatings = manager.GetAll();
            if (!IsPostBack)
            {
                DoDataBind();
            }
            else
            {
                AllRatings = manager.GetAll();
            }
            manager.Dispose();
        }
Ejemplo n.º 6
0
 public void CleanUpAfterEachTest()
 {
     manager.Dispose();
 }