本文整理汇总了C#中Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# NBrightBuyController.Delete方法的具体用法?C# NBrightBuyController.Delete怎么用?C# NBrightBuyController.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController
的用法示例。
在下文中一共展示了NBrightBuyController.Delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteUserData
public void DeleteUserData()
{
//remove DB record
var modCtrl = new NBrightBuyController();
modCtrl.Delete(Info.ItemID);
Exists = false;
}
示例2: DeleteCart
public void DeleteCart()
{
//remove DB record
var modCtrl = new NBrightBuyController();
modCtrl.Delete(_entryId);
}
示例3: 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;
}
示例4: Delete
public void Delete()
{
// remove any cache
ProductUtils.RemoveProductDataCache(DataRecord.ItemID, _lang);
//delete and allow DB to cascade delete
var objCtrl = new NBrightBuyController();
objCtrl.Delete(DataRecord.ItemID);
}
示例5: 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, "PRDLANG", " 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 = "PRDLANG";
DataLangRecord.ParentItemId = Info.ItemID;
DataLangRecord.Lang = _lang;
objCtrl.Update(DataLangRecord);
}
//Fix image paths
var lp = 1;
foreach (var i in Imgs)
{
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 (!d.GetXmlProperty("genxml/hidden/filepath").StartsWith(_storeSettings.FolderDocumentsMapPath))
{
DataRecord.SetXmlProperty("genxml/docs/genxml/hidden/filepath", _storeSettings.FolderDocumentsMapPath.TrimEnd('\\') + "\\" + d.GetXmlProperty("genxml/textbox/txtfilename"));
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, "PRDLANG", " 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, "PRDLANG", " 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);
lp2 += 1;
}
}
}
return errorcount;
}
示例6: 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)
{
//.........这里部分代码省略.........
示例7: DeleteData
private String DeleteData(HttpContext context)
{
try
{
var objCtrl = new NBrightBuyController();
//get uploaded params
var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);
var itemid = ajaxInfo.GetXmlProperty("genxml/hidden/itemid");
if (Utils.IsNumeric(itemid))
{
// delete DB record
objCtrl.Delete(Convert.ToInt32(itemid));
NBrightBuyUtils.RemoveModCache(-2);
}
return "";
}
catch (Exception ex)
{
return ex.ToString();
}
}
示例8: 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;
}
示例9: DeleteData
private String DeleteData(HttpContext context)
{
var objCtrl = new NBrightBuyController();
//get uploaded params
var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);
var itemid = ajaxInfo.GetXmlProperty("genxml/hidden/itemid");
if (Utils.IsNumeric(itemid))
{
var nbi = objCtrl.Get(Convert.ToInt32(itemid));
if (nbi != null)
{
var typecode = nbi.TypeCode;
// run the promo before delete, so we remove any promo data that may exist.
if (typecode == "CATEGORYPROMO")
{
PromoUtils.RemoveGroupProductPromo(PortalSettings.Current.PortalId, Convert.ToInt32(itemid));
}
if (typecode == "MULTIBUYPROMO")
{
PromoUtils.RemoveMultiBuyProductPromo(PortalSettings.Current.PortalId, Convert.ToInt32(itemid));
}
}
// delete DB record
objCtrl.Delete(Convert.ToInt32(itemid));
NBrightBuyUtils.RemoveModCache(-2);
}
return "";
}