public void Insert2(Dictionary <string, object> dicList, string html, int menuID, string imgUri, string filename, string filePath) { if (NeedInsertDB) { string sql1 = string.Format("select * from dbo.SchoolStyle where dbo.SchoolStyle.Description ='{0}'", dicList["Title"]); string error1 = ""; List <cm> cmList = DBManage.ExcuteEntity <cm>(sql1, System.Data.CommandType.Text, out error1); if (cmList.Count < 1) { int modeType = 0; if (dicList.ContainsKey("_x6a21__x7248_")) { if (dicList["_x6a21__x7248_"] != null) { modeType = 1; } } Microsoft.SharePoint.Client.FieldUserValue vvv = dicList["Author"] as Microsoft.SharePoint.Client.FieldUserValue; string creator = vvv.LookupValue; html = html.Replace("'", "''"); string sql = string.Format("insert into SchoolStyle(MenuId,Title,[Description],CreateTime,ImageUrl,ClickNum,ModelType,IsDelete,Creator,FileName,FilePath) values({0},'{1}','{2}','{3}','{4}',{5},{6},{7},'{8}','{9}','{10}')", menuID, dicList["Title"], html, dicList["Created"], imgUri, dicList["Count"], modeType, 0, creator, filename, filePath); string error = ""; DBManage.Transaction(sql, out error); } } }
public void InsertCmb(string _displayName) { string sql = string.Format("insert into [dbo].[PortalTreeData](Name,Display,IsDelete,CreateTime,Creator,PId,BeforeUrl,BeforeAfter,AfterUrl,SortId,EnName,DisplayCount,DisplayType ) values('{0}',0,0,getDate(),'',0,'/YQZJ/SitePages/BeforeItemList.aspx?',2,'/admin/AfterList.aspx?id=',0,'',8,'时间')", _displayName); string error = ""; DBManage.Transaction(sql, out error); }
public void Insert(Dictionary <string, object> dicList, string html, int menuID, string imgUri, string filename, string filePath) { if (NeedInsertDB) { int modeType = 0; if (dicList.ContainsKey("_x6a21__x7248_")) { if (dicList["_x6a21__x7248_"] != null) { modeType = 1; } } Microsoft.SharePoint.Client.FieldUserValue vvv = dicList["Author"] as Microsoft.SharePoint.Client.FieldUserValue; string creator = vvv.LookupValue; html = html.Replace("'", "''"); string sql = string.Format("insert into Advertising(MenuId,[Description], CreativeHTML,CreateTime,ImageUrl,ClickNum,ModelType,IsDelete,Creator,FileName,FilePath,isPush) values({0},'{1}','{2}','{3}','{4}',{5},{6},{7},'{8}','{9}','{10}',{11})", menuID, dicList["Title"], html, dicList["Created"], imgUri, dicList["Count"], modeType, 0, creator, filename, filePath, 1); string error = ""; DBManage.Transaction(sql, out error); } }