Ejemplo n.º 1
0
    //-----------------------------------------------
    //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);
    }
Ejemplo n.º 2
0
    //-----------------------------------------------
    //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);
        }
    }
Ejemplo n.º 3
0
    //--------------------------------------------------------
    #endregion

    #region --------------DeleteItem--------------

    protected override bool DeleteItem(int id)
    {
        return(AdvPlacesFactory.Delete(id));
    }
Ejemplo n.º 4
0
    //---------------------------------------------------------
    //LoadData
    //---------------------------------------------------------
    protected override void LoadData()
    {
        List <AdvPlacesEntity> advPlacesList = AdvPlacesFactory.GetAll(AdvPlaceTypes.UnDefined);

        LoadGrid(advPlacesList, "PlaceID");
    }
Ejemplo n.º 5
0
    //---------------------------------------------------------
    //Load_ddlAdvPlaces
    //---------------------------------------------------------
    protected void Load_ddlAdvPlaces()
    {
        List <AdvPlacesEntity> AdvPlacesList = AdvPlacesFactory.GetAll(PlaceType);

        OurDropDownList.LoadDropDownList <AdvPlacesEntity>(AdvPlacesList, ddlAdvPlaces, "Title", "PlaceID", true);
    }