public IActionResult Delete(int Id)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState.GetErrorMessage()));
     }
     else
     {
         IDataResult <DataSource> result = _iDataSourceService.GetById(Id);
         if (result == null)
         {
             return(BadRequest(result.Message));
         }
         else
         {
             IResult deleteResult = _iDataSourceService.Delete(result.Data);
             if (deleteResult.Success)
             {
                 return(Ok(deleteResult.Message));
             }
             else
             {
                 return(BadRequest(deleteResult.Message));
             }
         }
     }
 }
Ejemplo n.º 2
0
        public ContentResult deletedatasource(int id)
        {
            var msg  = string.Empty;
            var flag = _dataSourceService.Delete(id, UserContext.SysUserContext.Id, out msg);

            return(Result <string>(flag, msg));
        }
Ejemplo n.º 3
0
 protected void DeleteDataItem(object sender, EventArgs e)
 {
     try
     {
         _dataItemService.Delete(_dataItem, VisitHelper.GetVisit());
         ResponseRedirect("../Secure/ConfigDs.aspx");
     }
     catch (Exception ex)
     {
         LOG.Error(ex.Message, ex);
         divPageError.Visible   = true;
         divPageError.InnerText = UIUtility.ParseException(ex);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Delete action for removing an object in the JSON list
 /// </summary>
 /// <param name="org">The Organization code for the service owner</param>
 /// <param name="service">The service code for the current service</param>
 /// <param name="id">Id to the JSON object</param>
 /// <returns>View model back to index</returns>
 public IActionResult Delete(string org, string service, string id)
 {
     _dataSourceService.Delete(org, service, id);
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 5
0
 public IActionResult Delete(int id)
 {
     return(_dataSourceService.Delete(id).ToJsonResultModel());
 }