示例#1
0
 public JsonResult Delete(string table, int id)
 {
     try
     {
         MarketContext MC = new MarketContext();
         MC.CreateConnection();
         if (MC.Connected())
         {
             return(Json(MC.Delete(table, id)));
         }
         else
         {
             throw new Exception("Connection failed");
         }
     }
     catch (Exception ex)
     {
         return(Json("Error: " + ex.Message));
     }
 }
示例#2
0
        public JsonResult Delete(string table, string filter)
        {
            string FullTable = "public." + '"' + table + '"';

            try
            {
                MarketContext MC = new MarketContext();
                MC.CreateConnection();
                if (MC.Connected())
                {
                    return(Json(MC.Delete(FullTable, filter)));
                }
                else
                {
                    throw new Exception("Connection failed");
                }
            }
            catch (Exception ex)
            {
                return(Json("Error: " + ex.Message));
            }
        }