摘要: 为了提高效率,不妨写函数来对数据量较大的统计工作,例如: CREATE FUNCTION fun_CountSiteGroupTotal()RETURNS intASBEGIN declare @countNum int select @countNum=Count(*) from Com_Site 阅读全文
posted @ 2017-04-25 17:09 飞刀软件 阅读(149) 评论(0) 推荐(0) 编辑
摘要: CREATE PROCEDURE proc_CountSiteGroupByStructure -- Add the parameters for the stored procedure here @structureType int --传递参数ASBEGIN -- SET NOCOUNT ON 阅读全文
posted @ 2017-04-25 14:53 飞刀软件 阅读(2941) 评论(0) 推荐(0) 编辑
摘要: @Html.Raw() 会把字符串含有的html标签解析出来 例如:@Html.Raw("aaa</br>ccc") 输出结果就输出一行aaa,然后换行输出ccc 阅读全文
posted @ 2017-04-12 10:58 飞刀软件 阅读(1314) 评论(0) 推荐(0) 编辑
摘要: ef开发中会经常使用联表查询,有两种方式: 如果表中建立了外键关系,可以使用include方法,如下: var structure = McDB.DBContext.Com_Structure.Select().Include(m => m.Com_StructureType).Where(m => 阅读全文
posted @ 2017-03-31 13:44 飞刀软件 阅读(877) 评论(0) 推荐(0) 编辑
摘要: 在orm开发中也会用到存储过程,案例如下: Create proc [dbo].[proc_GetCompanyStructureByDepartStructureId] @Com_StructureId uniqueidentifierASBEGIN declare @structureType 阅读全文
posted @ 2017-03-31 12:18 飞刀软件 阅读(948) 评论(0) 推荐(0) 编辑
摘要: 项目中做的项目使用的mvc的model验证,感觉最难的一个是remote验证,其它的比较简单就不说了: remote验证例子: /// <summary> /// ErrorMessage 表示验证不通过时显示的消息 ///AdditionalFields 表示验证的时候用哪个字段作为参数来传递(通 阅读全文
posted @ 2017-03-27 10:07 飞刀软件 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 在做项目遇到想要使用一组name相同的checkbox控件,后台自动获取选中控件的值,只能原生的html标签,不能使用mvc的@html.checkbox控件: 正确代码如下: <input type="checkbox" name="LicenseStatus" checked="checked" 阅读全文
posted @ 2017-03-22 14:07 飞刀软件 阅读(570) 评论(0) 推荐(0) 编辑
摘要: ef联表查询是使用EntityFramwork框架的项目都会用到,下面给的一个联表查询示例,几乎可以满足项目中所有的联表查询逻辑: var list = DBContext.Demo.Demo_User.Select(Demo.DataAcess.Demo.Demo_UserType, DataAc 阅读全文
posted @ 2017-03-21 10:37 飞刀软件 阅读(2848) 评论(0) 推荐(0) 编辑
摘要: mvc导出excel文件可以使用文件流的方式导出: 后台实现: /// <summary> /// 导出开工条件验收清单 /// </summary> /// <param name="projectId"></param> /// <returns></returns> public Action 阅读全文
posted @ 2017-03-20 15:07 飞刀软件 阅读(579) 评论(0) 推荐(0) 编辑
摘要: 编程用何种语言不重要,重要的是其设计思想。 阅读全文
posted @ 2017-03-15 16:27 飞刀软件 阅读(164) 评论(0) 推荐(0) 编辑