本文整理汇总了C#中Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController.GetDataLang方法的典型用法代码示例。如果您正苦于以下问题:C# NBrightBuyController.GetDataLang方法的具体用法?C# NBrightBuyController.GetDataLang怎么用?C# NBrightBuyController.GetDataLang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController
的用法示例。
在下文中一共展示了NBrightBuyController.GetDataLang方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadData
private void LoadData(int groupId)
{
Exists = false;
if (groupId == -1) AddNew(); // add new record if -1 is used as id.
var objCtrl = new NBrightBuyController();
Info = objCtrl.Get(groupId, "GROUPLANG", _lang);
if (Info != null)
{
Exists = true;
DataRecord = objCtrl.GetData(groupId);
DataLangRecord = objCtrl.GetDataLang(groupId, _lang);
}
}
示例2: FillEmptyLanguageFields
public void FillEmptyLanguageFields()
{
var objCtrl = new NBrightBuyController();
foreach (var toLang in DnnUtils.GetCultureCodeList(_portalId))
{
if (toLang != _lang)
{
var dlang = objCtrl.GetDataLang(DataRecord.ItemID, toLang) ?? DataLangRecord;
dlang.Lang = toLang;
// product
var nodList = DataLangRecord.XMLDoc.SelectNodes("genxml/textbox/*");
if (nodList != null)
{
foreach (XmlNode nod in nodList)
{
if (nod.InnerText.Trim() != "")
{
if (dlang.GetXmlProperty("genxml/textbox/" + nod.Name) == "")
{
dlang.SetXmlProperty("genxml/textbox/" + nod.Name, nod.InnerText);
}
}
}
}
// editor
if (DataLangRecord.GetXmlProperty("genxml/edt/description") != "")
{
if (dlang.GetXmlProperty("genxml/edt/description") == "")
{
dlang.SetXmlProperty("genxml/edt/description", DataLangRecord.GetXmlPropertyRaw("genxml/edt/description"));
}
}
// models
var nodList1 = DataLangRecord.XMLDoc.SelectNodes("genxml/models/genxml");
if (nodList1 != null)
{
var c = 1;
foreach (XmlNode nod1 in nodList1)
{
nodList = nod1.SelectNodes("textbox/*");
if (nodList != null)
{
foreach (XmlNode nod in nodList)
{
if (nod.InnerText.Trim() != "")
{
if (dlang.GetXmlProperty("genxml/models/genxml[" + c + "]/textbox/" + nod.Name) == "")
{
dlang.SetXmlProperty("genxml/models/genxml[" + c + "]/textbox/" + nod.Name, nod.InnerText);
}
}
}
}
c += 1;
}
}
// options
nodList1 = DataLangRecord.XMLDoc.SelectNodes("genxml/options/genxml");
if (nodList1 != null)
{
var c = 1;
foreach (XmlNode nod1 in nodList1)
{
nodList = nod1.SelectNodes("textbox/*");
if (nodList != null)
{
foreach (XmlNode nod in nodList)
{
if (nod.InnerText.Trim() != "")
{
if (dlang.GetXmlProperty("genxml/options/genxml[" + c + "]/textbox/" + nod.Name) == "")
{
dlang.SetXmlProperty("genxml/options/genxml[" + c + "]/textbox/" + nod.Name, nod.InnerText);
}
}
}
}
c += 1;
}
}
// imgs
nodList1 = DataLangRecord.XMLDoc.SelectNodes("genxml/imgs/genxml");
if (nodList1 != null)
{
var c = 1;
foreach (XmlNode nod1 in nodList1)
{
nodList = nod1.SelectNodes("textbox/*");
if (nodList != null)
{
foreach (XmlNode nod in nodList)
{
if (nod.InnerText.Trim() != "")
{
if (dlang.GetXmlProperty("genxml/imgs/genxml[" + c + "]/textbox/" + nod.Name) == "")
{
//.........这里部分代码省略.........
示例3: LoadData
private void LoadData(int productId, Boolean hydrateLists = true)
{
Exists = false;
var objCtrl = new NBrightBuyController();
if (productId == -1) productId = AddNew(); // add new record if -1 is used as id.
Info = objCtrl.Get(productId, "PRDLANG", _lang);
if (Info != null)
{
_portalId = Info.PortalId;
_storeSettings = new StoreSettings(_portalId);
Exists = true;
if (hydrateLists)
{
//build model list
Models = GetEntityList("models");
Options = GetEntityList("options");
Imgs = GetEntityList("imgs");
Docs = GetEntityList("docs");
OptionValues = new List<NBrightInfo>();
foreach (var o in Options)
{
var l = GetOptionValuesById(o.GetXmlProperty("genxml/hidden/optionid"));
OptionValues.AddRange(l);
}
}
Exists = true;
DataRecord = objCtrl.GetData(productId);
DataLangRecord = objCtrl.GetDataLang(productId, _lang);
if (DataLangRecord == null) // rebuild langauge is we have a missing lang record
{
Validate();
DataLangRecord = objCtrl.GetDataLang(productId, _lang);
}
IsOnSale = CheckIsOnSale();
IsInStock = CheckIsInStock();
}
else
{
Exists = false;
}
}
示例4: LoadData
private void LoadData(int categoryId)
{
Exists = false;
if (categoryId == -1) categoryId = AddNew(); // add new record if -1 is used as id.
var objCtrl = new NBrightBuyController();
if (_lang == "") _lang = Utils.GetCurrentCulture();
Info = objCtrl.Get(categoryId, "CATEGORYLANG", _lang);
if (Info != null)
{
Exists = true;
_portalId = Info.PortalId;
DataRecord = objCtrl.GetData(categoryId);
DataLangRecord = objCtrl.GetDataLang(categoryId, _lang);
if (DataLangRecord == null) // rebuild langauge is we have a missing lang record
{
Validate();
DataLangRecord = objCtrl.GetDataLang(categoryId, _lang);
}
}
}
示例5: 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();
}
}
示例6: Validate
//.........这里部分代码省略.........
{
// we have no datalang record for this language, so get an existing one and save it.
var l = objCtrl.GetList(_portalId, -1, "CATEGORYLANG", " 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);
}
}
// fix image
var imgpath = DataRecord.GetXmlProperty("genxml/hidden/imagepath");
var imgurl = DataRecord.GetXmlProperty("genxml/hidden/imageurl");
var imagefilename = Path.GetFileName(imgpath);
if (!imgpath.StartsWith(StoreSettings.Current.FolderImagesMapPath))
{
DataRecord.SetXmlProperty("genxml/hidden/imagepath", StoreSettings.Current.FolderImagesMapPath.TrimEnd('\\') + "\\" + imagefilename);
errorcount += 1;
}
if (imagefilename == "")
{
DataRecord.SetXmlProperty("genxml/hidden/imagepath", "");
errorcount += 1;
}
if (!imgurl.StartsWith(StoreSettings.Current.FolderImages))
{
DataRecord.SetXmlProperty("genxml/hidden/imageurl", StoreSettings.Current.FolderImages.TrimEnd('/') + "/" + imagefilename);
errorcount += 1;
}
if (imagefilename == "")
{
DataRecord.SetXmlProperty("genxml/hidden/imageurl", "");
errorcount += 1;
}
// check guidkey is correct
if (DataRecord.GUIDKey != CategoryRef)
{
DataRecord.GUIDKey = CategoryRef;
errorcount += 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, "CATEGORYLANG", " 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 shoudl exists, remove any old ones.
var l2 = objCtrl.GetList(_portalId, -1, "CATEGORYLANG", " 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;
}
}
}
// Build langauge refs
if (GroupType == "cat")
{
var updaterequired = CategoryUtils.ValidateLangaugeRef(_portalId,CategoryId);
if (updaterequired)
{
// the catref has been updated, so reload the datarecord
DataLangRecord = objCtrl.GetDataLang(CategoryId, _lang);
}
}
// fix groups with mismatching ddlgrouptype
if (GroupType != "cat")
{
var grp = objCtrl.Get(DataRecord.ParentItemId, "GROUP");
if (grp != null)
{
if (grp.GUIDKey != GroupType)
{
DataRecord.SetXmlProperty("genxml/dropdownlist/ddlgrouptype", grp.GUIDKey);
objCtrl.Update(DataRecord);
errorcount += 1;
}
}
}
return errorcount;
}
示例7: SaveData
private String SaveData(HttpContext context)
{
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)
{
var typecode = nbi.TypeCode;
// 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
var nbi2 = objCtrl.GetDataLang(Convert.ToInt32(itemid), lang);
nbi2.UpdateAjax(strIn);
objCtrl.Update(nbi2);
DataCache.ClearCache(); // clear ALL cache.
// run the promo before delete, so we remove any promo data that may exist.
if (typecode == "CATEGORYPROMO")
{
PromoUtils.CalcGroupPromoItem(nbi);
}
if (typecode == "MULTIBUYPROMO")
{
PromoUtils.CalcMultiBuyPromoItem(nbi);
}
}
}
return "";
}
示例8: FlagProductMultiBuy
private static void FlagProductMultiBuy(int portalid,int productId, string promoname, int promoid,String promoType, DateTime dteF, DateTime dteU)
{
var cultureList = DnnUtils.GetCultureCodeList(portalid);
var objCtrl = new NBrightBuyController();
var prdData = objCtrl.GetData(productId);
var nodList = prdData.XMLDoc.SelectNodes("genxml/models/genxml");
if (nodList != null)
{
var currentpromoid = prdData.GetXmlPropertyInt("genxml/hidden/promoid");
if (currentpromoid == 0 || currentpromoid == promoid)
{
prdData.SetXmlProperty("genxml/hidden/promotype", promoType);
prdData.SetXmlProperty("genxml/hidden/promoname", promoname);
prdData.SetXmlProperty("genxml/hidden/promoid", promoid.ToString());
prdData.SetXmlProperty("genxml/hidden/promocalcdate", DateTime.Now.ToString("O"));
prdData.SetXmlProperty("genxml/hidden/datefrom", dteF.ToString("O"));
prdData.SetXmlProperty("genxml/hidden/dateuntil", dteU.ToString("O"));
objCtrl.Update(prdData);
if (promoType == "PROMOMULTIBUY")
{
foreach (var lang in cultureList)
{
var p = objCtrl.GetDataLang(promoid, lang);
var prdDataLang = objCtrl.GetDataLang(productId, lang);
if (prdDataLang != null)
{
prdDataLang.SetXmlProperty("genxml/hidden/promodesc", p.GetXmlProperty("genxml/textbox/description"));
objCtrl.Update(prdDataLang);
}
}
}
}
}
}
示例9: CalcProductSalePrice
private static void CalcProductSalePrice(int portalid, int productId, string amounttype, double amount, string promoname, int promoid, bool overwrite,DateTime dteF, DateTime dteU)
{
var cultureList = DnnUtils.GetCultureCodeList(portalid);
var objCtrl = new NBrightBuyController();
var prdData = objCtrl.GetData(productId);
var nodList = prdData.XMLDoc.SelectNodes("genxml/models/genxml");
if (nodList != null)
{
var currentpromoid = prdData.GetXmlPropertyInt("genxml/hidden/promoid");
if (currentpromoid == 0 || currentpromoid == promoid || overwrite)
{
prdData.SetXmlProperty("genxml/hidden/promotype", "PROMOGROUP");
prdData.SetXmlPropertyDouble("genxml/hidden/promoname", promoname);
prdData.SetXmlProperty("genxml/hidden/promoid", promoid.ToString());
prdData.SetXmlProperty("genxml/hidden/promocalcdate", DateTime.Now.ToString("O"));
prdData.SetXmlProperty("genxml/hidden/datefrom", dteF.ToString("O"));
prdData.SetXmlProperty("genxml/hidden/dateuntil", dteU.ToString("O"));
var lp = 1;
foreach (XmlNode nod in nodList)
{
var nbi = new NBrightInfo();
nbi.XMLData = nod.OuterXml;
var unitcost = nbi.GetXmlPropertyDouble("genxml/textbox/txtunitcost");
Double newamt = 0;
if (amounttype == "1")
{
newamt = unitcost - amount;
}
else
{
newamt = unitcost - ((unitcost/100)*amount);
}
if (newamt < 0) newamt = 0;
var currentprice = prdData.GetXmlPropertyDouble("genxml/models/genxml[" + lp + "]/textbox/txtsaleprice");
if (!overwrite)
{
if (currentprice == 0) overwrite = true;
if (currentpromoid == promoid) overwrite = true;
}
if (overwrite)
{
prdData.SetXmlPropertyDouble("genxml/models/genxml[" + lp + "]/textbox/txtsaleprice", newamt);
}
lp += 1;
}
objCtrl.Update(prdData);
foreach (var lang in cultureList)
{
var p = objCtrl.GetDataLang(promoid, lang);
var prdDataLang = objCtrl.GetDataLang(productId, lang);
if (prdDataLang != null)
{
prdDataLang.SetXmlProperty("genxml/hidden/promodesc", p.GetXmlProperty("genxml/textbox/description"));
objCtrl.Update(prdDataLang);
}
}
}
}
}
示例10: RemoveProductPromoData
public static void RemoveProductPromoData(int portalid, int productId, int promoid)
{
var cultureList = DnnUtils.GetCultureCodeList(portalid);
var objCtrl = new NBrightBuyController();
var prdData = objCtrl.GetData(productId);
var currentpromoid = prdData.GetXmlPropertyInt("genxml/hidden/promoid");
if (currentpromoid == promoid)
{
prdData.RemoveXmlNode("genxml/hidden/promotype");
prdData.RemoveXmlNode("genxml/hidden/promoname");
prdData.RemoveXmlNode("genxml/hidden/promoid");
prdData.RemoveXmlNode("genxml/hidden/promocalcdate");
prdData.RemoveXmlNode("genxml/hidden/datefrom");
prdData.RemoveXmlNode("genxml/hidden/dateuntil");
// remove any sale price amounts that may have been added by group promotion.
var l = prdData.XMLDoc.SelectNodes("genxml/models/genxml");
if (l != null)
{
var lp = 1;
foreach (XmlNode nod in l)
{
prdData.SetXmlProperty("genxml/models/genxml[" + lp + "]/textbox/txtsaleprice", "0");
lp += 1;
}
}
objCtrl.Update(prdData);
foreach (var lang in cultureList)
{
var prdDataLang = objCtrl.GetDataLang(productId, lang);
if (prdDataLang != null)
{
prdDataLang.RemoveXmlNode("genxml/hidden/promodesc");
objCtrl.Update(prdDataLang);
}
}
}
}