03 2017 档案

摘要:ef开发中会经常使用联表查询,有两种方式: 如果表中建立了外键关系,可以使用include方法,如下: var structure = McDB.DBContext.Com_Structure.Select().Include(m => m.Com_StructureType).Where(m => 阅读全文
posted @ 2017-03-31 13:44 飞刀软件 阅读(915) 评论(0) 推荐(0)
摘要:在orm开发中也会用到存储过程,案例如下: Create proc [dbo].[proc_GetCompanyStructureByDepartStructureId] @Com_StructureId uniqueidentifierASBEGIN declare @structureType 阅读全文
posted @ 2017-03-31 12:18 飞刀软件 阅读(978) 评论(0) 推荐(0)
摘要:项目中做的项目使用的mvc的model验证,感觉最难的一个是remote验证,其它的比较简单就不说了: remote验证例子: /// <summary> /// ErrorMessage 表示验证不通过时显示的消息 ///AdditionalFields 表示验证的时候用哪个字段作为参数来传递(通 阅读全文
posted @ 2017-03-27 10:07 飞刀软件 阅读(230) 评论(0) 推荐(0)
摘要:在做项目遇到想要使用一组name相同的checkbox控件,后台自动获取选中控件的值,只能原生的html标签,不能使用mvc的@html.checkbox控件: 正确代码如下: <input type="checkbox" name="LicenseStatus" checked="checked" 阅读全文
posted @ 2017-03-22 14:07 飞刀软件 阅读(588) 评论(0) 推荐(0)
摘要:ef联表查询是使用EntityFramwork框架的项目都会用到,下面给的一个联表查询示例,几乎可以满足项目中所有的联表查询逻辑: var list = DBContext.Demo.Demo_User.Select(Demo.DataAcess.Demo.Demo_UserType, DataAc 阅读全文
posted @ 2017-03-21 10:37 飞刀软件 阅读(2915) 评论(0) 推荐(0)
摘要:mvc导出excel文件可以使用文件流的方式导出: 后台实现: /// <summary> /// 导出开工条件验收清单 /// </summary> /// <param name="projectId"></param> /// <returns></returns> public Action 阅读全文
posted @ 2017-03-20 15:07 飞刀软件 阅读(607) 评论(0) 推荐(0)
摘要:编程用何种语言不重要,重要的是其设计思想。 阅读全文
posted @ 2017-03-15 16:27 飞刀软件 阅读(172) 评论(0) 推荐(0)