コード例 #1
0
        public static bool AddIncident(Incident i, int missieUID)
        {
            using (OracleConnection o = new OracleConnection(connstring))
            {
                using (OracleCommand c = new OracleCommand())
                {
                    try
                    {
                        c.Connection = o;
                        o.Open();
                        c.CommandText = "INSERT INTO TIncident (Beschrijving) VALUES ('" + i.Beschrijving + "')";
                        c.ExecuteNonQuery();

                        c.CommandText = "SELECT MAX(ID) FROM TIncident";
                        OracleDataReader dr = c.ExecuteReader();

                        if (dr.Read())
                        {
                            c.CommandText = "INSERT INTO TMissie_Incident (MissieID, IncidentID) VALUES ('" + missieUID + "', '" + GetInt(dr[0]) + "')";
                            c.ExecuteNonQuery();
                        }
                        return true;
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(e.Message);
                        return false;
                    }
                    finally
                    {
                        o.Close();
                    }
                }
            }
        }
コード例 #2
0
 public static bool UpdateIncident(Incident i)
 {
     using (OracleConnection o = new OracleConnection(connstring))
     {
         using (OracleCommand c = new OracleCommand())
         {
             try
             {
                 c.Connection = o;
                 o.Open();
                 c.CommandText = "UPDATE TIncident SET Beschrijving = '" + i.Beschrijving + "' WHERE ID = '" + i.UID + "'";
                 c.ExecuteNonQuery();
                 return true;
             }
             catch (Exception e)
             {
                 MessageBox.Show(e.Message);
                 return false;
             }
             finally
             {
                 o.Close();
             }
         }
     }
 }
コード例 #3
0
 public static bool DeleteIncident(Incident i)
 {
     using (OracleConnection o = new OracleConnection(connstring))
     {
         using (OracleCommand c = new OracleCommand())
         {
             try
             {
                 c.Connection = o;
                 o.Open();
                 c.CommandText = "DELETE FROM TIncident WHERE ID = '" + i.UID + "'";
                 c.ExecuteNonQuery();
                 return true;
             }
             catch (Exception e)
             {
                 MessageBox.Show(e.Message);
                 return false;
             }
             finally
             {
                 o.Close();
             }
         }
     }
 }
コード例 #4
0
ファイル: Missies_.cs プロジェクト: Stannnnn/Live_Performance
 public bool DeleteIncident(Incident i)
 {
     return DBConnect.DeleteIncident(i);
 }
コード例 #5
0
ファイル: Missies_.cs プロジェクト: Stannnnn/Live_Performance
 public bool AddIncident(Incident i, int missieUID)
 {
     return DBConnect.AddIncident(i, missieUID);
 }
コード例 #6
0
ファイル: Missies_.cs プロジェクト: Stannnnn/Live_Performance
 public bool UpdateIncident(Incident i)
 {
     return DBConnect.UpdateIncident(i);
 }