コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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);
            }
        }