コード例 #1
0
 public IActionResult Delete(long id)
 {
     _deleteService.Delete(new ToggleRequest()
     {
         Id = id
     });
     return(new NoContentResult());
 }
コード例 #2
0
 public IActionResult Delete(string application, long toggleId)
 {
     _deleteService.Delete(new AppOverrideRequest()
     {
         ToggleId = toggleId, Application = application
     });
     return(new NoContentResult());
 }
コード例 #3
0
        public ActionResult Delete(int id, IDeleteService service)
        {
            var response = service.Delete<Blog>(id);
            if (response.IsValid)
                TempData["message"] = response.SuccessMessage;
            //else it throws a concurrecy error, which shows the default error page.

            return RedirectToAction("Index");
        }
コード例 #4
0
        public ActionResult Delete(int id, IDeleteService service)
        {
            var response = service.Delete<Tag>(id);
            if (response.IsValid)
                TempData["message"] = response.SuccessMessage;
            else
                //else errors, so send back an error message
                TempData["errorMessage"] = new MvcHtmlString(response.ErrorsAsHtml());

            return RedirectToAction("Index");
        }
コード例 #5
0
        public ActionResult DeleteSalesOrder(int salesOrderId, IDeleteService service)
        {
            var response = service.Delete<SalesOrderHeader>(salesOrderId);
            if (response.IsValid)
                return Json(new { SuccessMessage = response.SuccessMessage });

            //else errors, so copy the errors over to the ModelState
            response.CopyErrorsToModelState(ModelState);

            return Json(ModelState.ToDataSourceResult());
        }
コード例 #6
0
        public ActionResult Delete(int id, IDeleteService service)
        {
            var response = service.Delete <Blog>(id);

            if (response.IsValid)
            {
                TempData["message"] = response.SuccessMessage;
            }
            //else it throws a concurrecy error, which shows the default error page.

            return(RedirectToAction("Index"));
        }
コード例 #7
0
        public ActionResult CustomerDelete(int customerId, IDeleteService service)
        {
            var response = service.Delete <Customer>(customerId);

            if (response.IsValid)
            {
                return(Json(new { SuccessMessage = response.SuccessMessage }));
            }

            //else errors, so copy the errors over to the ModelState
            response.CopyErrorsToModelState(ModelState);

            return(Json(ModelState.ToDataSourceResult()));
        }
コード例 #8
0
        public ActionResult Delete(int id, IDeleteService service)
        {
            var response = service.Delete <Post>(id);

            if (response.IsValid)
            {
                TempData["message"] = response.SuccessMessage;
            }
            else
            {
                //else errors, so send back an error message
                TempData["errorMessage"] = new MvcHtmlString(response.ErrorsAsHtml());
            }

            return(RedirectToAction("Index"));
        }
コード例 #9
0
        /// <summary>
        /// 尝试删除下游单据,返回删除结果
        /// </summary>
        /// <param name="tableNumber">下游单据表格编码</param>
        /// <param name="entityIds">下游单据体内码</param>
        /// <returns></returns>
        private IOperationResult DeleteTargetBill(
            string tableNumber, HashSet <long> entityIds)
        {
            IBusinessFlowService bfService   = ServiceHelper.GetService <IBusinessFlowService>();
            TableDefine          tableDefine = bfService.LoadTableDefine(this.Context, tableNumber);

            // 读取下游单据的元数据
            IMetaDataService metaService = ServiceHelper.GetService <IMetaDataService>();
            FormMetadata     meta        = metaService.Load(
                this.Context, tableDefine.FormId) as FormMetadata;

            // 根据下游单据体的内码,读取单据内码
            HashSet <long> billIds = this.LoadTargetBillIds(meta.BusinessInfo, tableDefine.EntityKey, entityIds);

            object[] pkValues = (from p in billIds select(object) p).ToArray();
            // 调用删除服务,删除单据
            IDeleteService   deleteService = ServiceHelper.GetService <IDeleteService>();
            IOperationResult deleteResult  = deleteService.Delete(this.Context, meta.BusinessInfo,
                                                                  pkValues, this.Option);

            return(deleteResult);
        }
コード例 #10
0
ファイル: UserService.cs プロジェクト: agvozdev-dev/otus
        public Task Delete(Guid userId)
        {
            var sql = $"DELETE FROM \"{_tableName}\" WHERE \"Id\" = @userId";

            return(_userDeleteService.Delete(sql, new { userId }));
        }