本文整理汇总了C#中WebService.venuesEntities.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# venuesEntities.SaveChanges方法的具体用法?C# venuesEntities.SaveChanges怎么用?C# venuesEntities.SaveChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebService.venuesEntities
的用法示例。
在下文中一共展示了venuesEntities.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addLog
/// <summary>
/// 添加日志
/// </summary>
/// <param name="UserId">用户ID</param>
/// <returns></returns>
public static void addLog(int logTypeId, int logMenuId, string logInfo, string loginUserInfo)
{
using (venuesEntities db = new venuesEntities())
{
int userId = 0;
int usertypeId = 5;
if (loginUserInfo == "" || loginUserInfo == "{}" || loginUserInfo == null)
{
}
else
{
JObject objUser = JObject.Parse(loginUserInfo);
userId = int.Parse(objUser["curUserID"].ToString());
usertypeId = int.Parse(objUser["UserTypeId"].ToString());
}
tbl_sys_log log = new tbl_sys_log();
log.Log_TypeId = logTypeId;
log.Log_UserId = userId;
log.Log_MenuId = logMenuId;
log.Log_Info = logInfo;
log.Log_Timestamp = DateTime.Now;
log.Log_UserTypeId = usertypeId;
db.AddTotbl_sys_log(log);
db.SaveChanges();
}
}
示例2: DeleteLogsByIDs
/// <summary>
/// 根据日志id列表删除日志记录
/// </summary>
/// <param name="curUserID"></param>
/// <param name="logIds"></param>
/// <returns></returns>
public static string DeleteLogsByIDs(int curUserID, String logIds, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
List<string> logslist = new List<string>(logIds.Split(','));
foreach (String clogId in logslist)
{
if (clogId != "")
{
int curlogID = int.Parse(clogId);
tbl_sys_log su = db.tbl_sys_log.First<tbl_sys_log>(a => a.Log_Id.Equals(curlogID));
db.DeleteObject(su);
}
}
if (db.SaveChanges() != 0)
{
returnStr = "成功!";
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_LogsManager, "删除日志成功,logIds=" + logIds, loginUserInfo);
}
else
returnStr = "不成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_LogsManager, "删除日志失败,logIds=" + logIds + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例3: DeleteADs
public static String DeleteADs( string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
//string strSql = string.Format("SELECT tad.ADImage,tad.ADName,tad.ID FROM tbl_ad AS tad");
//ObjectQuery<DbDataRecord> results = db.CreateQuery<DbDataRecord>(strSql);
//foreach (DbDataRecord item in results)
//{
// db.DeleteObject(item);
//};
//if (db.SaveChanges() != 0)
// returnStr = "成功!";
//else
ObjectQuery<tbl_ad> query = db.tbl_ad;
foreach (tbl_ad item in query)
{
db.DeleteObject(item);
}
db.SaveChanges();
returnStr = "成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_HandBookSetManager, "删除广告信息,错误信息:" + e.Message, loginUserInfo);
}
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_HandBookSetManager, "删除广告信息", loginUserInfo);
return returnStr;
}
示例4: DeleteResourceByIDs
public static string DeleteResourceByIDs(String fileIds, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
List<string> filelist = new List<string>(fileIds.Split(','));
foreach (String cId in filelist)
{
if (cId != "")
{
int curID = int.Parse(cId);
tbl_file bus = db.tbl_file.First<tbl_file>(a => a.ID.Equals(curID));
db.DeleteObject(bus);
}
}
if (db.SaveChanges() != 0)
{
returnStr = "成功!";
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "根据资源id删除资源记录成功,fileIds=" + fileIds, loginUserInfo);
}
else
returnStr = "不成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "根据资源id删除资源记录,fileIds=" + fileIds + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例5: 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;
}
示例6: 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;
}
示例7: DeleteMeetingRoomByIDs
public static string DeleteMeetingRoomByIDs(String meetingIds, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
List<string> list = new List<string>(meetingIds.Split(','));
foreach (String cId in list)
{
if (cId != "")
{
int curMeetingID = int.Parse(cId);
tbl_venue_meetingroom bus = db.tbl_venue_meetingroom.First<tbl_venue_meetingroom>(a => a.ID.Equals(curMeetingID));
db.DeleteObject(bus);
}
}
if (db.SaveChanges() != 0)
{
returnStr = "成功!";
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "删除会议室成功,meetingIds=" + meetingIds, loginUserInfo);
}
else
returnStr = "不成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "删除会议室,meetingIds=" + meetingIds + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例8: AddModuleAttribute
public static string AddModuleAttribute(int modlueID, string addInfo, string loginUserInfo)
{
string returnStr = "";
JObject objVenue = JObject.Parse(addInfo);
try
{
using (venuesEntities db = new venuesEntities())
{
tbl_module_attribute tva = new tbl_module_attribute();
tva.ModuleID = modlueID;
tva.MAKey = int.Parse(objVenue["MAKey"].ToString());
tva.MAValue = objVenue["MAValue"].ToString();
db.AddTotbl_module_attribute(tva);
if (db.SaveChanges() != 0)
{
returnStr = KeyManager.RetrunSucceed;
}
else
{
returnStr = KeyManager.RetrunUnSucceed;
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_ModulesManager, "新增模块其他属性,modlueID=" + modlueID + "addInfo=" + addInfo, loginUserInfo);
}
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_ModulesManager, "新增模块其他属性,modlueID=" + modlueID + "addInfo=" + addInfo + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例9: 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;
}
示例10: DeleteThemeByID
public static string DeleteThemeByID(int themeId, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
if (themeId == 1)
{
returnStr = "此项为默认值,不可删除!";
}
else
{
tbl_theme bus = db.tbl_theme.First<tbl_theme>(a => a.ID.Equals(themeId));
db.DeleteObject(bus);
//删除主题关联的促销关联关系
ThemeSalesManager.DeleteThemeSalesByThemeId(themeId, loginUserInfo);
if (db.SaveChanges() != 0)
{
returnStr = "成功!";
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_SalesManager, "根据促销主题id删除促销主题,themeId=" + themeId, loginUserInfo);
}
else
returnStr = "不成功!";
}
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "根据促销主题id删除促销主题,themeId=" + themeId + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例11: AddVenuePages
public static string AddVenuePages(int venueId, string addInfo, string loginUserInfo)
{
string returnStr = "";
JObject objVenue = JObject.Parse(addInfo);
try
{
using (venuesEntities db = new venuesEntities())
{
tbl_venue_pages tva = new tbl_venue_pages();
tva.VenueID = venueId;
tva.PageID = int.Parse(objVenue["PageID"].ToString());
tva.PageTypeID = int.Parse(objVenue["PageTypeID"].ToString());
db.AddTotbl_venue_pages(tva);
if (db.SaveChanges() != 0)
{
returnStr = KeyManager.RetrunSucceed;
}
else
{
returnStr = KeyManager.RetrunUnSucceed;
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "新增场所页面关联关系成功,venueId=" + venueId + ",addInfo=" + addInfo, loginUserInfo);
}
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "新增场所页面关联失败,venueId=" + venueId + ",addInfo=" + addInfo + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例12: DeleteGuestMessageByIDs
public static string DeleteGuestMessageByIDs(String guestMessageIds, string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
List<string> glist = new List<string>(guestMessageIds.Split(','));
foreach (String cId in glist)
{
if (cId != "")
{
int curID = int.Parse(cId);
tbl_guest_message bus = db.tbl_guest_message.First<tbl_guest_message>(a => a.ID.Equals(curID));
db.DeleteObject(bus);
}
}
if (db.SaveChanges() != 0)
{
returnStr = "成功!";
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VisitorManager, "根据游客留言id删除游客留言记录,guestMessageIds=" + guestMessageIds, loginUserInfo);
}
else
returnStr = "不成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VisitorManager, "根据游客留言id删除游客留言记录,guestMessageIds=" + guestMessageIds + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例13: AddVenue
public static string AddVenue(string loginUserInfo)
{
string returnStr = "";
int newVenueID = 0;
JObject objUser = JObject.Parse(loginUserInfo);
try
{
using (venuesEntities db = new venuesEntities())
{
tbl_venue tbv = new tbl_venue();
tbv.VenueTypeID = KeyManager.VenueTypeId_Meeting;
tbv.VenuePayType = "免费";
tbv.VenuePassword = GeneralFuction.MD5Encrypt(KeyManager.Default_Pwd);
tbv.VenueName = "";
tbv.VenueManager = "";
tbv.VenueLng = float.Parse("0");
tbv.VenueLat = float.Parse("0");
tbv.VenueCreateTime = DateTime.Now;
tbv.VenueContact = "";
tbv.VenueAddress = "";
tbv.VenueDescript = "";
tbv.VenueImage = "";
tbv.VenueStar = "";
tbv.Video = "";
tbv.LogoImg = "";
tbv.HomeImg ="";
tbv.Phone = "";
tbv.PostCode = "";
tbv.Fax = "";
tbv.WebSite = "" ;
tbv.Email = "";
db.AddTotbl_venue(tbv);
if (db.SaveChanges() != 0)
{
string strSql = "SELECT MAX(s.ID) as max FROM tbl_venue AS s";
ObjectQuery<DbDataRecord> resultm = db.CreateQuery<DbDataRecord>(strSql);
foreach (var item in resultm)
{
newVenueID = int.Parse(item["max"].ToString());
returnStr = item["max"].ToString();
}
}
else
{
returnStr = KeyManager.RetrunUnSucceed;
}
}
}
catch (Exception e)
{
returnStr = e.Message;
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "新增场所失败,错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例14: DeleteSalesPageByID
public static string DeleteSalesPageByID(int saleId,string loginUserInfo)
{
string returnStr = "";
try
{
using (venuesEntities db = new venuesEntities())
{
tbl_sales bus = db.tbl_sales.First<tbl_sales>(a => a.ID.Equals(saleId));
int pageId = int.Parse(bus.SalesPageID.ToString());
db.DeleteObject(bus);
if (db.SaveChanges() != 0)
{
returnStr = "成功!";
PageManager.DeletePageByID(pageId, loginUserInfo);//同时删除page表中的促销页信息
ThemeSalesManager.DeleteThemeSalesBySaleId(saleId, loginUserInfo);//同时删除主题与该促销页的关联关系
LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_SalesManager, "根据促销id删除促销页面记录,saleId=" + saleId, loginUserInfo);
}
else
returnStr = "不成功!";
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "根据促销id删除促销页面记录,saleId=" + saleId + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}
示例15: AddPageModuleAttribute
public static string AddPageModuleAttribute(string addInfo, string loginUserInfo,int pageID,int templateID)
{
string returnStr = "";
JObject objVenue = JObject.Parse(addInfo);
try
{
using (venuesEntities db = new venuesEntities())
{
DeletePageModuleAttributeByPageModuleIDAndMAKey(int.Parse(objVenue["ModuleID"].ToString()), loginUserInfo, pageID, int.Parse(objVenue["MAKey"].ToString()));
tbl_page_module_attribute tva = new tbl_page_module_attribute();
tva.ModuleID = int.Parse(objVenue["ModuleID"].ToString());
tva.PageID = pageID;
tva.TmplateID = templateID;
tva.MAKey = int.Parse(objVenue["MAKey"].ToString());
tva.MAValue = objVenue["MAValue"].ToString();
db.AddTotbl_page_module_attribute(tva);
if (db.SaveChanges() != 0)
{
returnStr = KeyManager.RetrunSucceed;
}
else
{
returnStr = KeyManager.RetrunUnSucceed;
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_PagesManager, "新增页面模块其他属性, pageID=" + pageID + "addInfo=" + addInfo, loginUserInfo);
}
}
}
catch (Exception e)
{
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_PagesManager, "新增页面模块其他属性, pageID=" + pageID + "addInfo=" + addInfo + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}