Exemplo n.º 1
0
 public override void ExecuteAction()
 {
     using (FdoFeatureService svc = _conn.CreateFeatureService())
     {
         using (IDelete del = svc.CreateCommand <IDelete>(OSGeo.FDO.Commands.CommandType.CommandType_Delete))
         {
             try
             {
                 del.SetFeatureClassName(_className);
                 if (!string.IsNullOrEmpty(_filter))
                 {
                     del.SetFilter(_filter);
                     Info("Deleting everything from class " + _className + " with filter: " + _filter);
                 }
                 else
                 {
                     Info("Deleting everything from class: " + _className);
                 }
                 int result = del.Execute();
                 Info(result + " features deleted from class: " + _className);
             }
             catch (OSGeo.FDO.Common.Exception ex)
             {
                 Error(ex, "Error occured executing delete");
             }
         }
     }
 }
Exemplo n.º 2
0
        public virtual async Task <IActionResult> OnPostAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var result = await _readAction.Execute(new Identifier(id));

            await _deleteAction.Execute(result);

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Deletes a coordinate system from the database
 /// </summary>
 /// <param name="cs"></param>
 /// <returns></returns>
 public bool DeleteProjection(CoordinateSystemDefinition cs)
 {
     using (var conn = CreateSqliteConnection())
     {
         conn.Open();
         using (IDelete delete = (IDelete)conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Delete))
         {
             delete.SetFeatureClassName("Projections");
             delete.SetFilter("Name = '" + cs.Name + "'");
             if (delete.Execute() == 1)
             {
                 LoggingService.InfoFormatted("Coordinate System {0} deleted from database", cs.Name);
                 _Projections.Remove(cs);
                 return(true);
             }
         }
         conn.Close();
     }
     return(false);
 }
Exemplo n.º 4
0
 public async Task <Domain.Entities.Edital> Delete(int id)
 {
     return(await delete.Execute(id));
 }