private void BindGrid() { ThingDataAccess TDA = new ThingDataAccess(); gvThings.DataSource = TDA.GetThingList(); gvThings.DataBind(); }
private ThingProperty GetThingProperty() { _thingPropertyId = Int32.Parse(Page.Request.QueryString["id"]); TDA = new ThingDataAccess(); _thingProperty = TDA.GetThingProperty(_thingPropertyId); Session["thingProperty"] = _thingProperty; return(_thingProperty); }
protected void btnSave_Click(object sender, EventArgs e) { int ownerId = _id; int propertyId = Int32.Parse(ddlTypes.SelectedValue); TDA = new ThingDataAccess(); TDA.InsertThingProperty(ownerId, propertyId, txtName.Text, txtDescription.Text, cbList.Checked); Response.Redirect("EditThing.aspx?id=" + ownerId); }
protected void Page_Load(object sender, EventArgs e) { _id = Int32.Parse(Page.Request.QueryString["id"]); if (!IsPostBack) { TDA = new ThingDataAccess(); Thing thing = LoadThing(_id); lblOwnerName.Text = "Owner Thing: " + thing.Name; BindPropertyDDL(); } }
protected void btnSave_Click(object sender, EventArgs e) { _thingProperty = Session["thingProperty"] != null ? (ThingProperty)Session["thingProperty"] : GetThingProperty(); _thingProperty.ThingPropertyId = _thingPropertyId; _thingProperty.OwnerThing = new Thing(); _thingProperty.OwnerThing.Id = Int32.Parse(lblId.Text); _thingProperty.OwnedThing = new Thing(); _thingProperty.OwnedThing.Id = Int32.Parse(ddlTypes.SelectedValue); _thingProperty.PropertyName = txtName.Text; _thingProperty.PropertyDescription = txtDescription.Text; _thingProperty.IsList = cbList.Checked; TDA = new ThingDataAccess(); TDA.UpdateThingProperty(_thingProperty); Response.Redirect("EditThing.aspx?id=" + _thingProperty.OwnerThing.Id); }
protected void Page_Load(object sender, EventArgs e) { TDA = new ThingDataAccess(); int id = Int32.Parse(Page.Request.QueryString["id"]); Thing thing = LoadThing(id); if (!IsPostBack) { txtId.Text = id.ToString(); txtDescription.Text = thing.Description; txtName.Text = thing.Name; LoadThingDDL(); LoadPropertiesGrid(id); } }
protected void Page_Load(object sender, EventArgs e) { TDA = new ThingDataAccess(); LoadThingDDL(); }