示例#1
0
    private Tools.Result BindEvents()
    {
        DataTable Dt = DALC.GetEventsByID(_EventsID);

        if (Dt == null)
        {
            return(Tools.Result.Dt_Null);
        }

        if (Dt.Rows.Count < 1)
        {
            return(Tools.Result.Dt_Rows_Count_0);
        }

        DListEventsTypes.SelectedValue          = Dt._Rows("EventsTypesID");
        DListOrganizations.SelectedValue        = Dt._Rows("OrganizationsID");
        DListEventsDirectionTypes.SelectedValue = Dt._Rows("EventsDirectionTypesID");
        DListEventsPolicyTypes.SelectedValue    = Dt._Rows("EventsPolicyTypesID");
        TxtName.Text           = Dt._Rows("Name");
        TxtSubject.Text        = Dt._Rows("Subject");
        TxtPlace.Text          = Dt._Rows("Place");
        TxtOrganizer.Text      = Dt._Rows("Organizer");
        TxtMemberCount.Text    = Dt._Rows("MemberCount");
        TxtDescription.Text    = Dt._Rows("Description");
        TxtEvents_StartDt.Text = ((DateTime)Dt._RowsObject("Events_StartDt")).ToString("dd.MM.yyyy");
        TxtEvents_EndDt.Text   = ((DateTime)Dt._RowsObject("Events_EndDt")).ToString("dd.MM.yyyy");

        #region Photos
        //Other fotos

        DataTable DtImages = DALC.GetDownloadsByDataID((int)Tools.DownloadsTypes.Təlim_Tədbir, _EventsID);
        RptFotoGallery.DataSource = DtImages;
        RptFotoGallery.DataBind();

        #endregion

        return(Tools.Result.Succes);
    }
示例#2
0
    private void BindGallery()
    {
        RptFotoGallery.DataSource = null;
        RptFotoGallery.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        FilterDictionary = new Dictionary <string, object>()
        {
            { "OrganizationsID", int.Parse(DListFilterOrganizations.SelectedValue) },
            { "DataID(!=)", 0 },
            { "DownloadsQualityTypesID", int.Parse(DListFilterDownloadsQualityTypes.SelectedValue) },
            { "DisplayName(LIKE)", TxtFilterFileName.Text },
            { "IsActive", int.Parse(DListFilterStatus.SelectedValue) },
        };

        if (PnlFilterDate.Visible == true)
        {
            FilterDictionary.Add("DownloadsTypesID", int.Parse(DListFilterDownloadsTypes.SelectedValue));
            FilterDictionary.Add("Years", int.Parse(DListFilterYears.SelectedValue));
            FilterDictionary.Add("Months", int.Parse(DListFilterMonths.SelectedValue));
        }


        int PageNum;
        int RowNumber = 20;

        if (!int.TryParse(Config._GetQueryString("p"), out PageNum))
        {
            PageNum = 1;
        }


        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult FilterList = DALC.GetFilterList(TableName, FilterDictionary, PageNum, RowNumber);

        if (FilterList.Count == -1)
        {
            return;
        }

        if (FilterList.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.RedirectURL(string.Format("/tools/downloads/?p={0}", PageNum - 1));
        }

        int Total_Count = 0;

        if (FilterList.Count % RowNumber > 0)
        {
            Total_Count = (FilterList.Count / RowNumber) + 1;
        }
        else
        {
            Total_Count = FilterList.Count / RowNumber;
        }

        HdnTotalCount.Value = Total_Count.ToString();
        PnlPager.Visible    = FilterList.Count > RowNumber;

        RptFotoGallery.DataSource = FilterList.Dt;
        RptFotoGallery.DataBind();
    }