Beispiel #1
0
        /// <summary>
        /// Handles the Delete event of the gLocationTypes control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RowEventArgs" /> instance containing the event data.</param>
        protected void gLocationTypes_Delete(object sender, RowEventArgs e)
        {
            int locationTypeId = (int)e.RowKeyValue;

            LocationTypesDictionary.Remove(locationTypeId);
            BindLocationTypesGrid();
        }
Beispiel #2
0
        /// <summary>
        /// Handles the Click event of the btnAddLocationType control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void btnAddLocationType_Click(object sender, EventArgs e)
        {
            LocationTypesDictionary.Add(int.Parse(ddlLocationType.SelectedValue), ddlLocationType.SelectedItem.Text);

            pnlLocationTypePicker.Visible = false;
            pnlDetails.Visible            = true;

            BindLocationTypesGrid();
        }
Beispiel #3
0
 /// <summary>
 /// Binds the location types grid.
 /// </summary>
 private void BindLocationTypesGrid()
 {
     gLocationTypes.DataSource = LocationTypesDictionary.OrderBy(a => a.Value).ToList();
     gLocationTypes.DataBind();
 }