In the previous issue we have set up the framework and added the display of the list,
In this issue, we will add additions and deletions to the search button
The overall effect is as follows
HTML section, find the favorite button in HTML by viewing the element, copy the HTML code into the project
<aclass= "Btn btn-small element"Data-original-title= "new"href= "/customer/add"Data-toggle= "tooltip"data-placement= "Top"> <Iclass= "Icon-edit"></I></a>
Public ActionResult Add (customerinfo cus) { if (Request.httpmethod = = "POST" ) {basebll<customerinfo> BLL = New BASEBLL<customerinfo>(); if (BLL. Add (Cus, "") > 0) { //File upload to server return CONTENTJ ("Add Success", "customerlist"); } } return View (); }
New Complete
<Divclass= "Btn-group"> <ahref= "/customer/[email protected]_id"Data-original-title= "Modify"class= "Btn btn-small element"><Iclass= "Icon-edit"></I> </a> <ahref= "/customer/[email protected]_id"Data-original-title= "Delete"class= "Btn btn-small element"><Iclass= "Icon-trash"></I> </a> <ahref= "/jiekuan/[email protected]_id"Data-original-title= "Borrowing entry"class= "Btn btn-small element"><Iclass= "Icon-pencil"></I> </a> <ahref= "/jiekuan/[email protected]_id"Data-original-title= "Borrowing View"class= "Btn btn-small element"><Iclass= "Icon-eye-open"></I> </a> </Div>
PublicActionResult Edit (stringCID) {BASEBLL<CustomerInfo> BLL =NewBasebll<customerinfo>(); CustomerInfo Info=BLL. Getmodel (CID); returnView (info); } [HttpPost] Publicactionresult Edit (customerinfo cus) {BASEBLL<CustomerInfo> BLL =NewBasebll<customerinfo>(); Bll. Update (cus,""); returnCONTENTJ ("Modification succeeded","customerlist"); } PublicActionResult Delete (stringCID) {BASEBLL<CustomerInfo> BLL =NewBasebll<customerinfo>(); if(BLL. Delete (CID) >0) { returnCONTENTJ ("Delete succeeded","/customer/customerlist"); } returnView ("/customer/customerlist"); }
Additions and deletions to complete,
All the code for the Add and revise check is complete.
Next: Add File upload and picture display for K2 frame
If you are interested in this framework Dabigatran discussion 257749427
MVC and Bootstrap-based permissions framework solution two. Add additions and deletions to change the search button