本文整理汇总了C#中WebService.venuesEntities.AddTotbl_venue方法的典型用法代码示例。如果您正苦于以下问题:C# venuesEntities.AddTotbl_venue方法的具体用法?C# venuesEntities.AddTotbl_venue怎么用?C# venuesEntities.AddTotbl_venue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebService.venuesEntities
的用法示例。
在下文中一共展示了venuesEntities.AddTotbl_venue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: SaveVenues
public static string SaveVenues(string venueInfo, string loginUserInfo)
{
string returnStr = "";
JObject objVenue = JObject.Parse(venueInfo);
Boolean ishasVenue = false;
JObject objUser = JObject.Parse(loginUserInfo);
try
{
using (venuesEntities db = new venuesEntities())
{
string strSql1 = string.Format("SELECT vv.VenueManager FROM tbl_venue AS vv WHERE vv.VenueManager='{0}'", objVenue["loginName"].ToString());
ObjectQuery<DbDataRecord> results = db.CreateQuery<DbDataRecord>(strSql1);
foreach (var ks in results)
{
ishasVenue = true;
}
if (!ishasVenue)
{
tbl_venue tbv = new tbl_venue();
tbv.VenueTypeID = int.Parse(objVenue["venueTypeID"].ToString());
tbv.VenuePayType = objVenue["payType"].ToString();
tbv.VenuePassword =GeneralFuction.MD5Encrypt(KeyManager.Default_Pwd);
tbv.VenueName = objVenue["venueName"].ToString();
tbv.VenueManager = objVenue["loginName"].ToString();
tbv.VenueLng = float.Parse(objVenue["site_Lng"].ToString());
tbv.VenueLat = float.Parse(objVenue["site_Lat"].ToString());
tbv.VenueCreateTime = DateTime.Now;
tbv.VenueContact = objVenue["contactPeople"].ToString();
tbv.VenueAddress = objVenue["address"].ToString();
tbv.VenueDescript = objVenue["descript"].ToString();
tbv.VenueImage = objVenue["smallImage"].ToString();
tbv.VenueStar = objVenue["star"].ToString();
//tbv.AverageConsumption = objVenue["AverageConsumption"].ToString();
//tbv.District = objVenue["District"].ToString();
//tbv.Country = objVenue["Country"].ToString();
//tbv.MeetRoomCapacity = objVenue["MeetRoomCapacity"].ToString();
tbv.WebSite = objVenue["WebSite"].ToString();
tbv.Email = objVenue["Email"].ToString();
db.AddTotbl_venue(tbv);
string otherStr=objVenue["otherAttribute"].ToString();
if (db.SaveChanges() != 0)
{
string strSql = "SELECT MAX(s.ID) as max FROM tbl_venue AS s";
int newVenueID = 0;
ObjectQuery<DbDataRecord> resultm = db.CreateQuery<DbDataRecord>(strSql);
foreach (var item in resultm)
{
newVenueID = int.Parse(item["max"].ToString());
}
if (otherStr != "[]")
{
returnStr = KeyManager.RetrunSucceed;
string attributeReturnStr = "";
JArray arrOtherVenue = JArray.Parse(objVenue["otherAttribute"].ToString());
foreach (JObject objOtherVenue in arrOtherVenue)
{
attributeReturnStr = VenueAttributeManager.AddVenueAttribute(newVenueID, objOtherVenue.ToString(), loginUserInfo);
if (attributeReturnStr != KeyManager.RetrunSucceed)
{
returnStr = attributeReturnStr;
DeleteVenuesByIDs(loginUserInfo, newVenueID.ToString());//如果新增不成功,则删除刚刚插入数据表的场所信息
VenueAttributeManager.DeleteVenueAttributeByVenueId(newVenueID, loginUserInfo);
break;
}
}
}
//商户:场所管理(场所信息,会议室信息),资源管理,游客管理,页面管理,页面发布(商户发布)
//string sysUserMenus = "" + KeyManager.MENUS.Menu_VenusManager + "," + KeyManager.MENUS.Menu_VisitorManager + "," + KeyManager.MENUS.Menu_ResourceManager + "," + KeyManager.MENUS.Menu_PagesManager + "," + KeyManager.MENUS.Menu_PagesPublishManager;
//AuthorityManager.EditAuthorityByUserId(KeyManager.CUR_USERID, newVenueID, sysUserMenus, KeyManager.UserTypeId_BuissiensUser);
returnStr = KeyManager.RetrunSucceed;
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "新增场所成功,venuesinfo=" + venueInfo, loginUserInfo);
}
else
{
returnStr = KeyManager.RetrunUnSucceed;
}
}
else
{
returnStr = "不成功,已有登录名为“" + objVenue["loginName"].ToString() + "”的场所用户。";
}
}
}
catch (Exception e)
{
returnStr = e.Message;
LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "新增场所成功,venuesinfo=" + venueInfo + ";错误信息:" + e.Message, loginUserInfo);
}
return returnStr;
}