コード例 #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);
    }
コード例 #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);
        }
    }
コード例 #3
0
ファイル: default.aspx.cs プロジェクト: elshiekh5/CMS.V6
    //--------------------------------------------------------
    #endregion

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

    protected override bool DeleteItem(int id)
    {
        return(AdvPlacesFactory.Delete(id));
    }
コード例 #4
0
ファイル: default.aspx.cs プロジェクト: elshiekh5/CMS.V6
    //---------------------------------------------------------
    //LoadData
    //---------------------------------------------------------
    protected override void LoadData()
    {
        List <AdvPlacesEntity> advPlacesList = AdvPlacesFactory.GetAll(AdvPlaceTypes.UnDefined);

        LoadGrid(advPlacesList, "PlaceID");
    }
コード例 #5
0
    //---------------------------------------------------------
    //Load_ddlAdvPlaces
    //---------------------------------------------------------
    protected void Load_ddlAdvPlaces()
    {
        List <AdvPlacesEntity> AdvPlacesList = AdvPlacesFactory.GetAll(PlaceType);

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