本文整理汇总了C#中Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController.Update方法的典型用法代码示例。如果您正苦于以下问题:C# NBrightBuyController.Update方法的具体用法?C# NBrightBuyController.Update怎么用?C# NBrightBuyController.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController
的用法示例。
在下文中一共展示了NBrightBuyController.Update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateLangaugeRef
public static Boolean ValidateLangaugeRef(int portalId, int categoryId)
{
var updaterequired = false;
foreach (var lang in DnnUtils.GetCultureCodeList(portalId))
{
var objCtrl = new NBrightBuyController();
var parentCatData = GetCategoryData(categoryId, lang);
var grpCatCtrl = new GrpCatController(lang);
var newGuidKey = grpCatCtrl.GetBreadCrumb(categoryId, 0, "-", false);
if (newGuidKey != "") newGuidKey = GetUniqueGuidKey(portalId, categoryId, Utils.UrlFriendly(newGuidKey)).ToLower();
if (parentCatData.DataLangRecord.GUIDKey != newGuidKey)
{
parentCatData.DataLangRecord.SetXmlProperty("genxml/textbox/txtcategoryref", newGuidKey);
parentCatData.DataLangRecord.GUIDKey = newGuidKey;
objCtrl.Update(parentCatData.DataLangRecord);
updaterequired = true;
// need to update all children, so call validate recursive.
foreach (var ch in parentCatData.GetDirectChildren())
{
if (ch.ItemID != categoryId) ValidateLangaugeRef(portalId, ch.ItemID);
}
}
}
return updaterequired;
}
示例2: DoWork
/// <summary>
///
/// </summary>
/// <param name="portalfinfo"></param>
/// <returns></returns>
public override string DoWork()
{
try
{
var objCtrl = new NBrightBuyController();
// the sceduler runs at host level, we therefore need to loop through ALL portals to process data at a portal level.
var portalList = NBrightDNN.DnnUtils.GetAllPortals();
foreach (var portal in portalList)
{
// check if we have NBS in this portal by looking for default settings.
var nbssetting = objCtrl.GetByGuidKey(portal.PortalID, -1, "SETTINGS", "NBrightBuySettings");
if (nbssetting != null)
{
var storeSettings = new StoreSettings(portal.PortalID);
var pluginData = new PluginData(portal.PortalID); // get plugin data to see if this scheduler is active on this portal
var plugin = pluginData.GetPluginByCtrl("dnnsearchindex");
if (plugin != null && plugin.GetXmlPropertyBool("genxml/checkbox/active"))
{
// The NBS scheduler is normally set to run hourly, therefore if we only want a process to run daily we need the logic this function.
// To to this we keep a last run flag on the sceduler settings
var setting = objCtrl.GetByGuidKey(portal.PortalID, -1, "DNNIDXSCHEDULER", "DNNIDXSCHEDULER");
if (setting == null)
{
setting = new NBrightInfo(true);
setting.ItemID = -1;
setting.PortalId = portal.PortalID;
setting.TypeCode = "DNNIDXSCHEDULER";
setting.GUIDKey = "DNNIDXSCHEDULER";
setting.ModuleId = -1;
setting.XMLData = "<genxml></genxml>";
}
var lastrun = setting.GetXmlPropertyRaw("genxml/lastrun");
var lastrundate = DateTime.Now.AddYears(-99);
if (Utils.IsDate(lastrun)) lastrundate = Convert.ToDateTime(lastrun);
var rtnmsg = DoProductIdx(portal, lastrundate, storeSettings.DebugMode);
setting.SetXmlProperty("genxml/lastrun", DateTime.Now.ToString("s"), TypeCode.DateTime);
objCtrl.Update(setting);
if (rtnmsg != "") return rtnmsg;
}
}
}
return " - NBS-DNNIDX scheduler OK ";
}
catch (Exception ex)
{
return " - NBS-DNNIDX scheduler FAIL: " + ex.ToString() + " : ";
}
}
示例3: SavePurchaseData
/// <summary>
/// Save Purchase record
/// </summary>
/// <param name="copyrecord">Copy this data as a new record in the DB with a new id</param>
/// <returns></returns>
public int SavePurchaseData(Boolean copyrecord = false )
{
if (copyrecord)
{
_entryId = -1;
PurchaseInfo.SetXmlProperty("genxml/audit", ""); // remove audit
}
var strXml = "<items>";
foreach (var info in _itemList)
{
// remove injected group header record for the product
if (!info.GetXmlPropertyBool("genxml/groupheader")) strXml += info.XMLData;
}
strXml += "</items>";
PurchaseInfo.RemoveXmlNode("genxml/items");
PurchaseInfo.AddXmlNode(strXml, "items", "genxml");
var modCtrl = new NBrightBuyController();
PurchaseInfo.ItemID = _entryId;
PurchaseInfo.PortalId = PortalId;
PurchaseInfo.ModuleId = -1;
PurchaseInfo.TypeCode = PurchaseTypeCode;
if (UserController.GetCurrentUserInfo().UserID != -1) // This might be updated from out of context (payment provider)
{
if (UserId != UserController.GetCurrentUserInfo().UserID && EditMode == "") UserId = UserController.GetCurrentUserInfo().UserID;
PurchaseInfo.UserId = UserId;
}
_entryId = modCtrl.Update(PurchaseInfo);
NBrightBuyUtils.ProcessEventProvider(EventActions.AfterSavePurchaseData, PurchaseInfo);
return _entryId;
}
示例4: AddNewImage
private void AddNewImage(int itemId,String imageurl, String imagepath)
{
var objCtrl = new NBrightBuyController();
var dataRecord = objCtrl.Get(itemId);
if (dataRecord != null)
{
var strXml = "<genxml><imgs><genxml><hidden><imagepath>" + imagepath + "</imagepath><imageurl>" + imageurl + "</imageurl></hidden></genxml></imgs></genxml>";
if (dataRecord.XMLDoc.SelectSingleNode("genxml/imgs") == null)
{
dataRecord.AddXmlNode(strXml, "genxml/imgs", "genxml");
}
else
{
dataRecord.AddXmlNode(strXml, "genxml/imgs/genxml", "genxml/imgs");
}
objCtrl.Update(dataRecord);
}
}
示例5: DoImport
//.........这里部分代码省略.........
var ImageUrl = nodImg.SelectSingleNode("ImageURL").InnerText;
var ImagePath = nodImg.SelectSingleNode("ImagePath").InnerText;
productData.AddNewImage(ImageUrl, ImagePath);
}
////////////////////////////// DOCS /////////////////////////////////////
////////////////////////////// DOCS /////////////////////////////////////
////////////////////////////// DOCS /////////////////////////////////////
////////////////////////////// DOCS /////////////////////////////////////
// copy all the DOCS from Portals\0\productdocs to Portals\0\NBStore\docs
var nodListDocs = nod.SelectNodes("D/NB_Store_ProductDocInfo");
var lp = 1;
var objCtrlDoc = new NBrightBuyController();
foreach (XmlNode nodDoc in nodListDocs)
{
var DocID = nodDoc.SelectSingleNode("DocID").InnerText;
var ProductID = nodDoc.SelectSingleNode("ProductID").InnerText;
var DocPath = nodDoc.SelectSingleNode("DocPath").InnerText;
var ListOrder = nodDoc.SelectSingleNode("ListOrder").InnerText;
var Hidden = nodDoc.SelectSingleNode("Hidden").InnerText;
var FileName = nodDoc.SelectSingleNode("FileName").InnerText;
var FileExt = nodDoc.SelectSingleNode("FileExt").InnerText;
var Lang = nodDoc.SelectSingleNode("Lang").InnerText;
var DocDesc = nodDoc.SelectSingleNode("DocDesc").InnerText;
productData.AddNewDoc(DocPath, FileName);
productData.DataRecord.SetXmlProperty("genxml/docs/genxml[" + lp.ToString() + "]/hidden/fileext", FileExt);
DocPath = DocPath.Replace("productdocs", @"NBStore\docs");
productData.DataRecord.SetXmlProperty("genxml/docs/genxml[" + lp.ToString() + "]/hidden/filepath", DocPath);
objCtrlDoc.Update(productData.DataRecord);
// if doesen't exisit the xml genxml strucuture inside the DataLangRecor I create it
var strXml = "<genxml><docs><genxml><textbox/></genxml></docs></genxml>";
if (productData.DataLangRecord.XMLDoc.SelectSingleNode("genxml/docs") == null)
{
productData.DataLangRecord.AddXmlNode(strXml, "genxml/docs", "genxml");
}
else
{
productData.DataLangRecord.AddXmlNode(strXml, "genxml/docs/genxml", "genxml/docs");
}
/////////////////////////////////////////////////
productData.DataLangRecord.SetXmlProperty("genxml/docs/genxml[" + lp.ToString() + "]/textbox/txtdocdesc", DocDesc);
productData.DataLangRecord.SetXmlProperty("genxml/docs/genxml[" + lp.ToString() + "]/textbox/txttitle", FileName);
objCtrlDoc.Update(productData.DataLangRecord);
lp += 1;
}
////////////////////////////// CATEGORIES /////////////////////////////////////
////////////////////////////// CATEGORIES /////////////////////////////////////
////////////////////////////// CATEGORIES /////////////////////////////////////
////////////////////////////// CATEGORIES /////////////////////////////////////
var nodListCat = nod.SelectNodes("C/NB_Store_ProductCategoryInfo");
foreach (XmlNode nodCat in nodListCat)
{
var ProductID = nodCat.SelectSingleNode("ProductID").InnerText;
var CategoryID = nodCat.SelectSingleNode("CategoryID").InnerText;
if (ProductID == guidKey)
示例6: SavePurchaseData
/// <summary>
/// Save Purchase record
/// </summary>
/// <param name="copyrecord">Copy this data as a new record in the DB with a new id</param>
/// <returns></returns>
public int SavePurchaseData(Boolean copyrecord = false )
{
if (copyrecord)
{
_entryId = -1;
PurchaseInfo.SetXmlProperty("genxml/audit", ""); // remove audit
}
// langauge
if (Lang == "")
{
Lang = Utils.GetCurrentCulture();
}
ClientLang = Lang;
var strXml = "<items>";
foreach (var info in _itemList)
{
// remove injected group header record for the product
if (!info.GetXmlPropertyBool("genxml/groupheader")) strXml += info.XMLData;
}
strXml += "</items>";
PurchaseInfo.RemoveXmlNode("genxml/items");
PurchaseInfo.AddXmlNode(strXml, "items", "genxml");
var modCtrl = new NBrightBuyController();
PurchaseInfo.ItemID = _entryId;
PurchaseInfo.PortalId = PortalId;
PurchaseInfo.ModuleId = -1;
PurchaseInfo.TypeCode = PurchaseTypeCode;
if (UserController.Instance.GetCurrentUserInfo().UserID != -1) // This might be updated from out of context (payment provider)
{
if (UserId != UserController.Instance.GetCurrentUserInfo().UserID && EditMode == "") UserId = UserController.Instance.GetCurrentUserInfo().UserID;
PurchaseInfo.UserId = UserId;
if (EditMode == "" && !string.IsNullOrEmpty(UserController.Instance.GetCurrentUserInfo().Profile.PreferredLocale))
{
ClientLang = UserController.Instance.GetCurrentUserInfo().Profile.PreferredLocale;
}
}
// save the product refs of the order to an XML node, so we can search for product ref in the BO Order Admin.
var productrefs = "";
foreach (var i in GetCartItemList())
{
productrefs += i.GetXmlProperty("genxml/productxml/genxml/textbox/txtproductref") + ",";
}
PurchaseInfo.SetXmlProperty("genxml/productrefs", productrefs);
if (PurchaseInfo.TypeCode != null) // if we're using this class to build cart in memory for procesisng only, don;t save to DB.
{
_entryId = modCtrl.Update(PurchaseInfo);
NBrightBuyUtils.ProcessEventProvider(EventActions.AfterSavePurchaseData, PurchaseInfo);
}
return _entryId;
}
示例7: Validate
public int Validate()
{
var errorcount = 0;
var objCtrl = new NBrightBuyController();
DataRecord.ValidateXmlFormat();
if (DataLangRecord == null)
{
// we have no datalang record for this language, so get an existing one and save it.
var l = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "GROUPLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
if (l.Count > 0)
{
DataLangRecord = (NBrightInfo)l[0].Clone();
DataLangRecord.ItemID = -1;
DataLangRecord.Lang = _lang;
DataLangRecord.ValidateXmlFormat();
objCtrl.Update(DataLangRecord);
}
}
var defaultname = Name;
if (defaultname == "")
{
// find a valid default name
foreach (var lang in DnnUtils.GetCultureCodeList(PortalSettings.Current.PortalId))
{
var l = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "GROUPLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'");
if (l.Count == 1)
{
var nbi2 = (NBrightInfo) l[0];
if (nbi2.GetXmlProperty("genxml/textbox/groupname") != "")
{
defaultname = nbi2.GetXmlProperty("genxml/textbox/groupname");
Name = defaultname;
Save();
break;
}
}
}
}
// fix langauge records
foreach (var lang in DnnUtils.GetCultureCodeList(PortalSettings.Current.PortalId))
{
var l = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "GROUPLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'");
if (l.Count == 0 && DataLangRecord != null)
{
var nbi = (NBrightInfo)DataLangRecord.Clone();
nbi.ItemID = -1;
nbi.Lang = lang;
objCtrl.Update(nbi);
errorcount += 1;
}
if (l.Count == 1)
{
var nbi2 = (NBrightInfo) l[0];
if (nbi2.GetXmlProperty("genxml/textbox/groupname") == "")
{
// if we have no name, use the default name we found early to update.
nbi2.SetXmlProperty("genxml/textbox/groupname", defaultname);
objCtrl.Update(nbi2);
}
}
if (l.Count > 1)
{
// we have more records than should exists, remove any old ones.
var l2 = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "GROUPLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'", "order by Modifieddate desc");
var lp = 1;
foreach (var i in l2)
{
if (lp >= 2) objCtrl.Delete(i.ItemID);
lp += 1;
}
}
}
// add required field values to make getting group easier.
if (DataRecord.GUIDKey != Ref)
{
DataRecord.GUIDKey = Ref;
objCtrl.Update(DataRecord);
}
return errorcount;
}
示例8: AddNew
private void AddNew()
{
var nbi = new NBrightInfo(true);
nbi.PortalId = PortalSettings.Current.PortalId; ;
nbi.TypeCode = "GROUP";
nbi.ModuleId = -1;
nbi.ItemID = -1;
var objCtrl = new NBrightBuyController();
var itemId = objCtrl.Update(nbi);
foreach (var lang in DnnUtils.GetCultureCodeList(PortalSettings.Current.PortalId))
{
nbi = new NBrightInfo(true);
nbi.PortalId = PortalSettings.Current.PortalId;
nbi.TypeCode = "GROUPLANG";
nbi.ModuleId = -1;
nbi.ItemID = -1;
nbi.Lang = lang;
nbi.ParentItemId = itemId;
objCtrl.Update(nbi);
}
LoadData(itemId);
}
示例9: SetDefaultCategory
public void SetDefaultCategory(int categoryid)
{
var objCtrl = new NBrightBuyController();
DataRecord.SetXmlProperty("genxml/defaultcatid", categoryid.ToString());
objCtrl.Update(DataRecord);
}
示例10: AddClient
public void AddClient(int userid)
{
var strGuid = userid.ToString("") + "x" + Info.ItemID.ToString("");
var objCtrl = new NBrightBuyController();
var nbi = objCtrl.GetByGuidKey(_portalId, -1, "USERPRDXREF", strGuid);
if (nbi == null)
{
nbi = new NBrightInfo();
nbi.ItemID = -1;
nbi.PortalId = _portalId;
nbi.ModuleId = -1;
nbi.TypeCode = "USERPRDXREF";
nbi.XrefItemId = 0;
nbi.ParentItemId = Info.ItemID;
nbi.TextData = null;
nbi.Lang = null;
nbi.UserId = userid;
nbi.GUIDKey = strGuid;
objCtrl.Update(nbi);
}
}
示例11: Validate
public int Validate()
{
var errorcount = 0;
var objCtrl = new NBrightBuyController();
SetGuidKey();
objCtrl.Update(DataRecord);
DataRecord.ValidateXmlFormat();
if (DataLangRecord == null)
{
// we have no datalang record for this language, so get an existing one and save it.
var l = objCtrl.GetList(_portalId, -1, _typeLangCode, " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
if (l.Count > 0)
DataLangRecord = (NBrightInfo) l[0].Clone();
else
DataLangRecord = new NBrightInfo(true);
DataLangRecord.ItemID = -1;
DataLangRecord.ValidateXmlFormat();
DataLangRecord.TypeCode = _typeLangCode;
DataLangRecord.ParentItemId = Info.ItemID;
DataLangRecord.Lang = _lang;
objCtrl.Update(DataLangRecord);
}
//Fix image paths
var lp = 1;
foreach (var i in Imgs)
{
if (!File.Exists(i.GetXmlProperty("genxml/hidden/imagepath"))) // products shared across portals may have different image path.
{
if (!i.GetXmlProperty("genxml/hidden/imageurl").StartsWith(_storeSettings.FolderImages))
{
var iname = Path.GetFileName(i.GetXmlProperty("genxml/hidden/imagepath"));
DataRecord.SetXmlProperty("genxml/imgs/genxml[" + lp + "]/hidden/imageurl", _storeSettings.FolderImages.TrimEnd('/') + "/" + iname);
errorcount += 1;
}
if (!i.GetXmlProperty("genxml/hidden/imagepath").StartsWith(_storeSettings.FolderImagesMapPath))
{
var iname = Path.GetFileName(i.GetXmlProperty("genxml/hidden/imagepath"));
DataRecord.SetXmlProperty("genxml/imgs/genxml[" + lp + "]/hidden/imagepath", _storeSettings.FolderImagesMapPath.TrimEnd('\\') + "\\" + iname);
errorcount += 1;
}
}
lp += 1;
}
//Fix document paths
lp = 1;
foreach (var d in Docs)
{
if (!File.Exists(d.GetXmlProperty("genxml/hidden/filepath"))) // products shared across portals may have different path.
{
if (!d.GetXmlProperty("genxml/hidden/filepath").StartsWith(_storeSettings.FolderDocumentsMapPath))
{
var fname = d.GetXmlProperty("genxml/textbox/txtfilename");
if (d.GetXmlProperty("genxml/hidden/filerelpath") != "")
{
fname = Path.GetFileName("D:" + d.GetXmlProperty("genxml/hidden/filerelpath").Replace("/", "\\"));
}
DataRecord.SetXmlProperty("genxml/docs/genxml/hidden/filepath", _storeSettings.FolderDocumentsMapPath.TrimEnd('\\') + "\\" + fname);
errorcount += 1;
}
}
lp += 1;
}
if (errorcount > 0) objCtrl.Update(DataRecord); // update if we find a error
// fix langauge records
foreach (var lang in DnnUtils.GetCultureCodeList(_portalId))
{
var l = objCtrl.GetList(_portalId, -1, _typeLangCode, " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'");
if (l.Count == 0 && DataLangRecord != null)
{
var nbi = (NBrightInfo)DataLangRecord.Clone();
nbi.ItemID = -1;
nbi.Lang = lang;
objCtrl.Update(nbi);
errorcount += 1;
}
if (l.Count > 1)
{
// we have more records than should exists, remove any old ones.
var l2 = objCtrl.GetList(_portalId, -1, _typeLangCode, " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'", "order by Modifieddate desc");
var lp2 = 1;
foreach (var i in l2)
{
if (lp2 >= 2) objCtrl.Delete(i.ItemID);
errorcount += 1;
lp2 += 1;
}
}
}
// remove duplicate category xrefs.
var catlist = GetCategories();
foreach (var c in catlist)
{
//.........这里部分代码省略.........
示例12: ValidateStore
public static int ValidateStore()
{
// clear all cache to start.
DataCache.ClearCache();
var objCtrl = new NBrightBuyController();
var errcount = 0;
// Validate Products
var prodList = objCtrl.GetList(DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, -1, "PRD");
foreach (var p in prodList)
{
var prodData = ProductUtils.GetProductData(p.ItemID, StoreSettings.Current.EditLanguage);
errcount += prodData.Validate();
}
// Validate Categories
var catList = objCtrl.GetList(DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, -1, "CATEGORY");
foreach (var c in catList)
{
var catData = CategoryUtils.GetCategoryData(c.ItemID, StoreSettings.Current.EditLanguage);
errcount += catData.Validate();
}
// Validate Groups
var grpList = objCtrl.GetList(DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, -1, "GROUP");
foreach (var c in grpList)
{
var grpData = new GroupData(c.ItemID, StoreSettings.Current.EditLanguage);
errcount += grpData.Validate();
}
// reset catid from catref
var l = objCtrl.GetDataList(PortalSettings.Current.PortalId, -1, "SETTINGS", "", Utils.GetCurrentCulture(), " and [XMLdata].value('(genxml/catref)[1]','nvarchar(max)') != ''","");
foreach (var s in l)
{
var info = ModuleSettingsResetCatIdFromRef(s);
objCtrl.Update(info);
}
return errcount;
}
示例13: SaveData
private String SaveData(HttpContext context)
{
try
{
var objCtrl = new NBrightBuyController();
//get uploaded params
var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);
SetContextLangauge(ajaxInfo); // Ajax breaks context with DNN, so reset the context language to match the client.
var itemid = ajaxInfo.GetXmlProperty("genxml/hidden/itemid");
var lang = ajaxInfo.GetXmlProperty("genxml/hidden/editlang");
if (lang == "") lang = ajaxInfo.GetXmlProperty("genxml/hidden/lang");
if (lang == "") lang = _lang;
if (Utils.IsNumeric(itemid))
{
// get DB record
var nbi = objCtrl.Get(Convert.ToInt32(itemid));
if (nbi != null)
{
// get data passed back by ajax
var strIn = HttpUtility.UrlDecode(Utils.RequestParam(context, "inputxml"));
// update record with ajax data
nbi.UpdateAjax(strIn);
nbi.GUIDKey = nbi.GetXmlProperty("genxml/textbox/code");
objCtrl.Update(nbi);
// do langauge record
nbi = objCtrl.GetDataLang(Convert.ToInt32(itemid), lang);
nbi.UpdateAjax(strIn);
objCtrl.Update(nbi);
DataCache.ClearCache(); // clear ALL cache, the usagelimit may need to be reset.
}
}
return "";
}
catch (Exception ex)
{
return ex.ToString();
}
}
示例14: AddNew
private String AddNew(String moduleid,String typeCode)
{
if (!Utils.IsNumeric(moduleid)) moduleid = "-2"; // -2 for razor
var objCtrl = new NBrightBuyController();
var nbi = new NBrightInfo(true);
nbi.PortalId = PortalSettings.Current.PortalId;
nbi.TypeCode = typeCode;
nbi.ModuleId = Convert.ToInt32(moduleid);
nbi.ItemID = -1;
nbi.SetXmlProperty("genxml/textbox/code", Utils.GetUniqueKey().ToUpper());
nbi.GUIDKey = nbi.GetXmlProperty("genxml/textbox/code");
var itemId = objCtrl.Update(nbi);
nbi.ItemID = itemId;
foreach (var lang in DnnUtils.GetCultureCodeList(PortalSettings.Current.PortalId))
{
var nbi2 = new NBrightInfo(true);
nbi2.PortalId = PortalSettings.Current.PortalId;
nbi2.TypeCode = typeCode + "LANG";
nbi2.ModuleId = Convert.ToInt32(moduleid);
nbi2.ItemID = -1;
nbi2.Lang = lang;
nbi2.ParentItemId = itemId;
nbi2.GUIDKey = "";
nbi2.ItemID = objCtrl.Update(nbi2);
}
NBrightBuyUtils.RemoveModCache(nbi.ModuleId);
return nbi.ItemID.ToString("");
}
示例15: RemoveAllXref
public static void RemoveAllXref(string itemId)
{
if (Utils.IsNumeric(itemId))
{
var xrefList = new List<string>();
xrefList.Add("prdimg");
xrefList.Add("prdxref");
xrefList.Add("prddoc");
xrefList.Add("prdopt");
foreach (var xrefName in xrefList)
{
var objCtrl = new NBrightBuyController();
var objPInfo = objCtrl.Get(Convert.ToInt32(itemId));
if (objPInfo != null)
{
var xrefIdList = objPInfo.GetXrefList(xrefName);
foreach (var xrefid in xrefIdList)
{
if (Utils.IsNumeric(xrefid))
{
var objRef = objCtrl.Get(Convert.ToInt32(xrefid));
if (objRef != null)
{
objRef.RemoveXref(xrefName, itemId);
objCtrl.Update(objRef);
}
}
objPInfo.RemoveXref(xrefName, xrefid);
objCtrl.Update(objPInfo);
}
}
}
}
}