Пример #1
0
 public String cmdDel_Click()
 {
     try
     {
         if (tblView.GetSelectedRowHandles() == null)
         {
             return(Utils.SELECT_ROW_TO_DELETE);
         }
         var row = grid.GetRow(tblView.GetSelectedRowHandles()[0]);
         if (row == null)
         {
             return(Utils.SELECT_ROW_TO_DELETE);
         }
         var    id     = ((System.Data.DataRowView)(row)).Row.ItemArray[0];
         String sql    = String.Format(SQL_DELETE, id);
         int    result = MTSQLServer.getMTSQLServer().wExec(sql, null, false);
         if (result == 1)
         {
             GridForm_Loaded();
             return(Utils.SAVE_DB_OK);
         }
         else
         {
             return(Utils.ERR_UPDATE_DB);
         }
     }
     catch (Exception ex) { return(ex.Message.ToString()); }
 }