本文整理汇总了C#中WebService.venuesEntities.AttachTo方法的典型用法代码示例。如果您正苦于以下问题:C# venuesEntities.AttachTo方法的具体用法?C# venuesEntities.AttachTo怎么用?C# venuesEntities.AttachTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebService.venuesEntities
的用法示例。
在下文中一共展示了venuesEntities.AttachTo方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteResourceByVenueID
public static string DeleteResourceByVenueID(int veneuID, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
if (veneuID != 0)
{
ObjectQuery<tbl_file> tva = db.tbl_file.Where("[email protected]", new ObjectParameter("v", veneuID));
ObjectResult<tbl_file> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_file item in results)
{
db.AttachTo("tbl_file", item);
db.DeleteObject(item);
};
if (db.SaveChanges() != 0)
{
returnStr = KeyManager.RetrunSucceed;
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "根据场所id删除资源记录成功,veneuID=" + veneuID, loginUserInfo);
}
else
returnStr = KeyManager.RetrunUnSucceed;
}
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "根据场所id删除资源记录,veneuID=" + veneuID + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例2: DeletePageModuleAttributeByPageAndModuleID
public static String DeletePageModuleAttributeByPageAndModuleID(int mId, string loginUserInfo,int pageID)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
ObjectQuery<tbl_page_module_attribute> tva = db.tbl_page_module_attribute.Where("[email protected] AND [email protected]", new ObjectParameter("v", mId), new ObjectParameter("u", pageID));
ObjectResult<tbl_page_module_attribute> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_page_module_attribute item in results)
{
db.AttachTo("tbl_page_module_attribute", item);
db.DeleteObject(item);
};
if (db.SaveChanges() != 0)
returnStr = KeyManager.RetrunSucceed;
else
returnStr = KeyManager.RetrunUnSucceed;
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_PagesManager, "根据moduleId和pageID删除页面模块其他属性,moduleId=" + mId + ",pageID="+pageID+";错误信息:" + e.Message, loginUserInfo);
}
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_PagesManager, "根据moduleId和pageID删除页面模块其他属性,moduleId=" + mId + ",pageID=" + pageID, loginUserInfo);
return returnStr;
}
示例3: DeletePageContentByPageID
public static string DeletePageContentByPageID(int pageID,string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
ObjectQuery<tbl_page_content> tva = db.tbl_page_content.Where("[email protected]", new ObjectParameter("v", pageID));
ObjectResult<tbl_page_content> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_page_content item in results)
{
db.AttachTo("tbl_page_content", item);
db.DeleteObject(item);
};
if (db.SaveChanges() != 0)
{
returnStr = "成功!";
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_PagesManager, "删除页面内容成功,pageID=" + pageID, loginUserInfo);
}
else
returnStr = "不成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_PagesManager, "删除页面内容,pageID=" + pageID + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例4: DeleteVenueAttributeByVenueId
/// <summary>
/// 删除指定用户
/// </summary>
/// <param name="UserId">用户ID</param>
/// <returns></returns>
public static String DeleteVenueAttributeByVenueId(int venueId, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
//string strSql = string.Format(" SELECT vatt.ID FROM tbl_venue_attribute AS vatt where vatt.VenueID={0}", venueId);
// ObjectQuery<DbDataRecord> kss= db.CreateQuery<DbDataRecord>(strSql);
// foreach (var ks in kss)
// {
// int cVenueAttId = int.Parse(ks["ID"].ToString());
// tbl_venue_attribute su = db.tbl_venue_attribute.First<tbl_venue_attribute>(a => a.ID.Equals(cVenueAttId));
// db.DeleteObject(su);
// }
//if (db.SaveChanges() != 0)
// returnStr = "成功!";
//else
// returnStr = "不成功!";
ObjectQuery<tbl_venue_attribute> tva = db.tbl_venue_attribute.Where("[email protected]", new ObjectParameter("v", venueId));
ObjectResult<tbl_venue_attribute> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_venue_attribute item in results)
{
db.AttachTo("tbl_venue_attribute", item);
db.DeleteObject(item);
};
if (db.SaveChanges() != 0 )
returnStr= "成功!";
else
returnStr = "不成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "根据场所id删除场所的其他属性,venueId=" + venueId + ";错误信息:" + e.Message, loginUserInfo);
}
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "根据场所id删除场所的其他属性,venueId=" + venueId, loginUserInfo);
return returnStr;
}
示例5: DeleteModuleByTemplateID
public static String DeleteModuleByTemplateID(int TemplateID, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
ObjectQuery<tbl_module> tva = db.tbl_module.Where("[email protected]", new ObjectParameter("v", TemplateID));
ObjectResult<tbl_module> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_module item in results)
{
db.AttachTo("tbl_module", item);
db.DeleteObject(item);
//删除模块关联的其他属性信息
DeleteModuleAttributeByModuleID(item.ID, loginUserInfo);
};
if (db.SaveChanges() != 0)
returnStr = KeyManager.RetrunSucceed;
else
returnStr =KeyManager.RetrunUnSucceed;
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_ModulesManager, "根据TemplateID删除模块所属改模板的模块信息,TemplateID=" + TemplateID + ";错误信息:" + e.Message, loginUserInfo);
}
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_ModulesManager, "根据TemplateID删除模块所属改模板的模块信息,TemplateID=" + TemplateID, loginUserInfo);
return returnStr;
}
示例6: SavePage
public static string SavePage(string mInfo, string loginUserInfo,int pageState)
{
string returnStr = "";
JObject objInfo = JObject.Parse(mInfo);
JObject objUser = JObject.Parse(loginUserInfo);
try
{
using (venuesEntities db = new venuesEntities())
{
int templateID = int.Parse(objInfo["TemplateID"].ToString());
int venueID = int.Parse(objInfo["VenueID"].ToString());
//如果该场所已有该免费模板生成的免费首页,则先删除,然后重新生成
if (templateID == KeyManager.HomePage_Default_Template )
{
//string esql = "";
ObjectQuery<tbl_page> tva = db.tbl_page.Where("[email protected] AND [email protected] AND [email protected]", new ObjectParameter("v", templateID), new ObjectParameter("u", venueID), new ObjectParameter("y", objInfo["PageName"].ToString()));
// ObjectQuery<tbl_page> tva = db.CreateQuery<tbl_page>(esql);
ObjectResult<tbl_page> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_page item in results)
{
db.AttachTo("tbl_page", item);
db.DeleteObject(item);
};
if (db.SaveChanges() != 0)
returnStr = "成功!";
else
returnStr = "不成功!";
}
int curNewSeq = GetMaxSequence();
tbl_page tbt = new tbl_page();
tbt.PageDescription = objInfo["PageDescription"].ToString();
tbt.PageCreateTime = DateTime.Now;
tbt.PageModifyTime = DateTime.Now;
tbt.PageName = objInfo["PageName"].ToString();
tbt.PagePublish = KeyManager.PagePublish_Not;
tbt.PageState = pageState;
tbt.TemplateID = int.Parse(objInfo["TemplateID"].ToString());
tbt.VenueID = int.Parse(objInfo["VenueID"].ToString());
//tbt.VenueID = int.Parse(objUser["curUserID"].ToString());
//tbt.UserVenueTypeID = objUser["UserTypeParentId"].ToString();
tbt.PageTypeID =int.Parse(objInfo["PageTypeID"].ToString());
tbt.Sequence = curNewSeq + 1;
string pageContentInfo = objInfo["pageContentInfo"].ToString();
string moduleInfo = objInfo["pageModuleAttributeInfo"].ToString();
db.AddTotbl_page(tbt);
if (db.SaveChanges() != 0)
{
string strSql = "SELECT MAX(s.ID) as max FROM tbl_page AS s";
int newPageID = 0;
ObjectQuery<DbDataRecord> resultm = db.CreateQuery<DbDataRecord>(strSql);
foreach (var item in resultm)
{
newPageID = int.Parse(item["max"].ToString());
}
if (pageContentInfo != "[]")
{
returnStr = KeyManager.RetrunSucceed;
JArray arrPageContent = JArray.Parse(objInfo["pageContentInfo"].ToString());
foreach (JObject objPageContent in arrPageContent)
{
returnStr = PageContentManager.SavePageContent(newPageID, templateID, objPageContent.ToString(), loginUserInfo);
}
}
if (moduleInfo != "[]")
{
returnStr = KeyManager.RetrunSucceed;
JArray arrModules = JArray.Parse(objInfo["pageModuleAttributeInfo"].ToString());
foreach (JObject objModule in arrModules)
{
returnStr = PageModuleAttributeManager.AddPageModuleAttribute(objModule.ToString(), loginUserInfo, newPageID, templateID);
}
}
returnStr = KeyManager.RetrunSucceed;
}
else
{
returnStr = KeyManager.RetrunUnSucceed;
}
}
}
catch (Exception e)
{
returnStr = e.Message;
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_PagesManager, "新增页面,mInfo=" + mInfo + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例7: DeleteVenuePagesByVenueId
/// <summary>
/// 删除场所页面关联关系
/// </summary>
/// <returns></returns>
public static String DeleteVenuePagesByVenueId(int venueId, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
ObjectQuery<tbl_venue_pages> tva = db.tbl_venue_pages.Where("[email protected]", new ObjectParameter("v", venueId));
ObjectResult<tbl_venue_pages> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_venue_pages item in results)
{
db.AttachTo("tbl_venue_pages", item);
db.DeleteObject(item);
};
if (db.SaveChanges() != 0)
returnStr = "成功!";
else
returnStr = "不成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "根据场所id删除场所页面关联关系,venueId=" + venueId + ";错误信息:" + e.Message, loginUserInfo);
}
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "根据场所id删除场所页面关联关系,venueId=" + venueId, loginUserInfo);
return returnStr;
}
示例8: SetSalePagePublish
public static string SetSalePagePublish(int pageID, int publishPublishID)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
if (pageID != 0)
{
ObjectQuery<tbl_sales> tva = db.tbl_sales.Where("[email protected]", new ObjectParameter("v", pageID));
ObjectResult<tbl_sales> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_sales item in results)
{
db.AttachTo("tbl_sales", item);
item.SalesPublishID = publishPublishID;
};
returnStr = KeyManager.RetrunSucceed;
}
else
{
returnStr = KeyManager.RetrunUnSucceed;
}
}
}
catch (Exception e)
{
returnStr = e.Message;
//LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_PagesManager, "设置促销页面发布状态,pageID=" + pageID + "publishPublishID=" + publishPublishID + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例9: DeleteThemeSalesBySaleId
public static String DeleteThemeSalesBySaleId(int saleId, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
ObjectQuery<tbl_theme_salespage> tva = db.tbl_theme_salespage.Where("[email protected]", new ObjectParameter("v", saleId));
ObjectResult<tbl_theme_salespage> results = tva.Execute(MergeOption.NoTracking);
foreach (tbl_theme_salespage item in results)
{
db.AttachTo("tbl_theme_salespage", item);
db.DeleteObject(item);
};
if (db.SaveChanges() != 0)
returnStr = "成功!";
else
returnStr = "成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "根据主题id删除该主题与促销页面的关联关系,saleId=" + saleId + ";错误信息:" + e.Message, loginUserInfo);
}
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_SalesManager, "根据主题id删除该主题与促销页面的关联关系,saleId=" + saleId, loginUserInfo);
return returnStr;
}