Exemplo n.º 1
0
 public IActionResult Delete(int Id)
 {
     var isLogin = HttpContext.Session.GetString("isUserLogin");
     if (isLogin == "true")
     {
         var delivery = _deliveryService.GetById(Id);
         _deliveryService.Delete(delivery);
         return View("Index", _deliveryService.GetStockList());
     }
     return RedirectToAction("Login", "Home");
     
 }
        public void Delete(DeliveryDTO client)
        {
            IWindowManager manager = new WindowManager();

            // DeleteConfirmationViewModel modify = new DeleteConfirmationViewModel();
            // bool? showDialogResult = manager.ShowDialog(modify, null, null);
            // if (showDialogResult != null && showDialogResult == true)
            // {
            DeliveryService.Delete(client);
            // }
            Reload();
        }
Exemplo n.º 3
0
 public IActionResult DeliveryDelete(uint delivery_id)
 {
     try
     {
         DeliveryService.Delete(l => l.delivery_id == delivery_id);
         DeliveryRuleService.Delete(l => l.delivery_id == delivery_id);
     }
     catch (Exception e)
     {
         LogManager.Error(GetType(), e);
         return(No(e.Message));
     }
     return(Yes("保存成功"));
 }
Exemplo n.º 4
0
        ///// <summary>
        ///// 批量删除
        ///// </summary>
        ///// <param name="context"></param>
        //public void DeleteListDeliveryRequest(HttpContext context)
        //{
        //    // ?
        //}


        ///// <summary>
        ///// 搜索用户
        ///// </summary>
        ///// <param name="context"></param>
        //public void SeachDeliveryRequest(HttpContext context)
        //{
        //    var username = context.Request["name"];
        //    var list = _userInfoService.GetList().Where(y => y.UserName.Contains(username)).ToList();
        //    var res = SerializeHelp.ToTableJson<Delivery>(list);
        //    context.Response.Write(res);
        //}

        /// <summary>
        ///删除用户
        /// </summary>
        /// <param name="context"></param>
        public void DeleteDeliveryRequest(HttpContext context)
        {
            var response = new ResponseMessage();
            try
            {
                var id = context.Request["id"];
                var del = _userInfoService.Delete(id);
                response.code = del == true ? 0 : 500;
                response.msg = "删除成功";
                context.Response.Write(SerializeHelp.ToJson(response));


            }
            catch (Exception e)
            {
                response.code = 500;
                response.msg = "删除失败";
                context.Response.Write(SerializeHelp.ToJson(response));
            }
        }
Exemplo n.º 5
0
 public async Task DeleteNullExecutionContextExpectArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                      await _deliveryService.Delete(null, "id"));
 }
 public ActionResult DeleteDelivery(int Id)
 {
     deliveryService.Delete(Id);
     TempData["message"] = "成功刪除運送方式";
     return(RedirectToRoute(new { Controlller = "Admin", Action = "Delivery" }));
 }
        public async Task <IActionResult> Delete([FromBody] IReadOnlyList <int> ids)
        {
            await _service.Delete(ids);

            return(Ok());
        }
Exemplo n.º 8
0
        public async void Delete_Should_Return_Result_If_Found()
        {
            var result = await _deliveryService.Delete(DefaultDeliveryId);

            Assert.True(result.Success);
        }