Exemplo n.º 1
0
        private void BindGrid()
        {
            ThingDataAccess TDA = new ThingDataAccess();

            gvThings.DataSource = TDA.GetThingList();
            gvThings.DataBind();
        }
Exemplo n.º 2
0
 private ThingProperty GetThingProperty()
 {
     _thingPropertyId = Int32.Parse(Page.Request.QueryString["id"]);
     TDA                      = new ThingDataAccess();
     _thingProperty           = TDA.GetThingProperty(_thingPropertyId);
     Session["thingProperty"] = _thingProperty;
     return(_thingProperty);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 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();
     }
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TDA = new ThingDataAccess();
     LoadThingDDL();
 }