随笔分类 - C#
摘要:String s = String.Format("select * from Price_ItemDepts where FeeDeptID={0}{1}{2}", $"'{deptID}'", string.IsNullOrEmpty(categoryID) ? "" : $" and 项目编码
阅读全文
摘要:两种身份认证方式 当前用户:HttpContext.User.Identity.Name //原membership判断所属脚色 if (Roles.IsUserInRole("Administrators")) //现identity判断 法一 var manager = HttpContext.
阅读全文
摘要:目的:为Dropdownlist赋值,并获得项目选项值itemID 法一: //项目列表 ViewData["ItemID"] = string.IsNullOrEmpty(itemID) ? "4" : itemID; var Result = from a in db.Fee_Items whe
阅读全文
摘要:子查询 法一:使用linq语句 //获得核算科室编号 IEnumerable<string> s = (from a in db.Fee_Depts where a.院区 == "**院区" select a.核算科室编号).Distinct(); //获得包括核算科室编号名称 var depts
阅读全文
摘要:使用APS.NET MVC编写页面,在Html中为javascript函数传入的参数为动态数据时,要注意将动态参数放在引号中,如下面代码中@item.FeeDeptName。 @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(mode
阅读全文
摘要:1、列改变为select,不能使用gridview.SelectedRow.Cells[0].Text2、事件执行顺序RowCommandPageIndexChangingPageIndexChangedDataBindingRowCreated:Header[8]RowDataBoundRowCr...
阅读全文
摘要:F4: 转到输入窗口F6: 生成解决方案Ctrl+F6: 生成当前项目F7: 查看代码Shift+F7: 查看窗体设计器F5: 启动调试Ctrl+F5: 开始执行(不调试)Shift+F5: 停止调试Ctrl+Shift+F5: 重启调试F9: 切换断点Ctrl+F9: 启用/停止断点Ctrl+Sh...
阅读全文
摘要:需要在Page_Load事件里为gridview绑定数据时,添加回传判断if (!IsPostBack){绑定数据}
阅读全文
摘要:1、选中类文件,在属性中的“生成操作”默认的“内容”改为“编译”就可以了。2、重新生成解决方案
阅读全文