Cargo abp (net core) + easyui + efcore implement Warehouse Management System --EasyUI management of seven (XXV)

abp (net core) + easyui + efcore implement warehouse management system directory

abp (net core) + easyui + efcore implement warehouse management system --ABP general introduction (a)

abp (net core) + easyui + efcore implement Warehouse Management System - Solutions Introduction (b)

abp (net core) + easyui + efcore implement warehouse management system - the domain layer created entity (c)

 abp (net core) + easyui + efcore implement warehouse management system - Define and implement storage (IV)

abp (net core) + easyui + efcore implement Warehouse Management System - Create application services (five)

abp (net core) + easyui + efcore implemented warehouse management system - to achieve the presentation layer of the CRUD controller (vi)

abp (net core) + easyui + efcore implement Warehouse Management System - the presentation layer to achieve CRUD the list view (seven)

abp (net core) + easyui + efcore implement Warehouse Management System - the presentation layer to achieve the CRUD CRUD view (eight)

abp (net core) + easyui + efcore implement Warehouse Management System - the presentation layer to achieve CRUD and test the menu (IX)

abp (net core) + easyui + efcore implement Warehouse Management System - Multilingual (X)

abp (net core) + easyui + efcore implemented Warehouse Management System - WEBAPI implemented CURD (XI)

abp (net core) + easyui + efcore implement Warehouse Management System - menu - on (XVI)

abp (net core) + easyui + efcore implement warehouse management system --EasyUI front page frame (XVIII)

Cargo abp (net core) + easyui + efcore implement Warehouse Management System --EasyUI of a management (XIX)

 abp (net core) + easyui + efcore implement warehouse management system --EasyUI of goods Management 2 (XX)

 

      (In a previous cargo abp (net core) + easyui + efcore implement Warehouse Management System --EasyUI management of six (24)) measured article, we fixed some BUG, so that the front and back-office functions cargo information management the basic realization of what we want. Now we are starting to run the application to test modification and deletion functions.

Sixteen, modify and delete information goods

      Continue to implement our cargo information management functions, before we have achieved with the new list of goods information of goods information, features, and now we modify and delete functions to implement cargo information.

        11. Visual Studio 2017's "Solution Explorer", right-click Controller directory domain layer "ABP.TPLMS.Web.Mvc" project. Find CargoController file, add an update method, as follows.

       [HttpPost]
        [DisableValidation]
        public ActionResult Update(CreateUpdateCargoDto updateDto)
        {
            string result = "NO";

            try
            {

                var obj = _cargoAppService.Update(updateDto);

                if (obj != null)

                {
                    result = "OK";
                }
            }
            catch
            {            }

    var json = JsonEasyUIResult(0, result);
            return Content(json);         

        }

       12. Repeat ( ABP (NET Core) + easyui + efcore and cargo management warehouse management system --EasyUI Six (24) ) in step 3,4,5. Then select from the list of goods information in a goods information, and then use the mouse to click on the "Edit" button to modify the information on the goods. As shown below.

 

      13. After the completion of modifications for cargo information, click on the "Save" button, a pop-up "Are you sure you want to modify it?" Dialog box. Click on the dialog box "OK" button. If the modification is successful, there will be a "Save successful" message while updating the list of goods information. If the "save successful" message did not appear. Please refer to ( ABP (NET Core) + easyui + efcore and cargo management warehouse management system --EasyUI Six (24)) point 8 article to modify the first 9:00. As shown below.

 

       14. Visual Studio 2017's "Solution Explorer", right-click Controller directory domain layer "ABP.TPLMS.Web.Mvc" project. Find CargoController file, add a delete method, as follows.

public ActionResult Delete(string ids)
        {
            string result = "NO";

            try
            {
                result = _cargoAppService.Delete(ids);
            }
            catch
            {

            }

            return Content(result);
        }

       15. This method is not delete the default method of ABP. In Visual Studio 2017's "Solution Explorer", right-click "ABP.TPLMS.Application" Project Cargoes folder, locate ICargoAppService interface file, add and delete methods in this file. code show as below.

string Delete(string ids);

      16. Found in the same folder CargoAppService.cs文件. Add Remove method. code show as below.

  public string Delete(string ids)
  {

      string result = "NO";
      var idList = ids.Split(',');
      foreach (var item in idList)
      {
          var id = 0;
          int.TryParse(item,out id);
          var cargoList = base.GetEntityByIdAsync(id);

          var cargo=MapToEntityDto(cargoList.GetAwaiter().GetResult());

          base.Delete(cargo);
          result = "OK";

       }
       return result;
   }

    17. 重复( abp(net core)+easyui+efcore实现仓储管理系统——EasyUI之货物管理六(二十四)) 文章中的第3、4、5步。然后在货物信息列表中选中一条货物信息,然后使用鼠标点击“删除”按钮。会弹出一个“您确认要删除吗?”对话框。点击对话框中的“确定”按钮。如下图。

 

     18.如果删除成功,会有一个“删除成功!”的提示信息,同时更新货物信息列表。如果没有出现“删除成功”的提示信息。请参考( abp(net core)+easyui+efcore实现仓储管理系统——EasyUI之货物管理六(二十四)) 文章中的第8点与第9点进行修改。

 

Guess you like

Origin www.cnblogs.com/chillsrc/p/11804797.html