摘要: //删除数组元素 //数组,属性名称,属性值 function removeCodeNumList(arrPerson, objPropery, objValue) { return $.grep(arrPerson, function (cur, i) { return cur[objProper 阅读全文
posted @ 2018-08-06 17:13 Loser0628 阅读(4886) 评论(0) 推荐(1) 编辑
摘要: /// <summary> /// 计算地图中心点 /// </summary> /// <param name="list"></param> /// <returns></returns> private string GetCenterByList(List<BmapPo> list) { v 阅读全文
posted @ 2016-05-26 16:35 Loser0628 阅读(1148) 评论(0) 推荐(0) 编辑
摘要: if (!ModelState.IsValid) { List sb = new List(); //获取所有错误的Key List Keys = ModelState.Keys.ToLi... 阅读全文
posted @ 2015-06-19 16:51 Loser0628 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 当使用EF中context.SaveChanges()的时候会报一串让查看详细信息的错误,这个错误不是真正的报错原因,如果想看真正的原因,要关掉EF的验证,如下:context.Configuration.ValidateOnSaveEnabled = false;后在调用SaveChanges()... 阅读全文
posted @ 2014-05-05 15:45 Loser0628 阅读(209) 评论(0) 推荐(0) 编辑
摘要: USE master;GODECLARE @SQL VARCHAR(MAX);SET @SQL=''SELECT @SQL=@SQL+'; KILL '+RTRIM(SPID)FROM sysprocesses WHERE dbid=DB_ID('MobileDB3.1');EXEC(@SQL);GO ALTER DATABASE [MobileDB3.1] SET MULTI_USER; 阅读全文
posted @ 2014-04-08 11:17 Loser0628 阅读(956) 评论(0) 推荐(0) 编辑
摘要: List转换DataTablepublic static DataTable ToDataTable(this IEnumerable results) { var resultTable = new DataTable(); var properties = typeof(T).GetProperties(); foreach (var info in properties) { var vtype = info.PropertyType; if (vtype == typeof(dou... 阅读全文
posted @ 2013-08-23 14:02 Loser0628 阅读(201) 评论(0) 推荐(0) 编辑
摘要: function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; }方法如上:利用正则调用方式为:getUrlParam('get请求的参数名') 阅读全文
posted @ 2013-07-24 13:29 Loser0628 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 用于asp.net Mvc3中一个页面提交到不同的Actionpublic class MultiButtonAttribute : ActionNameSelectorAttribute {public string Name { get; set; }public MultiButtonAttribute(string name) {this.Name = name;}public override bool IsValidName(ControllerContext controllerContext,string actionName, System.Reflection.Method 阅读全文
posted @ 2012-09-05 13:47 Loser0628 阅读(151) 评论(0) 推荐(0) 编辑
摘要: //得到cookie值的方法[STAThread] public static string RemoteLogin(string strLoginUrl, string strPostData, string cookieName) { CookieContainer cContainer=new CookieContainer(); byte[] data = System.Text.Encoding.ASCII.GetBytes(strPostData); string bResult = "";HttpWebRequest myreq = (HttpWebReque 阅读全文
posted @ 2012-08-27 18:58 Loser0628 阅读(1238) 评论(0) 推荐(0) 编辑
摘要: var list = new List<string> {"A", "C", "B", "D", "A", "B", "E", "D", "B", "C"}; var set = new HashSet<string>(list);foreach (string item in set) { Console.WriteLine(item); } 阅读全文
posted @ 2012-08-16 17:00 Loser0628 阅读(1369) 评论(0) 推荐(0) 编辑