public static string HapusData(string kode, string id) { using (var tranScope = new TransactionScope(TransactionScopeOption.RequiresNew)) { try { string sql = ""; if (id == "") { sql = "DELETE FROM bill_of_materials WHERE kode_barang = '" + kode + "'"; } else { sql = "DELETE FROM bill_of_materials WHERE id_bahan_baku = '" + id + "' && kode_barang = '" + kode + "'"; } string namaServer = Koneksi.GetNamaServer(); Koneksi.JalankanPerintahDML(sql); tranScope.Complete(); return("1"); } catch (Exception exc) { tranScope.Dispose(); return(exc.Message); } } }
public static string HapusData(string pjad) { string sql = "DELETE FROM penjadwalan WHERE id = '" + pjad + "'"; string namaServer = Koneksi.GetNamaServer(); try { Koneksi.JalankanPerintahDML(sql); return("1"); } catch (MySqlException exc) { return(exc.Message + ". Perintah sql : " + sql); } }
public static string HapusData(string kode) { string sql = "DELETE FROM barang WHERE kode = '" + kode + "'"; string namaServer = Koneksi.GetNamaServer(); try { Koneksi.JalankanPerintahDML(sql); return("1"); } catch (MySqlException exc) { return(exc.Message + ". Perintah sql : " + sql); } }
public static string HapusData(string pp) { string sql = "DELETE FROM progress_produksi WHERE nomer_dokumen = '" + pp + "'"; string namaServer = Koneksi.GetNamaServer(); try { Koneksi.JalankanPerintahDML(sql); return("1"); } catch (MySqlException exc) { return(exc.Message + ". Perintah sql : " + sql); } }
public static string HapusData(Pekerja pPekerja) { string sql = "DELETE FROM Pekerja WHERE Id = '" + pPekerja.IdPekerja + "'"; string namaServer = Koneksi.GetNamaServer(); try { Koneksi.JalankanPerintahDML(sql); return("1"); } catch (MySqlException exc) { return(exc.Message + ". Perintah sql : " + sql); } }