如何提高码农产量,基于ASP.NET MVC的敏捷开发框架之移动端开发APP

 

技术选型

“查尔斯,这个敏捷开发框架我们要开始做了,给你分点任务,你要做哪块的?”

“俺要做APP开发,现在APP开发的人工资高着呢,动不动10几k的,俺要学好APP,俺要加工资,俺要走上人生的颠峰!”

“OK,那APP这块就让你来负责,我们这一期主要让APP上实现工作流审批,CRM商机录入还有即时通讯。”

“中,厂长,那咱们就开始整吧,要不咱就先从安卓开始,一个一个弄,弄好安卓弄苹果,再搞微信。”

“你疯了吧,你本来做.net,就会点前端,一下子又做安卓又做IOS,开发环境都要部署大半个月吧!我们肯定还是要基于HTML做技术选型还是先定IONIC”

“IONIC是啥?”

“查尔斯,你拜我为师不是光为了看我那些文艺片,你也要多了解一下新技术啊,现在做APP很多都是基于HTML的。IONIC就号称只要会html,css,js就可以开发APP啦!”

“真的假的,HTML好是好,反正网页的东西开发一次就可以在不同的设备上跑,安卓、IOS、微信一次搞定!可是调硬件怎么办呢?”

“这一点他们早就考虑过了,他们给安卓、IOS都做了一个壳,我们开发完html之后就可以把html打包放到这个壳里给用户安装!”

“啊这个好,这个好,我都不学去学安卓、IOS就可以做APP开发了”

“是的,整体的架构草图我画了一下,你拿去看看”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ASP.NET MVC 是一种基于模型-视图-控制器 (MVC) 架构的 Web 应用程序框架。它提供了一种创建 Web 应用程序的模式,可以使开发人员将应用程序的逻辑、布局和用户界面分开。 在 ASP.NET MVC 中,常见的增删改查操作可以使用以下步骤完成: 1. 创建模型类:定义要操作的实体类。 2. 创建控制器类:定义处理请求和响应的代码,包括数据操作和视图渲染。 3. 创建视图:定义呈现数据的 HTML 界面。 4. 实现数据操作:可以使用 Entity Framework 或者其他 ORM 框架来实现数据库的增删改查操作。 下面是一个简单的示例,演示如何在 ASP.NET MVC 中实现增删改查操作: 1. 创建模型类: ``` public class Book { public int BookId { get; set; } public string Title { get; set; } public string Author { get; set; } public decimal Price { get; set; } } ``` 2. 创建控制器类: ``` public class BookController : Controller { // 显示书籍列表 public ActionResult Index() { var books = db.Books.ToList(); return View(books); } // 添加书籍 public ActionResult Add() { return View(); } [HttpPost] public ActionResult Add(Book book) { db.Books.Add(book); db.SaveChanges(); return RedirectToAction("Index"); } // 修改书籍 public ActionResult Edit(int id) { var book = db.Books.Find(id); return View(book); } [HttpPost] public ActionResult Edit(Book book) { db.Entry(book).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } // 删除书籍 public ActionResult Delete(int id) { var book = db.Books.Find(id); db.Books.Remove(book); db.SaveChanges(); return RedirectToAction("Index"); } private ApplicationDbContext db = new ApplicationDbContext(); } ``` 3. 创建视图: ``` @model IEnumerable<Book> <h2>书籍列表</h2> <p> @Html.ActionLink("添加书籍", "Add") </p> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.Title) </th> <th> @Html.DisplayNameFor(model => model.Author) </th> <th> @Html.DisplayNameFor(model => model.Price) </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Title) </td> <td> @Html.DisplayFor(modelItem => item.Author) </td> <td> @Html.DisplayFor(modelItem => item.Price) </td> <td> @Html.ActionLink("编辑", "Edit", new { id=item.BookId }) | @Html.ActionLink("删除", "Delete", new { id=item.BookId }) </td> </tr> } </table> ``` ``` @model Book <h2>添加书籍</h2> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-group"> @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Author, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Author, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Author, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Price, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="添加" class="btn btn-default" /> </div> </div> } <div> @Html.ActionLink("返回列表", "Index") </div> ``` ``` @model Book <h2>编辑书籍</h2> @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-group"> @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Author, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Author, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Author, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.Price, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="保存" class="btn btn-default" /> </div> </div> } <div> @Html.ActionLink("返回列表", "Index") </div> ``` 4. 实现数据操作: 可以使用 Entity Framework 来实现数据库的增删改查操作,具体代码可以参考以下示例: ``` public class ApplicationDbContext : DbContext { public DbSet<Book> Books { get; set; } } ``` 注意,在使用 Entity Framework 之前,还需要进行一些配置,例如在 Web.config 中添加连接字符串。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值