上一页 1 ··· 9 10 11 12 13 14 15 下一页
摘要: 可多选框数据存放Controller 1 public ActionResult SendInfo(SendInfo model, FormCollection fc, int[] GetSendInfo, int[] SetSendInfo) 2 { 3 int getsendinfoID = 0; 4 int setsendinfoID = 0; 5 foreach (int gsi in GetSendInfo) 6 { 7 switch (gs... 阅读全文
posted @ 2013-05-25 10:45 凡酷软件 阅读(799) 评论(1) 推荐(2)
摘要: 1.新建一个ASP.NETMVC4.0项目2.安装EntityFrameworkPowerTools3.EntityFramework--RepositoryReverseEngineerCodeFirst4.Install-PackageEntityFrameworkorUpdate-PackageEntityFrameworkPM-RepositoryInstall-PackageEntityFramework已安装“EntityFramework5.0.0”。BHSoft已具有对“EntityFramework5.0.0”的引用。5.Install-PackageMvcScaffoldi 阅读全文
posted @ 2013-04-16 09:57 凡酷软件 阅读(745) 评论(0) 推荐(0)
摘要: public ActionResult FileUpload() { string filetype = "UpFile"; var file = this.Request.Files[0]; string savedFileName = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UpFiles"); savedFileName = System.IO.Path.Combine(savedFil... 阅读全文
posted @ 2013-02-01 17:10 凡酷软件 阅读(706) 评论(0) 推荐(0)
摘要: protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); //RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes); ///这里是定义定时处理程序,时间1秒钟,可以讲1000改大一些 int time = ((1000... 阅读全文
posted @ 2013-01-28 09:06 凡酷软件 阅读(369) 评论(0) 推荐(0)
摘要: 效果图 #region 获取IP地址 /// /// 获取IP地址 /// /// public static string GetIpAddress() { //获取IP地址 string IpString = StringHelper.GetHtmlContentByUrl("http://iframe.ip138.com/ic.asp", "gb2312"); string regcityString = @"\[(.*)\]"; string IpAddress = StringHelper.Reg(regcityString 阅读全文
posted @ 2012-12-05 11:57 凡酷软件 阅读(345) 评论(2) 推荐(0)
摘要: 效果图UserRoleViewModel.cs1publicclassUserRoleViewModel2{3RoleRepositoryrolerepository=newRoleRepository();4//BMK角色列表5publicIQueryablerolelist{get;set;}6publicUserRoleViewModel()7{8rolelist=rolerepository.GetModelList();9}10}UserController.cs//BMK用户添加提交数据[Authorize,AcceptVerbs(HttpVerbs.Post)]publicAct 阅读全文
posted @ 2012-11-20 15:59 凡酷软件 阅读(631) 评论(2) 推荐(0)
摘要: RoleController.cs1publicclassRoleController:Controller2{3//4//GET:/Admin/Role/56RoleRepositoryroleRepository=newRoleRepository();78//BMK角色列表9[Authorize]10publicActionResultIndex(int?page)11{12varsource=roleRepository.GetPageModelList(15,page??1,-1);13returnView(source);14}15//BMK角色查询16[Authorize]17p 阅读全文
posted @ 2012-11-15 10:45 凡酷软件 阅读(671) 评论(0) 推荐(0)
摘要: //BMK用Autnorize()属性来限制只有此人为Admin角色时才能调用此Action[Authorize(Roles="Admin")]publicActionResultEdit(intid){returnView();} //BMK允许两位用户使用[Authorize(Users="mark,tom")]publicActionResultEdit(intid){returnView();}//BMKChildActionOnly用于指示操作方法只应作为子操作进行调用。[ChildActionOnly]publicActionResultEd 阅读全文
posted @ 2012-11-12 14:22 凡酷软件 阅读(452) 评论(0) 推荐(0)
摘要: 效果图Models/Repository----------------------------------------------------------------------------//ProvinceRepository.cs.cs//////获取一个实体/////////publicS_ProvinceGetModel(intid){returncontext.S_Province.FirstOrDefault(d=>d.ProvinceID==id);}//////获取实体列表//////publicIQueryableGetModelList(){returnconte 阅读全文
posted @ 2012-10-29 15:20 凡酷软件 阅读(610) 评论(0) 推荐(0)
摘要: //通过View的RouteData.Values对象取得当前所有路由值,并动态加载路由值中的Controller的名称//Routing//客户端请求->URL Routing ->Route->Route Handler->Http Handlerroutes.IgnoreRoute("{resource}.axd/{*pathInfo}");//定义不需要通过Routing处理的网址//IgnoreRoute辅助方法是ASP.NET MVC(System.Web.Mvc)routes.MapRoute( "Default", 阅读全文
posted @ 2012-10-29 09:00 凡酷软件 阅读(566) 评论(0) 推荐(0)
摘要: LINQ to SQLLINQ to SQL执行标准数据库命令*查询并创建Id&Title匿名类型LINQ to SQL CodeMydataDataContext data = new MydataDataContext(); var query = data.Article.Select(m => new { Id = m.ArticleID, Title = m.ArticleTitle });SqlCodeSELECT [t0].[ArticleID] AS [Id], [t0].[ArticleTitle] AS [Title]FROM [dbo].[Article] 阅读全文
posted @ 2012-05-29 16:14 凡酷软件 阅读(344) 评论(0) 推荐(0)
摘要: LINQ to SQL下载LINQ to SQL Debug Visualizerhttp://www.scottgu.com/blogposts/linqquery/sqlserverQueryVisualizer.zipLINQ to SQL执行标准数据库命令*查询文章类别ID为34的文章标题并排序取4条Take()取元素条数 =>TopLINQ to SQL Code MydataDataContext data = new MydataDataContext(); var query = data.Article.Where(m => m.CategoryID == 34) 阅读全文
posted @ 2012-05-29 16:13 凡酷软件 阅读(343) 评论(0) 推荐(0)
摘要: ASP.NET MVC路由匹配检测组件RouteDebug.dllURL RoutingURL Routing是与Asp.Net3.5 MVC框架独立的一个功能。可以在传统ASP.Net应用中使用优化路由设置路由 routes.MapRoute( "products-route", // 路由名称 "products/{category}", // 带有参数的 URL new { controller = "products", action = "category",}// 参数默认值 );ProductsCon 阅读全文
posted @ 2012-05-29 16:12 凡酷软件 阅读(422) 评论(0) 推荐(0)
摘要: ViewData,TempData,ModelRequest.From读取表单数据FormCollection读取表单ViewData<%=Html.Encode(ViewData["Test1"])%>TestController.cs // // GET: /Admin/Test/ [Authorize] public ActionResult Index() { this.ViewData["Test1"] = "TestViewData"; return View(); }TempData可以在多个动作方法中或者多 阅读全文
posted @ 2012-05-29 16:12 凡酷软件 阅读(205) 评论(0) 推荐(0)
摘要: htmlhelper的优势就是有智能感知功能,不用helper后面的也好去掉HtmlHelperSelectExtensions静态类DropDownList,ListBox 两个控件DropDownListDropDownList控件只能选择一个项选着产品目录://// GET: /Admin/Test/[Authorize]public ActionResult Index(){CategoryRepository categoryrepository = new CategoryRepository();var categorylist = categoryrepository.GetM 阅读全文
posted @ 2012-05-24 08:15 凡酷软件 阅读(329) 评论(0) 推荐(0)
摘要: HtmlHelperFormExtensions静态类BeginForm,BeginRouteForm,EndForm 三种类型FormMethod.Post优先级最高可以在多个地方设置action参数,htmlAttributes优先级别最高BeginRouteForm扩展方法,提供开发者使用;设置路由值字典类型的id值和class值EndForm代码 表单内容 13重载方法 BeginRouteForm扩展方法,提供开发者使用 InputExtensions类CheckBox,Hidden,Password,RadioButton,TextBox五种类型CheckBox代码:设... 阅读全文
posted @ 2012-05-23 08:12 凡酷软件 阅读(553) 评论(0) 推荐(0)
摘要: 1.请用SQL语句实现:计算一个1-100之间所有不能被3整除的整数, 和正好大于或等于2000的那个整数.[代码]2. 人员情况表(emp)中的字段包括员工号(id)、姓名(name)、年龄(age)、学历(wh),其中学历包括4种情况(本科以上、大专、高中、初中以下),现在要统计出表中学历为本科以上、大专、高中、初中以下,各有多少人,平均年龄、占总人数的百分比。[代码]今天我做作业的两道题不知... 阅读全文
posted @ 2009-11-06 15:28 凡酷软件 阅读(390) 评论(0) 推荐(0)
摘要: Windows 7 Party 回顾历史: (引用:博客园:Windows7专题主页图片)从上图看来前五个系统(红色),都是Win98的成长过程,Win98是一个成熟的产品。再来看看Win98后面的系统,Win2000和WinXp,当然WinXP的用户群多,正如朱兴林(深圳.Net俱乐部主席)说:“微软“绞尽脑汁“,想要WinXp用户死心塌地升级成Win7,还要... 阅读全文
posted @ 2009-10-29 20:03 凡酷软件 阅读(615) 评论(2) 推荐(1)
摘要: 今天来谈谈冒泡,这可不是QQ群冒泡,呵呵!标题改成“魔炮”,比较时尚,是吧!忽悠园友一次。冒泡排序的关键代码[代码]scores是一个存放数据的数组。很难理解,我就给个例子吧!code如下: [代码]code是手写的,未调试的,有错还请园友提出哦! 阅读全文
posted @ 2009-08-07 09:02 凡酷软件 阅读(377) 评论(0) 推荐(1)
摘要: 昨天写了个C#乘法表,今天使用一下Goto,C#也可以用Goto.[代码]这样就不需要使用break,一个一个得跳了。呵呵。 阅读全文
posted @ 2009-08-06 09:33 凡酷软件 阅读(1144) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 下一页