当前位置: 首页>>代码示例>>C#>>正文


C# QueryDataParameters.AddId方法代码示例

本文整理汇总了C#中QueryDataParameters.AddId方法的典型用法代码示例。如果您正苦于以下问题:C# QueryDataParameters.AddId方法的具体用法?C# QueryDataParameters.AddId怎么用?C# QueryDataParameters.AddId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryDataParameters的用法示例。


在下文中一共展示了QueryDataParameters.AddId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        // Get culture ID from query string
        uiCultureID = QueryHelper.GetInteger("UIcultureID", 0);

        // Get requested culture
        ui = UICultureInfoProvider.GetSafeUICulture(uiCultureID);

        UICultureInfo dui = null;
        // Check if edited UI culture is the default UI culture
        if ((ui != null) && CMSString.Equals(ui.UICultureCode, CultureHelper.DefaultUICulture, true))
        {
            dui = ui;
            // Use different grid definition
            gridStrings.GridName = "List_defaultculture.xml";
        }
        else
        {
            // Ty to get default UI culture
            try
            {
                dui = UICultureInfoProvider.GetUICultureInfo(CultureHelper.DefaultUICulture);
            }
            catch
            {
            }
        }

        if (dui != null)
        {
            EditedObject = ui;

            // Prepare query params for the grid
            QueryDataParameters parameters = new QueryDataParameters();
            parameters.Add("@Culture", ui.UICultureID);
            parameters.AddId("@DefaultUICultureID", dui.UICultureID);

            // Setup the grid
            gridStrings.QueryParameters = parameters;
            gridStrings.OnAction += UniGridUICultures_OnAction;
            gridStrings.OnExternalDataBound += UniGridStrings_OnExternalDataBound;

            InitializeMasterPage();
        }
        else
        {
            // Default UI culture does not exist - hide the grid and display error message
            gridStrings.StopProcessing = true;

            ShowError(String.Format(GetString("uiculture.defaultnotexist"), CultureHelper.DefaultUICulture));
        }
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:52,代码来源:List.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        gridStrings.OnAction += UniGridCultures_OnAction;

        CurrentMaster.DisplaySiteSelectorPanel = true;

        cultureSelector.OnSelectionChanged += cultureSelector_OnSelectionChanged;
        cultureSelector.DropDownSingleSelect.AutoPostBack = true;
        cultureSelector.OnListItemCreated += cultureSelector_OnListItemCreated;

        mCultureCode = QueryHelper.GetString("culturecode", CultureHelper.DefaultUICultureCode);
        mCultureInfo = CultureInfoProvider.GetCultureInfo(mCultureCode);

        if (mCultureInfo != null && mDefaultUICultureInfo != null)
        {
            QueryDataParameters parameters = new QueryDataParameters();
            parameters.Add("@Culture", mCultureInfo.CultureID);
            parameters.AddId("@DefaultCultureID", mDefaultUICultureInfo.CultureID);
            gridStrings.QueryParameters = parameters;

            string defaultTextCaption = String.Format(GetString("culture.defaultwithparameter"), CultureHelper.DefaultUICultureCode);
            gridStrings.GridColumns.Columns.Find(column => column.Source == "DefaultText").Caption = defaultTextCaption;

            if (CurrentCultureIsDefault)
            {
                // Set default translation column to full width
                gridStrings.GridColumns.Columns[2].Width = "100%";

                // Remove 'CultureText' column if current culture is default
                gridStrings.GridColumns.Columns.RemoveAt(1);
            }
            else
            {
                if (!LocalizationHelper.ResourceFileExistsForCulture(mCultureInfo.CultureCode))
                {
                    string url = "http://devnet.kentico.com/download/localization-packs";
                    string downloadPage = String.Format(@"<a href=""{0}"" target=""_blank"" >{1}</a> ", url, HTMLHelper.HTMLEncode(url));
                    ShowInformation(String.Format(GetString("culture.downloadlocalization"), downloadPage));
                }
            }

            InitializeMasterPage();
        }
        else
        {
            gridStrings.StopProcessing = true;
            ShowError(String.Format(GetString("culture.doesntexist"), HTMLHelper.HTMLEncode(mCultureCode)));
        }
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:49,代码来源:List.aspx.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        // Get culture ID from query string
        uiCultureID = QueryHelper.GetInteger("UIcultureID", 0);

        // Get requested culture
        ui = UICultureInfoProvider.GetSafeUICulture(uiCultureID);
        EditedObject = ui;

        UICultureInfo dui = null;
        if (string.Equals(ui.UICultureCode, CultureHelper.DefaultUICulture, StringComparison.InvariantCultureIgnoreCase))
        {
            dui = ui;
            gridStrings.GridName = "List_defaultculture.xml";
        }
        else
        {
            // Ty to get default UI culture
            try
            {
                dui = UICultureInfoProvider.GetUICultureInfo(CultureHelper.DefaultUICulture);
            }
            catch
            { }
        }

        if (dui != null)
        {
            QueryDataParameters parameters = new QueryDataParameters();
            parameters.Add("@Culture", ui.UICultureID);
            parameters.AddId("@DefaultUICultureID", dui.UICultureID);

            // Setup the grid
            gridStrings.QueryParameters = parameters;
            gridStrings.OnAction += UniGridUICultures_OnAction;
            gridStrings.OnExternalDataBound += UniGridStrings_OnExternalDataBound;

            InitializeMasterPage();
        }
        else
        {
            // Default UI culture does not exist - hide the grid and display error message
            gridStrings.StopProcessing = true;
        }
    }
开发者ID:KuduApps,项目名称:Kentico,代码行数:45,代码来源:List.aspx.cs

示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (filter != null)
        {
            filter.ShowContactSelector = ShowContactNameColumn;
            filter.ShowSiteFilter = ShowSiteNameColumn;
            filter.ShowIPFilter = ShowIPAddressColumn;
        }

        if (PageSize >= 0)
        {
            gridElem.Pager.DefaultPageSize = PageSize;
        }
        gridElem.OrderBy = OrderBy;
        gridElem.WhereCondition = WhereCondition;
        if (SiteID > 0)
        {
            gridElem.WhereCondition = SqlHelper.AddWhereCondition(gridElem.WhereCondition, "ActivitySiteID = " + SiteID);
        }
        gridElem.OnExternalDataBound += gridElem_OnExternalDataBound;

        // Set gridelement empty list info text either to set property or default value
        gridElem.ZeroRowsText = String.IsNullOrEmpty(ZeroRowsText) ? GetString("om.activities.noactivities") : GetString(ZeroRowsText);
        gridElem.FilteredZeroRowsText = String.IsNullOrEmpty(FilteredZeroRowsText) ? GetString("om.activities.noactivities.filtered") : GetString(FilteredZeroRowsText);

        if (ContactID > 0)
        {
            gridElem.ObjectType = "om.activitycontactlist";
            if (IsMergedContact)
            {
                gridElem.ObjectType = "om.activitycontactmergedlist";
            }
            if (IsGlobalContact)
            {
                gridElem.ObjectType = "om.activitycontactgloballist";
            }

            QueryDataParameters parameters = new QueryDataParameters();
            parameters.AddId("@ContactID", ContactID);

            gridElem.QueryParameters = parameters;
        }

        // Check permission modify for current site only. To be able to display other sites user must be global admin = no need to check permission.
        modifyPermission = ActivityHelper.AuthorizedManageActivity(SiteContext.CurrentSiteID, false);

        ScriptHelper.RegisterDialogScript(Page);

        string scriptBlock = string.Format(@"
            function ViewDetails(id) {{ modalDialog('{0}' + id, 'ActivityDetails', '900', '950'); return false; }}",
            ResolveUrl(@"~/CMSModules/ContactManagement/Pages/Tools/Activities/Activity/Activity_Details.aspx"));

        ScriptHelper.RegisterClientScriptBlock(this, GetType(), "Actions", scriptBlock, true);
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:54,代码来源:List.ascx.cs

示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        gridElem.IsLiveSite = IsLiveSite;

        // Get score ID from query string
        scoreId = QueryHelper.GetInteger("ScoreID", 0);

        // Initialize score filter
        FormFieldInfo ffi = new FormFieldInfo();
        ffi.Name = " HAVING SUM(Value)";
        ffi.DataType = FormFieldDataTypeEnum.Integer;
        ucScoreFilter.FieldInfo = ffi;
        ucScoreFilter.DefaultOperator = ">=";
        ucScoreFilter.WhereConditionFormat = "{0} {2} {1}";

        // Get modify permission of current user
        modifyPermission = ContactHelper.AuthorizedModifyContact(SiteId, false);

        // Set where condition
        gridElem.WhereCondition = "(ScoreId = @ScoreID) AND (Expiration IS NULL OR (DATEDIFF(d, getdate(), Expiration) >= 0)) GROUP BY ContactID"
                                  + ucScoreFilter.GetWhereCondition();

        // Add parameters
        QueryDataParameters parameters = new QueryDataParameters();
        parameters.AddDateTime("@CurrentDate", DateTime.Now);
        parameters.AddId("@CurrentSiteID", SiteId);
        parameters.AddId("@ScoreID", scoreId);
        gridElem.QueryParameters = parameters;

        // Register OnExternalDataBound
        gridElem.OnExternalDataBound += gridElem_OnExternalDataBound;
        gridElem.OnBeforeFiltering += gridElem_OnBeforeFiltering;

        // Initialize dropdown lists
        if (!RequestHelper.IsPostBack())
        {
            drpAction.Items.Add(new ListItem(GetString("general." + Action.SelectAction), Convert.ToInt32(Action.SelectAction).ToString()));
            if ((modifyPermission || ContactGroupHelper.AuthorizedModifyContactGroup(SiteId, false)) && ContactGroupHelper.AuthorizedReadContactGroup(SiteId, false))
            {
                drpAction.Items.Add(new ListItem(GetString("om.account." + Action.AddToGroup), Convert.ToInt32(Action.AddToGroup).ToString()));
            }
            if (modifyPermission)
            {
                drpAction.Items.Add(new ListItem(GetString("om.account." + Action.ChangeStatus), Convert.ToInt32(Action.ChangeStatus).ToString()));
            }
            drpWhat.Items.Add(new ListItem(GetString("om.contact." + What.Selected), Convert.ToInt32(What.Selected).ToString()));
            drpWhat.Items.Add(new ListItem(GetString("om.contact." + What.All), Convert.ToInt32(What.All).ToString()));
        }
        else
        {
            if (RequestHelper.CausedPostback(btnOk))
            {
                // Set delayed reload for unigrid if mass action is performed
                gridElem.DelayedReload = true;
            }
        }

        // Register JS scripts
        RegisterScripts();
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:60,代码来源:List.ascx.cs


注:本文中的QueryDataParameters.AddId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。