本文整理汇总了C#中Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController.GetListCount方法的典型用法代码示例。如果您正苦于以下问题:C# NBrightBuyController.GetListCount方法的具体用法?C# NBrightBuyController.GetListCount怎么用?C# NBrightBuyController.GetListCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController
的用法示例。
在下文中一共展示了NBrightBuyController.GetListCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveUser
public Boolean RemoveUser()
{
if (_userInfo != null)
{
var objCtrl = new NBrightBuyController();
var strFilter = " and UserId = " + _userInfo.UserID.ToString("") + " ";
var recordcount = objCtrl.GetListCount(PortalId, -1, "ORDER", strFilter);
if (recordcount == 0) // don't remove if we have orders
{
var usrInfo = UserController.GetUserById(PortalSettings.Current.PortalId, _userInfo.UserID);
UserController.RemoveUser(usrInfo);
return true;
}
}
return false;
}
示例2: GetProductListData
private String GetProductListData(Dictionary<String, String> settings,bool paging = true)
{
var strOut = "";
if (!settings.ContainsKey("header")) settings.Add("header", "");
if (!settings.ContainsKey("body")) settings.Add("body", "");
if (!settings.ContainsKey("footer")) settings.Add("footer", "");
if (!settings.ContainsKey("filter")) settings.Add("filter", "");
if (!settings.ContainsKey("orderby")) settings.Add("orderby", "");
if (!settings.ContainsKey("returnlimit")) settings.Add("returnlimit", "0");
if (!settings.ContainsKey("pagenumber")) settings.Add("pagenumber", "0");
if (!settings.ContainsKey("pagesize")) settings.Add("pagesize", "0");
if (!settings.ContainsKey("searchtext")) settings.Add("searchtext", "");
if (!settings.ContainsKey("searchcategory")) settings.Add("searchcategory", "");
if (!settings.ContainsKey("cascade")) settings.Add("cascade", "False");
var header = settings["header"];
var body = settings["body"];
var footer = settings["footer"];
var filter = settings["filter"];
var orderby = settings["orderby"];
var returnLimit = Convert.ToInt32(settings["returnlimit"]);
var pageNumber = Convert.ToInt32(settings["pagenumber"]);
var pageSize = Convert.ToInt32(settings["pagesize"]);
var cascade = Convert.ToBoolean(settings["cascade"]);
var searchText = settings["searchtext"];
var searchCategory = settings["searchcategory"];
if (searchText != "") filter += " and (NB3.[ProductName] like '%" + searchText + "%' or NB3.[ProductRef] like '%" + searchText + "%' or NB3.[Summary] like '%" + searchText + "%' ) ";
if (Utils.IsNumeric(searchCategory))
{
if (orderby == "{bycategoryproduct}") orderby += searchCategory;
var objQual = DataProvider.Instance().ObjectQualifier;
var dbOwner = DataProvider.Instance().DatabaseOwner;
if (!cascade)
filter += " and NB1.[ItemId] in (select parentitemid from " + dbOwner + "[" + objQual + "NBrightBuy] where typecode = 'CATXREF' and XrefItemId = " + searchCategory + ") ";
else
filter += " and NB1.[ItemId] in (select parentitemid from " + dbOwner + "[" + objQual + "NBrightBuy] where (typecode = 'CATXREF' and XrefItemId = " + searchCategory + ") or (typecode = 'CATCASCADE' and XrefItemId = " + searchCategory + ")) ";
}
else
{
if (orderby == "{bycategoryproduct}") orderby = " order by NB3.productname ";
}
var recordCount = 0;
var themeFolder = StoreSettings.Current.ThemeFolder;
if (settings.ContainsKey("themefolder")) themeFolder = settings["themefolder"];
var templCtrl = NBrightBuyUtils.GetTemplateGetter(themeFolder);
if (!settings.ContainsKey("portalid")) settings.Add("portalid", PortalSettings.Current.PortalId.ToString("")); // aways make sure we have portalid in settings
var objCtrl = new NBrightBuyController();
var headerTempl = templCtrl.GetTemplateData(header, _lang, true, true, true, StoreSettings.Current.Settings());
var bodyTempl = templCtrl.GetTemplateData(body, _lang, true, true, true, StoreSettings.Current.Settings());
var footerTempl = templCtrl.GetTemplateData(footer, _lang, true, true, true, StoreSettings.Current.Settings());
// replace any settings tokens (This is used to place the form data into the SQL)
headerTempl = Utils.ReplaceSettingTokens(headerTempl, settings);
headerTempl = Utils.ReplaceUrlTokens(headerTempl);
bodyTempl = Utils.ReplaceSettingTokens(bodyTempl, settings);
bodyTempl = Utils.ReplaceUrlTokens(bodyTempl);
footerTempl = Utils.ReplaceSettingTokens(footerTempl, settings);
footerTempl = Utils.ReplaceUrlTokens(footerTempl);
var obj = new NBrightInfo(true);
strOut = GenXmlFunctions.RenderRepeater(obj, headerTempl);
if (paging) // get record count for paging
{
if (pageNumber == 0) pageNumber = 1;
if (pageSize == 0) pageSize = StoreSettings.Current.GetInt("pagesize");
recordCount = objCtrl.GetListCount(PortalSettings.Current.PortalId, -1, "PRD", filter,"PRDLANG",_lang);
}
var objList = objCtrl.GetDataList(PortalSettings.Current.PortalId, -1, "PRD", "PRDLANG", _lang, filter, orderby, StoreSettings.Current.DebugMode,"",returnLimit,pageNumber,pageSize,recordCount);
strOut += GenXmlFunctions.RenderRepeater(objList, bodyTempl);
strOut += GenXmlFunctions.RenderRepeater(obj, footerTempl);
// add paging if needed
if (paging)
{
var pg = new NBrightCore.controls.PagingCtrl();
strOut += pg.RenderPager(recordCount, pageSize, pageNumber);
}
return strOut;
}
示例3: GetOrderListData
//.........这里部分代码省略.........
var userid = settings["userid"];
var searchText = settings["searchtext"];
var searchdatefrom = settings["dtesearchdatefrom"];
var searchdateto = settings["dtesearchdateto"];
var searchorderstatus = settings["searchorderstatus"];
var filter = "";
if (searchText != "")
{
filter += " and ( (([xmldata].value('(genxml/billaddress/genxml/textbox/firstname)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/billaddress/genxml/textbox/lastname)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/billaddress/genxml/textbox/unit)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/billaddress/genxml/textbox/street)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/billaddress/genxml/textbox/postalcode)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/billaddress/genxml/textbox/email)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/shipaddress/genxml/textbox/firstname)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/shipaddress/genxml/textbox/lastname)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/shipaddress/genxml/textbox/unit)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/shipaddress/genxml/textbox/street)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/shipaddress/genxml/textbox/postalcode)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/shipaddress/genxml/textbox/email)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/productrefs)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai ))";
filter += " or (([xmldata].value('(genxml/ordernumber)[1]', 'nvarchar(max)') like '%" + searchText + "%' collate sql_latin1_general_cp1_ci_ai )) ) ";
}
if (searchdateto != "" && searchdatefrom != "")
{
filter += " and ( ([xmldata].value('(genxml/createddate)[1]', 'datetime') >= convert(datetime,'" + searchdatefrom + "') ) and ([xmldata].value('(genxml/createddate)[1]', 'datetime') <= convert(datetime,'" + searchdateto + "') ) ) ";
}
if (searchdateto == "" && searchdatefrom != "")
{
filter += " and ([xmldata].value('(genxml/createddate)[1]', 'datetime') >= convert(datetime,'" + searchdatefrom + "') ) ";
}
if (searchdateto != "" && searchdatefrom == "")
{
filter += " and ([xmldata].value('(genxml/createddate)[1]', 'datetime') <= convert(datetime,'" + searchdateto + "') ) ";
}
if (searchorderstatus != "")
{
filter += " and ([xmldata].value('(genxml/dropdownlist/orderstatus)[1]', 'nvarchar(max)') = '" + searchorderstatus + "') ";
}
// check for user or manager.
if (!NBrightBuyUtils.CheckRights())
{
if (Utils.IsNumeric(userid) && UserController.Instance.GetCurrentUserInfo().UserID == Convert.ToInt32(userid))
{
filter += " and ( userid = " + userid + ") ";
}
else
{
return "";
}
}
var recordCount = 0;
if (themeFolder == "")
{
themeFolder = StoreSettings.Current.ThemeFolder;
if (settings.ContainsKey("themefolder")) themeFolder = settings["themefolder"];
}
var objCtrl = new NBrightBuyController();
if (paging) // get record count for paging
{
if (pageNumber == 0) pageNumber = 1;
if (pageSize == 0) pageSize = 20;
// get only entity type required
recordCount = objCtrl.GetListCount(PortalSettings.Current.PortalId, -1, "ORDER", filter);
}
var orderby = " order by [XMLData].value('(genxml/createddate)[1]','nvarchar(20)') DESC, ModifiedDate DESC ";
var list = objCtrl.GetList(portalId, -1, "ORDER", filter, orderby, 0, pageNumber, pageSize, recordCount);
var passSettings = settings;
foreach (var s in StoreSettings.Current.Settings()) // copy store setting, otherwise we get a byRef assignement
{
if (passSettings.ContainsKey(s.Key))
passSettings[s.Key] = s.Value;
else
passSettings.Add(s.Key, s.Value);
}
strOut = NBrightBuyUtils.RazorTemplRenderList(razortemplate, 0, "", list, "/DesktopModules/NBright/NBrightBuy", themeFolder, _lang, passSettings);
// add paging if needed
if (paging && (recordCount > pageSize))
{
var pg = new NBrightCore.controls.PagingCtrl();
strOut += pg.RenderPager(recordCount, pageSize, pageNumber);
}
return strOut;
}