摘要: 1.时间相关 1 public static DateTime getNow() 2 { 3 MyFZDataContext dataContext = MyFZDataContext.getDataContext(); 4 DateTime datetime = dataContext.ExecuteQuery("select getdate() as datetime1").Single(); 5 return datetime; 6 7 } 8 //public st... 阅读全文
posted @ 2013-07-14 13:59 xiajing12345 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 1.TextEdit的操作,TextEdit一般设置 Property.Mask 可以控制输入的格式decimal : 一般用 f22.gridlookupEdit,让 数据直接绑定到控件上面,而且有搜索功能 1 #region 费用代码 2 this.gridLookUpEdit_FeeCode.Properties.DataSource = from t in dataContext.T1_SY_FeeCode 3 select new 4 ... 阅读全文
posted @ 2013-07-14 13:47 xiajing12345 阅读(502) 评论(0) 推荐(1) 编辑
摘要: 1.对LInq的封装如下: 1 private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource(); 2 public static MyFZDataContext a = null; 3 static String path = Application.StartupPath; 4 public MyFZDataContext(): base(getConnstring(), mappingSource) 5 ... 阅读全文
posted @ 2013-07-14 12:26 xiajing12345 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 1.把Excel中数据导入到Sqlserver 中,使用Linq 事务的方式的方式 1 string resultFile = ""; 2 3 4 OpenFileDialog openFileDialog1 = new OpenFileDialog(); 5 openFileDialog1.InitialDirectory = "D://"; 6 openFileDialog1.Filter = "All files (*.*)|*.*|EXCEL files (*.xls)|*.xls"; 7 ... 阅读全文
posted @ 2013-07-14 12:19 xiajing12345 阅读(734) 评论(0) 推荐(0) 编辑
摘要: 1、主界面使用MDI布局,使用户可以在同一时间,打开多个界面。同时在右上角放置控制MDIChild 窗口的按键,使得用户可以方便的来打选中、关闭,全部关闭对应的窗口。图如下:主要代码如下: bool OpenOnce(XtraForm frm) { foreach (XtraForm mdifrm in MdiChildren) { if (frm.Text == mdifrm.Text) { mdifrm.Activate(); ... 阅读全文
posted @ 2013-07-14 12:02 xiajing12345 阅读(419) 评论(0) 推荐(0) 编辑