Ejemplo n.º 1
0
        public async Task <IHttpActionResult> AddAsync(Models.SealSystemList.SealSystemListViewModel model)
        {
            if (ModelState.IsValid)
            {
                SealSystem.Models.SealSystemList data = new SealSystem.Models.SealSystemList()
                {
                    Code  = model.Code,
                    Name  = model.Name,
                    Note  = model.Note,
                    Types = model.Types
                };
                await BLL.SealSystemListBLL.AddAsync(data);

                return(Ok(new Models.ResponseData()
                {
                    code = 200, Data = "增加成功"
                }));
            }
            else
            {
                return(Ok(new Models.ResponseData()
                {
                    code = 200, ErrorMessage = "增加失败"
                }));
            }
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> EditAsync(int id, Models.SealSystemList.SealSystemListViewModel model)
        {
            SealSystem.Models.SealSystemList data = new SealSystem.Models.SealSystemList
            {
                Name  = model.Name,
                Note  = model.Note,
                Code  = model.Code,
                Types = model.Types
            };
            await BLL.SealSystemListBLL.EditAsync(id, data);

            return(Ok(new Models.ResponseData()
            {
                code = 200, Data = "修改成功"
            }));
        }