随笔分类 - 项目积累
摘要:using MongoDB.Driver;using MongoDB.Bson; static void Main(string[] args) { MongoClient client = new MongoClient("mongodb://cjj:123456@127.0.0.1:27017"
阅读全文
摘要:MVC4设置@Html.BeginForm的ID
阅读全文
摘要:var LayerManage = { CommonMethod: null, OpenWindLayer: function (title, width, height, htmlcontent) { layer.open({ type: 1 , area: [width, height] , t
阅读全文
摘要:一、错误排查步骤 1.排查错误之前请先默念三声:微软老大万岁! 坚定一个信念:微软是不会错的,如果错了,那肯定是我的代码写的有问题。不要产生一些质疑微软产品的念头,而是将目光转向代码,按照清晰的思路去慢慢排查。 2.如果最后全部都排查完了,仍然没有找到错误的原因,那就回头看看,哪些你认为一定不会出错
阅读全文
摘要:public virtual ActionResult AsyncUpload() { //we process it distinct ways based on a browser //find more info here http://stackoverflow.com/questions/
阅读全文
摘要:方法一: //取出第一条 var first = allMenuList.Where(e => e.ParentId == 0).ToList(); //Foreach递归 allMenuList.ForEach(e => e.ChildrenItem = allMenuList.Where(a =
阅读全文
摘要:我在这里定义了一个List泛型的扩展方法 public static List<string> GetExten(this List<string> obj) { return new List<string> { }; } 那么我在使用List泛型的时候就可以点出来这个扩展方法 new List<
阅读全文
摘要:public ActionResult DownLoad() { var download = new Download(); using (DataClasses1DataContext db = new DataClasses1DataContext()) { download = db.Dow
阅读全文
摘要:var gridModel = new DataSourceResult { Data = customers.Select(PrepareCustomerModelForList), Total = customers.TotalCount }; protected virtual Custome
阅读全文
摘要:之前一直被一个Linq问题困扰,数据分组后就会变成IGrouping形式,但是返回的需要的是 IQueryable,现在终于知道怎么转了。 query = from c in query group c by c.Id into cGroup orderby cGroup.Key select cG
阅读全文
摘要:public BankCardType BankCardType { get { return (BankCardType)this.BankTypeId; } set { this.BankTypeId = (int)value; } }
阅读全文
摘要:var categoriesEntities = new List<CategoryEntity>(); var allCategories = GetCategories(); var postCategoryMappings = _postCategoryMapping.Where(m => m
阅读全文
摘要:经常使用的 ctl D + I 即时窗口CSS :不可用 cursor: not-allowed; 删除小数点后多余的0str = str.TrimEnd("0".ToCharArray());str.TrimEnd(","); /*JS验证输入整数**/ <input type="text" cl
阅读全文
摘要://身份证正则中间模糊 Regex.Replace(firstIDCard, @"(\d{4})(\d*)(\d{3})", delegate (Match m) { return m.Groups[1].Value + "".PadLeft(m.Groups[2].Value.Length, '*') + m.Groups[3].Value; }); //手机号正则中间模糊 Regex.R...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Text;using System.Xml; namespace EasyFrame.Common{ public class XmlHelper { #region 增、删、改操作
阅读全文
摘要:using System;using System.Drawing;using System.Drawing.Drawing2D;using System.Drawing.Imaging;using System.IO;using System.Net; namespace EasyFrame.Co
阅读全文
摘要:public class Regexlib { /// <summary> /// 判断字符串是否是a-zA-Z0-9_范围内(4,18位范围内) /// </summary> /// <param name="strIn"></param> /// <returns></returns> publ
阅读全文
摘要:int month = month - DateTime.Now.Month; startTime = DateTime.Today.AddDays(0 - DateTime.Today.Day + 1).AddMonths(month); //当月第一天 endTime = DateTime.To
阅读全文
摘要:$(this).siblings().removeClass('underline').end().addClass('underline'); //金额转换为大写 com.Arabia_to_Chinese = function (Num) { for (i = Num.length - 1; i
阅读全文

浙公网安备 33010602011771号