//----------------------------------------------- //SaveData //----------------------------------------------- protected override object SaveData() { AdvPlacesEntity advPlace = (AdvPlacesEntity)LoadObject(); if (advPlace != null) { SPOperation operation; if (pageType == PagesTypes.AdminAdd) { operation = SPOperation.Insert; } else { operation = SPOperation.Update; } status = AdvPlacesFactory.Save(advPlace, operation); } return(advPlace); }
//----------------------------------------------- //LoadControls //----------------------------------------------- protected override bool LoadControls() { int placeID = Convert.ToInt32(Request.QueryString["id"]); AdvPlacesEntity advPlaces = AdvPlacesFactory.GetObject(placeID); if (advPlaces != null) { txtPlaceID.Text = advPlaces.PlaceID.ToString(); txtPlaceIdentifier.Text = advPlaces.PlaceIdentifier; txtTitle.Text = advPlaces.Title; txtWidth.Text = advPlaces.Width.ToString(); txtHeight.Text = advPlaces.Height.ToString(); txtDefaultFilePath.Text = advPlaces.DefaultFilePath; // txtDefaultFileType.Text = advPlaces.DefaultFileType.ToString(); //----------------------------------------------------------------- if (SiteSettings.Adv_HasIsRandom) { cbIsRandom.Checked = advPlaces.IsRandom; } //----------------------------------------------------------------- if (SiteSettings.Adv_EnableSeparatedAd) { cbEnableSeparatedAd.Checked = advPlaces.EnableSeparatedAd; txtEnableSeparatedCount.Text = advPlaces.EnableSeparatedCount.ToString(); } //----------------------------------------------------------------- ddlPlaceType.SelectedValue = ((int)advPlaces.PlaceType).ToString(); //----------------------------------------------------------------- return(true); } else { return(false); } }
//-------------------------------------------------------- #endregion #region --------------DeleteItem-------------- protected override bool DeleteItem(int id) { return(AdvPlacesFactory.Delete(id)); }
//--------------------------------------------------------- //LoadData //--------------------------------------------------------- protected override void LoadData() { List <AdvPlacesEntity> advPlacesList = AdvPlacesFactory.GetAll(AdvPlaceTypes.UnDefined); LoadGrid(advPlacesList, "PlaceID"); }
//--------------------------------------------------------- //Load_ddlAdvPlaces //--------------------------------------------------------- protected void Load_ddlAdvPlaces() { List <AdvPlacesEntity> AdvPlacesList = AdvPlacesFactory.GetAll(PlaceType); OurDropDownList.LoadDropDownList <AdvPlacesEntity>(AdvPlacesList, ddlAdvPlaces, "Title", "PlaceID", true); }