I was thinking about writing this article last time. I didn't expect that some of my work would have fallen, so I had to make up for it after the holiday.
Directory:
ASP. NET MVC5 website development practices-Overview
ASP. NET MVC5 website development practices (I)-project framework
ASP. NET MVC5 website development practices (I)-framework (continued) model, data storage, and business logic
ASP. NET MVC5 website development practices (2)-user part (1) User Registration
ASP. NET MVC5 website development practices (2)-user part (2) User logon and Cancellation
ASP. NET MVC5 website development practices (2)-user section (3) modify materials and passwords
ASP. NET MVC5 website development practices (2) Member region-Article Management Architecture
ASP. NET MVC5 website development practices (2) add an article in The Member Area
ASP. NET MVC5 website development practices (2) Member region-list of all articles
ASP. NET MVC5 website development practices (2) Member region-Modify and delete Articles
ASP. NET MVC5 website development practices (2) Member region-consulting and Management Architecture
ASP. NET MVC5 website development practices (2) Member region-my consulting list and add Consulting
I. Management list
Similar to my list, I directly pasted the code.
First, open the Consultation controller and add the ManageList method.
Add ManageJsonList for the returned json data
JsonResult ManageJsonList( pageIndex = , pageSize = _list = commonModelService.FindPageList( _total, pageIndex, pageSize, , .Empty, , .Empty, , , => ========== Json( { total = _total, rows =
Right-click ManageList and add an attempt
= <Div id => <div> <a href = data-options = onclick => Delete </a> <a href = data-options = onclick => refresh </a> </div> <table id => </table> <script src => </script> <script type =>, title:, checkbox:, title:, title:, align:, title:, align:, formatter: function (value, row, index) {, title:, width :, align: detail = $ (). datagrid (, index ). find (ReplyConsultation + row. modelID + ). datagrid (</script>
ManageList adds the usage class framework of the datagrid detailed view (ReplyConsultation + row. ModelID + ). "Consultation/Reply" is the view we Reply.
In the Consultation controller, add the Reply Method
ActionResult Reply(
Right-click to add view
@ Html. displayNameFor (model => model. name) @ Html. displayFor (model => model. name) @ Html. displayNameFor (model => model. isPublic) @ Html. displayFor (model => model. isPublic) @ Html. displayNameFor (model => model. QQ) @ Html. displayFor (model => model. QQ) @ Html. displayNameFor (model => model. email) @ Html. displayFor (model => model. email) @ Html. displayNameFor (model => model. content) @ Html. displayFor (model => model. content) Administrator: @ Model. replyTime:
Add the receiving method.
= (RouteData.Values.ContainsKey( _modelId = .Parse(RouteData.Values[= (.IsNullOrEmpty(Request.Form[])) ModelState.AddModelError(, = Request.Form[==
The process is:
1. The id parameter (RouteData. Values. ContainsKey (
, Set other parameters (ReplyTime, Status) and save it to the database
ActionResult Delete (_ commonModel =) Json (commonModelService. Delete (_ commonModel) Json (
Open the ManageList view and add or delete js Code.
Rows = $ ("# Consultation_List"). datagrid ("getSelections "(! Rows | rows. length <1 "prompt", "no row selected! "(Rows. length> 0" OK "," Are you sure you want to delete the selected row? "," Post "" @ Url. Action ("Delete", "Consultation") "'close' rows. length = 0" # Consultation_List "). datagrid ('reload'
Iv. Summary
This time the content is repeated. The management list is similar to my consulting list. The deletion and reply operations are similar to the article code. Finally, write it to the background management area next time.
========================================================== =
Code http://pan.baidu.com/s/1bn07Igf