Esempio n. 1
0
        public void HitungJumlah(ref TextBox txtJumlah, ref TextBox txtTotal, String noMeja)
        {
            try
            {
                koneksi = new Koneksi();
                koneksi.cmd = koneksi.conn.CreateCommand();
                koneksi.cmd.CommandText = "select jumlah, total from tblOrder where noMeja = '" + noMeja + "'";
                koneksi.dt = new DataTable("tblOrder");

                koneksi.conn.Open();
                koneksi.dt.Load(koneksi.cmd.ExecuteReader());
                koneksi.conn.Close();

                int jumlah = 0, total=0;
                foreach (DataRow i in koneksi.dt.Rows)
                {
                    jumlah += (int)i["jumlah"];
                    total += (int)i["total"];
                }

                txtJumlah.Text = jumlah.ToString();
                txtTotal.Text = total.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("{0}", ex.Message), "Özil Cafe", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 2
0
    protected void Simpan_Click(object sender, EventArgs e)
    {
        Koneksi cn = new Koneksi();

        //Response.Write("<script language='javascript'>window.alert('Harap Pilih File untuk di Upload');</script>");
        //get session mem id
        foreach (string key in Session.Contents)
        {
            memid = Session["Member_ID"].ToString();
        }
        if (FileUploadGambar.HasFile) //cek file upload null / tidak
        {
            string extension = Path.GetExtension(FileUploadGambar.PostedFile.FileName);
            Label2.Visible = true;
            //Label2.Text = "File Sukses TerUpload dengan Nama: " + "Foto_" + nama + "" + extension + " dengan User : "******"User"] + " ";
            //imgPath
            string ran     = Guid.NewGuid().ToString("n").Substring(0, 8);//get random num
            string nama    = "File" + memid;
            string imgPath = "../img/" + ran + "_" + nama + extension;
            //Upload File
            FileUploadGambar.SaveAs(Server.MapPath(imgPath));

            byte[]         theImage = new byte[FileUploadGambar.PostedFile.ContentLength];
            HttpPostedFile Image    = FileUploadGambar.PostedFile;
            Image.InputStream.Read(theImage, 0, (int)FileUploadGambar.PostedFile.ContentLength);

            int    length   = theImage.Length;
            string fileName = FileUploadGambar.FileName.ToString();
            string type     = FileUploadGambar.PostedFile.ContentType;

            int size = FileUploadGambar.PostedFile.ContentLength;
            if (FileUploadGambar.PostedFile != null && FileUploadGambar.PostedFile.FileName != "")
            {
                string Hasil;
                Hasil = cn.KelasKoneksi_InsertStock(Convert.ToInt32(memid), TxtNamaBarang.Text, TxtTgl.Text, TxtKet.Text, DropDownListStatusBarang.SelectedValue, Convert.ToInt32(TxtJumlah.Text), imgPath);
                if (Hasil == "OK")
                {
                    Response.Write("<script language='javascript'>window.alert('Berhasil Menyimpan Data!');window.location='../Halaman/Master.aspx';</script>");
                }
                else
                {
                    Response.Write("<script language='javascript'>window.alert('Gagal Menyimpan Data dengan Error : " + Hasil + "');window.location='../Halaman/Master.aspx';</script>");
                }
            }
        }
        else
        {
            Response.Write("<script language='javascript'>window.alert('Harap Pilih File untuk di Upload');</script>");
        }
        //Hasil = cn.KelasKoneksi_InsertStock();
    }
Esempio n. 3
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         Koneksi koneksi = new Koneksi("localhost", "kerja_praktek", txtUsername.Text, txtPassword.Text);
         MessageBox.Show("Koneksi berhasil!");
         this.Owner.Enabled = true;
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
    protected void BtnBatalKeranjang_Click(object sender, EventArgs e)
    {
        //delete KeranjangBelanja berdasarkan memid
        Koneksi cn = new Koneksi();

        Hasil = cn.KelasKoneksi_CRUD("delete from keranjangbelanja where member_id = " + Convert.ToInt32(memid) + "");
        if (Hasil == "1")
        {
            Response.Write("<script language='javascript'>window.alert('Berhasil Delete Data dengan ID :" + Convert.ToString(memid) + "');window.location='../Halaman/Form_Pengguna.aspx';</script>");
        }
        else
        {
            Response.Write("<script language='javascript'>window.alert('Gagal Delete Data dengan ID : " + Convert.ToString(memid) + "');window.location='../Halaman/Form_Pengguna.aspx';</script>");
        }
    }
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            if (textBoxUsername.Text != "")
            {
                // Create objek bertipe Koneksi dengan memanggil constructor berparameter milik class Koneksi
                Koneksi k = new Koneksi(textBoxServer.Text, textBoxDatabase.Text, textBoxUsername.Text, textBoxPassword.Text);

                string hasilConnect = k.Connect(); // panggil method Conenct milik class Koneksi

                if (hasilConnect == "sukses")
                {
                    FormUtama frmUtama = (FormUtama)this.Owner;
                    frmUtama.getNotif();
                    frmUtama.tampilTotalPenjuatan();
                    frmUtama.Enabled = true;                                                                  // Agar form utama bisa diakses
                    MessageBox.Show("Selamat datang di Sistem Informasi Produksi Teaching Industry", "Info"); // tampilkan ucapan selamat datang

                    listHasilData.Clear();
                    string hasilCariPegawai = Pekerja.BacaData("username", textBoxUsername.Text, listHasilData);
                    if (hasilCariPegawai == "1")
                    {
                        Console.WriteLine(listHasilData);
                        if (listHasilData.Count > 0)
                        {
                            frmUtama.Enabled = true;

                            frmUtama.labelKodePegawai.Text    = listHasilData[0].IdPekerja.ToString();
                            frmUtama.labelNamaPegawai.Text    = listHasilData[0].Nama;
                            frmUtama.labelJabatanPegawai.Text = listHasilData[0].Jabatan.NamaJabatan;

                            this.Close(); // Tutup form login
                        }
                        else
                        {
                            MessageBox.Show("Username tidak ditemukan.");
                        }
                    }
                }
                else // Jika gagal
                {
                    MessageBox.Show("Koneksi gagal. Pesan kesalahan : " + hasilConnect, "Kesalahan");
                }
            }
            else
            {
                MessageBox.Show("Username tidak boleh dikosongi", "Kesalahan");
            }
        }
Esempio n. 6
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT fbel_tahun as 'TAHUN',fbel_id as 'BELANJA ID',fbel_kd_keg as 'KODE KEGIATAN',fbel_satuan as 'BANYAK SATUAN',fbel_nilai as 'NILAI',fbel_total as 'TOTAL BELANJA' FROM fakta_belanja");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatafakta.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 7
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT kont_id as 'KONTRAK ID',kont_spp as 'KODE SPP',kont_nomor as 'NOMOR KONTRAK',kont_nama as 'NAMA PERUSAHAAN',kont_bentuk as 'BENTUK PERUSAHAAN',kont_alamat as 'ALAMAT',kont_pimpinan as 'NAMA PIMPINAN PERUSAHAAN',kont_keperlian as 'KEPERLUAN KERJASAMA' FROM dim_kontrak");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatadimensi.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 8
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT fpan_tahun as 'TAHUN',fpan_id as 'KERJASAMA ID',fpan_bidang as 'KODE BIDANG',fpan_no as 'NOMOR KERJASAMA',fpan_usulan as 'NILAI USULAN (Rp.)',fpan_realisasi as 'NILAI REALISASI (Rp.)' FROM fakta_kerjasama");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatafakta.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 9
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT log_id as 'NOMOR ID',username as 'USERNAME',keterangan as 'LEVEL USER',tingkat as 'JABATAN PENGGUNA' FROM logon");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatauser.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 10
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT prog_id as 'PROGRAM ID',prog_kd_prog as 'KODE PROGRAM',prog_keterangan as 'KETERANGAN' FROM dim_program");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatadimensi.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 11
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT paj_id as 'PAJAK ID',paj_no_bukti as 'NOMOR BUKTI',paj_kd_bidang as 'KODE BIDANG',paj_kd_prog as 'KODE PROGRAM',paj_kd_keg as 'KODE KEGIATAN',paj_penyetor as 'NAMA PENYETOR',paj_keterangan as 'KETERANGAN' FROM dim_pajak");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatadimensi.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 12
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT fang_tahun as 'TAHUN',fang_kd_bidang as 'KODE BIDANG',fang_pend_id as 'PENDAPATAN ID',fang_pend_satuan as 'BANYAK SATUAN',fang_pend_nilai as 'NILAI PENDAPATAN',fang_pend_total as 'TOTAL PENDAPATAN',fang_pemb_id as 'PEMBIAYAAN ID',fang_pemb_satuan as 'BANYAK SATUAN',fang_nilai as 'NILAI PEMBIAYAAN',fang_pemb_total as 'TOTAL PEMBIAYAAN' FROM fakta_anggaran");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatafakta.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 13
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT unit_id as 'UNIT ID',unit_kd_unit as 'KODE UNIT',unit_nama as 'NAMA UNIT' FROM dim_unit");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatadimensi.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 14
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT fpk_tahun as 'TAHUN',fpk_kd_prog as 'KODE PROGRAM',fpk_kd_keg as 'KODE KEGIATAN',fpk_kd_bidang as 'KODE BIDANG',fpk_anggaran as 'TOTAL ANGGARAN' FROM fakta_p_k");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatafakta.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 15
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT fper_id_unit as 'UNIT ID',fper_id_subunit as 'SUB UNIT ID',fper_nama as 'NAMA',fper_angg as 'PENGGUNAAN ANGGARAN (Rp.)' FROM fakta_perangkat");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatafakta.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 16
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT pend_id as 'PENDAPATAN ID',pend_kd_bidang as 'KODE BIDANG',pend_kd_unit as 'KODE UNIT',pend_keterangan as 'KETERANGAN',pend_satuan as 'BANYAK PENDAPATAN',pend_nilai as 'NILAI PENDAPATAN' FROM dim_pendapatan");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatadimensi.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
Esempio n. 17
0
        private void ListData()
        {
            DataTable dt = new DataTable();


            Koneksi koneksi = new Koneksi();

            dt = koneksi.tampil_data_dw("SELECT ind_id as 'INDIKATOR ID', ind_kd_bidang as 'KODE BIDANG', ind_kd_prog as 'KODE PROGRAM', ind_kd_keg as 'KODE KEGIATAN', ind_uraian as 'URAIAN' FROM dim_indikator");
            try
            {
                paging_PageIndex = 1;

                if (dt.Rows.Count > 0)
                {
                    DataTable tmpTable = new DataTable();

                    tmpTable = dt.Clone();

                    if (dt.Rows.Count >= paging_NoOfRecPerPage)
                    {
                        for (int i = 0; i < paging_NoOfRecPerPage; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tmpTable.ImportRow(dt.Rows[i]);
                        }
                    }

                    listDatadimensi.DataContext = tmpTable.DefaultView;
                    tmpTable.Dispose();
                    dt_TempData = dt;
                }
                else
                {
                    // MessageBox.Show("Message");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Message" + ex);
            }
        } //void closing
        public void cariPasien(string nomorMR)
        {
            Koneksi koneksi = new Koneksi();

            DCMedismartToolsDataContext context = koneksi.DataContext;

            try
            {
                pasien = (from pasien_ in context.PASIENs
                          where pasien_.KD_PASIEN == nomorMR
                          select pasien_).FirstOrDefault();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 19
0
    protected void BtnCekKeranjang_Click(object sender, EventArgs e)
    {
        //multiview / div di show / hide berdasarkan memid
        Koneksi cn = new Koneksi();
        DataSet ds = new DataSet();

        ds = cn.getDataSet("select * from KeranjangBelanja where Member_ID = " + Convert.ToInt32(memid) + "");
        ListViewCekKeranjang.DataSource = ds;
        ListViewCekKeranjang.DataBind();
        ListViewCekKeranjang.Visible = true;
        BtnBatalKeranjang.Visible    = true;
        BtnCetak.Visible             = true;
        //hide
        BtnSimpanKeranjang.Visible = false;
        ListViewHakAkses.Visible   = false;
        TxtJumlah.Visible          = false;
    }
Esempio n. 20
0
    protected void Search_Click(object sender, EventArgs e)
    {
        //***** GET DATASET
        Koneksi  cn             = new Koneksi();
        DataSet  ds             = new DataSet();
        string   date1          = TxtAwal.Text;
        DateTime formattedtime1 = DateTime.ParseExact(date1, "dd/MM/yyyy", CultureInfo.InvariantCulture);
        string   date2          = TxtAkhir.Text;
        DateTime formattedtime2 = DateTime.ParseExact(date2, "dd/MM/yyyy", CultureInfo.InvariantCulture);

        string sql = "Select * from Stock where TglDatang >= '" + date1 + "' and TglDatang <= '" + date2 + "' ";

        ds = cn.getDataSet(sql);

        ListViewMasterStock.DataSource = ds;
        ListViewMasterStock.DataBind();
    }
Esempio n. 21
0
        public void BukaTransaksiNonRWI(string kodeUnit, string nomorTransaksi, DateTime tglKunjungan)
        {
            Koneksi koneksi = new Koneksi();
            DCMedismartToolsDataContext context          = koneksi.DataContext;
            TransactionScope            transactionScope = new TransactionScope();

            using (transactionScope)
            {
                try
                {
                    var selectedKunjungan = (from k in context.KUNJUNGANs
                                             where k.KD_PASIEN == pasien.KD_PASIEN &&
                                             k.TGL_MASUK == tglKunjungan
                                             select k
                                             ).FirstOrDefault();

                    var selectedTransaksi = (from transaksi in context.TRANSAKSIs
                                             where transaksi.KD_PASIEN == pasien.KD_PASIEN &&
                                             transaksi.NO_TRANSAKSI == nomorTransaksi
                                             select transaksi
                                             ).FirstOrDefault();

                    selectedKunjungan.TGL_KELUAR = null;
                    selectedKunjungan.JAM_KELUAR = null;

                    selectedTransaksi.CO_STATUS = false;
                    selectedTransaksi.TGL_CO    = null;

                    context.SubmitChanges();

                    transactionScope.Complete();

                    MessageBox.Show("Transaksi sudah dibuka", "Information");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                finally
                {
                    context.Dispose();
                    transactionScope.Dispose();
                }
            }
        }
        private void buttonRegister_Click(object sender, EventArgs e)
        {
            Koneksi koneksi = new Koneksi("localhost", "isa_uts", "root", "");

            Koneksi koneksi2 = new Koneksi();

            if (User.cekUser(textBoxUsername.Text) == true)
            {
                MessageBox.Show("Username telah terdaftar, anda gagal mendaftar", "Informasi");
            }
            else
            {
                User userRegis = new User(1, textBoxUsername.Text, textBoxPassword.Text, comboBoxRole.Text, textBoxName.Text);
                Register.TambahUser(textBoxUsername.Text, textBoxPassword.Text, comboBoxRole.Text, textBoxName.Text);
                User.ManajemenUser(userRegis);
                MessageBox.Show("Selamat anda berhasil terdaftar", "Informasi");
            }
        }
Esempio n. 23
0
        public void Tambah(String noMeja, String nama, int jumlah, int harga, int total)
        {
            try
            {
                koneksi = new Koneksi();
                koneksi.cmd.CommandText = "insert into tblOrder values('','" + noMeja + "','" + nama + "', '" + jumlah + "', '" + harga + "', '" + total + "')";

                koneksi.conn.Open();
                koneksi.cmd.ExecuteNonQuery();
                koneksi.conn.Close();

                MessageBox.Show(string.Format("Pesanan anda telah disimpan"), "Özil Cafe", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("{0}", ex.Message), "Özil Cafe", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 24
0
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        //deklarasi variabel
        string nama  = string.Empty;
        string email = string.Empty;
        string pass  = string.Empty;
        string ttl   = string.Empty;

        nama  = TxtNama.Text;
        email = TxtEmail.Text;
        pass  = TxtPswd.Text;
        ttl   = TxtTTL.Text;
        //Pemanggilan fungsi
        Koneksi cn    = new Koneksi();
        string  Hasil = cn.KelasKoneksi_Insert(nama, pass, email, ttl);

        if (Hasil == "1")
        {
            string sqlselect = "select max(member_id) as member_id from Ms_member";

            List <string> memberid = cn.KelasKoneksi_SelectGlobal(sqlselect, "5");
            foreach (string item in memberid)
            {
                string isipesan = "<div style='background:linear-gradient(#c0c0c0, #f5f5f5);border-bottom:1px solid #d60000;padding:5px;font-family:verdana;'>Pemberitahuan IT Web System</div><div style='font-family:verdana;font-size:10pt;padding:4px;margin:5px auto;border-left:3px solid #0080c0;'><div style='margin:0 auto;background: #FFfFD5;width:50%;padding:5px;border-radius:4px;border-left:3px solid #0080c0;font-family:verdana;font-size:10pt;'> Selamat, Registrasi Anda Berhasil!<br/> Berikut Adalah Detail Akun Anda Untuk Login ; <br/> Username : "******"<br/>Password : "******"<br/> Jaga selalu Kerahasiaan Akun Anda. Kami Tidak Bertanggung Jawab atas Kelalaian yang di sebabkan Oleh Pengguna.  <br/><span style='color:blue;font-size:8pt;'></span></div><br/><br><center style='color: blue; '></center><br/><center>Atas perhatian dan kerjasamanya kami ucapkan terimakasih.</center><br/><br/><br/><strong style='color:blue;font-family:verdana;'>Regards,<br/><i style='font-size:8pt;color:#666;'>Web System | IT Departement</i></strong><br/><strong>IT Group</strong><br/><i>PT. YourCompanyName</i><br/><span style='font-size:9pt;color:#666;'>Jakarta - Indonesia<br/>Branch Address</span><br/>Phone Number<br/>Website : <a href=# target='_blank'>Your Web</a><br/></div>";
                HasilEmail = cn.email_otomatis(email, isipesan);
                //Response.Write("<script language='javascript'>window.alert('Sukses Menyimpan Data !');window.location='../Login.aspx';</script>");
            }
            if (HasilEmail == "OK")
            {
                Response.Write("<script language='javascript'>window.alert('Sukses Menyimpan Data, Cek Email Anda Segera !');window.location='../Login.aspx';</script>");
            }
            else
            {
                Response.Write("<script language='javascript'>window.alert('Gagal Menyimpan Data!');window.location='../Login.aspx';</script>");
            }

            //kirim email id login dan passwordnya
            //redirect ke menu login
        }
        else
        {
            Response.Write("<script language=javascript>alert('gagal Insert Data, dengan Error : " + Hasil + "');</script>");
        }
    }
        public void GantiTanggalKunjungan(string kodeUnit, string nomorTransaksi, DateTime tglKunjunganLama, DateTime tglKunjunganBaru)
        {
            Koneksi koneksi = new Koneksi();

            using (SqlConnection connection = new SqlConnection(koneksi.Connection))
            {
                try
                {
                    connection.Open();

                    SqlTransaction sqlTransaction = connection.BeginTransaction();

                    SqlCommand command = new SqlCommand("update kunjungan set tgl_masuk = '" + tglKunjunganBaru.Date.ToString() +
                                                        "' where kd_pasien  = '" + pasien.KD_PASIEN +
                                                        "' and tgl_masuk = '" + tglKunjunganLama.Date.ToString() + "'", connection, sqlTransaction);

                    try
                    {
                        command.CommandTimeout = 300;
                        command.ExecuteNonQuery();

                        sqlTransaction.Commit();

                        MessageBox.Show("Tanggal kunjungan dan tanggal transaksi berhasil diganti", "Information");
                    }
                    catch (Exception ex)
                    {
                        sqlTransaction.Rollback();

                        MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    finally
                    {
                        sqlTransaction.Dispose();
                        command.Dispose();
                        connection.Dispose();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Esempio n. 26
0
        public void Hapus(String noMeja)
        {
            try
            {
                koneksi = new Koneksi();
                koneksi.cmd = koneksi.conn.CreateCommand();
                koneksi.cmd.CommandText = "delete from tblOrder where noMeja = '" + noMeja + "'";

                koneksi.conn.Open();
                koneksi.cmd.ExecuteNonQuery();
                koneksi.conn.Close();

                MessageBox.Show(string.Format("Pesanan anda telah dihapus"), "Özil Cafe", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("{0}", ex.Message), "Özil Cafe", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 27
0
    protected void BtnLogin_Click(object sender, EventArgs e)
    {
        //ke tb userakses berdasarkan member id
        //Panggil Kelas Konksi Login
        Koneksi cn = new Koneksi();
        bool    hasil;

        hasil = cn.KelasKoneksi_Login(TxtUsername.Text, TxtPasswd.Text);
        if (Validate())
        {
            if (hasil)
            {
                Session["Member_ID"] = TxtUsername.Text;
                //ke tb userakses berdasarkan member id -- 1:menu master 2:menu pengguna
                string        sql_akses = "select id_akses from User_akses where Member_id = " + Convert.ToInt32(TxtUsername.Text) + "";
                List <string> akses     = cn.KelasKoneksi_SelectGlobal(sql_akses, "3");
                if (akses.Count == 0)
                {
                    Response.Write("<script language='javascript'>window.alert('Gagal Login! Hak Akses Anda tidak Di Temukan');window.location='../Login.aspx';</script>");
                }
                else
                {
                    if (akses[0].ToString() == "1")
                    {
                        Response.Write("<script language='javascript'>window.alert('Berhasil Login!');window.location='../Halaman/Master.aspx';</script>");
                    }
                    else
                    {
                        Response.Write("<script language='javascript'>window.alert('Berhasil Login!');window.location='../Halaman/Form_Pengguna.aspx';</script>");
                    }
                }
            }
            else
            {
                Response.Write("<script language='javascript'>window.alert('Gagal Login!');window.location='../Login.aspx';</script>");
            }
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Gagal menyimpan, Harap Centang Captcha !')", true);
        }
    }
Esempio n. 28
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            if (textBoxUsername.Text != "")
            {
                //create objek bertipe Koneksi dengan memanggil constructor berparameter milik class Koneksi
                Koneksi k = new Koneksi(textBoxServer.Text, textBoxDatabase.Text, textBoxUsername.Text, textBoxPassword.Text);

                string hasilConnect = k.Connect();                                           //panggil method Connect milik class Koneksi

                if (hasilConnect == "sukses")                                                //jika koneksi ke database berhasil
                {
                    MessageBox.Show("Selamat Datang di Sistem Penjualan Pembelian", "Info"); //tampilkan ucapan selamat datang

                    FormUtama     frmUtama = (FormUtama)this.Owner;
                    DaftarPegawai daftar   = new DaftarPegawai();
                    string        hasil    = daftar.CariData("Username", textBoxUsername.Text);
                    if (hasil == "sukses")
                    {
                        frmUtama.Enabled = true;
                        frmUtama.labelKodePegawai.Text = daftar.ListPegawai[0].KodePegawai;
                        frmUtama.labelNamaPegawai.Text = daftar.ListPegawai[0].NamaPegawai;
                        frmUtama.labelJabatan.Text     = daftar.ListPegawai[0].KategoriJabatan.NamaJabatan;

                        PengaturanHakAksesMenu(daftar.ListPegawai[0].KategoriJabatan.NamaJabatan);
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Gagal mencari data pegawai. Pesan = " + hasil, "kesalahan");
                    }
                }
                else  //jika gagal
                {
                    MessageBox.Show("Koneksi gagal. Pesan Kesalahan : " + hasilConnect, "Kesalahan");  //tampilkan pesan kesalahan
                }
            }
            else
            {
                MessageBox.Show("Username tidak boleh dikosongi", "Kesalahan");
            }
        }
Esempio n. 29
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBoxUsername.Text != "")
                {
                    Koneksi koneksi = new Koneksi("localhost", "isa_uts", textBoxUsername.Text, textBoxPassword.Text);

                    Koneksi koneksi2 = new Koneksi();

                    listUser = User.BacaData("username", textBoxUsername.Text);

                    if (listUser.Count > 0)
                    {
                        FormMenu formMenu = (FormMenu)this.MdiParent;
                        formMenu.labelUsername.Text = listUser[0].Username;
                        formMenu.labelRole.Text     = listUser[0].Role;

                        formMenu.userLogin = listUser[0];

                        FormPilihan formPilihan = new FormPilihan(formMenu);
                        formPilihan.MdiParent = this.MdiParent;
                        formPilihan.PengaturanHakAksesMenu(listUser[0].Role);
                        formPilihan.Show();
                        this.Close();

                        MessageBox.Show("Koneksi berhasil. Selamat Menggunakan Aplikasi", "Informasi");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Username tidak ditemukan");
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("Koneksi gagal. Pesan kesalahan: " + exception.Message, "Kesalahan");
            }
        }
Esempio n. 30
0
    protected void BtnSimpanKeranjang_Click(object sender, EventArgs e)
    {
        //get chk keranjang belanja
        //get listview item chk
        foreach (ListViewDataItem item in ListViewHakAkses.Items)
        {
            CheckBox chkSelect = (CheckBox)item.FindControl("chkbar");
            if (chkSelect != null)
            {
                int ID = Convert.ToInt32(chkSelect.Attributes["value"]);
                if (chkSelect.Checked && !this.ID_bar.Contains(ID))
                {
                    this.ID_bar.Add(ID);
                }
                else if (!chkSelect.Checked && this.ID_bar.Contains(ID))
                {
                    this.ID_bar.Remove(ID);
                }
            }
        }

        //insert ke KeranjangBelanja
        foreach (int item in ID_bar)
        {
            Koneksi cn = new Koneksi();
            //get nama barang
            string        sqlnama    = "select nama_barang from stock where id_barang = " + item + "";
            List <string> namaBarang = cn.KelasKoneksi_SelectGlobal(sqlnama, "4");
            string        sqlupdt    = "insert into KeranjangBelanja values (" + memid + "," + item + ",'" + namaBarang[0].ToString() + "', " + Convert.ToInt32(TxtJumlah.Text) + ", GETDATE())";//insert ke KeranjangBelanja
            Hasil = cn.KelasKoneksi_CRUD(sqlupdt);
            if (Hasil == "1")
            {
                Response.Write("<script language='javascript'>window.alert('Berhasil Insert Data dengan ID :" + Convert.ToString(item) + "');window.location='../Halaman/Form_Pengguna.aspx';</script>");
            }
            else
            {
                Response.Write("<script language='javascript'>window.alert('Gagal Insert Data dengan ID : " + Convert.ToString(item) + "');window.location='../Halaman/Form_Pengguna.aspx';</script>");
            }
        }
    }
Esempio n. 31
0
        public void loadComboPeriode()
        {
            string sql = "SELECT DATE_FORMAT(Tanggal,'%Y-%M') as Periode FROM notajual GROUP BY DATE_FORMAT(Tanggal,'%Y-%M')";

            comboBoxBulan.Items.Clear();
            try
            {
                //Koneksi.JalankanPerintahDML(sql);
                MySqlDataReader rd = Koneksi.JalankanPerintahQuery(sql);
                comboBoxBulan.Items.Add("Semua Tampil");
                while (rd.Read())
                {
                    comboBoxBulan.Items.Add(rd["Periode"] + "");
                }
                rd.Close();
                comboBoxBulan.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 32
0
    protected void BtnInsert_Click(object sender, EventArgs e)
    {
        //get listview item chk
        foreach (ListViewDataItem item in ListViewHakAkses.Items)
        {
            CheckBox chkSelect = (CheckBox)item.FindControl("ChkIDMem");
            if (chkSelect != null)
            {
                int ID = Convert.ToInt32(chkSelect.Attributes["value"]);
                if (chkSelect.Checked && !this.ID_Mem.Contains(ID))
                {
                    this.ID_Mem.Add(ID);
                }
                else if (!chkSelect.Checked && this.ID_Mem.Contains(ID))
                {
                    this.ID_Mem.Remove(ID);
                }
            }
        }
        //insert value
        Koneksi cn = new Koneksi();

        foreach (int item in ID_Mem)
        {
            Hasil = cn.KelasKoneksi_InsertHakAkses(item, Convert.ToInt32(DropDownListHakAkses.SelectedValue));
            //Response.Write("<script language='javascript'>window.alert('Berhasil Insert Data');</script>");
        }
        if (Hasil == "OK")
        {
            ListViewHakAkses.DataBind();
            Response.Write("<script language='javascript'>window.alert('Berhasil Insert Data');</script>");
        }
        else
        {
            ListViewHakAkses.DataBind();
            Response.Write("<script language='javascript'>window.alert('Terdapat Error Insert Data : " + Hasil + "');</script>");
        }
    }
 public int InsertData(string berat_filter, string qty, string nama_barang, string dari, string shift)
 {
     sql = @"insert into tb_timbang
          (BERAT_FILTER,QTY,NAMA_BARANG,DARI,SHIFT) 
          values (@berat_filter,@qty,@nama_barang,@dari,@shift)";
     try
     {
         using (MySqlConnection cnn = Koneksi.GetConnection())
             using (MySqlCommand cmd = new MySqlCommand(sql, cnn))
             {
                 cmd.Parameters.Add("@berat_filter", MySqlDbType.VarChar).Value = berat_filter;
                 cmd.Parameters.Add("@qty", MySqlDbType.VarChar).Value          = qty;
                 cmd.Parameters.Add("@name_barang", MySqlDbType.VarChar).Value  = nama_barang;
                 cmd.Parameters.Add("@dari", MySqlDbType.VarChar).Value         = dari;
                 cmd.Parameters.Add("@shift", MySqlDbType.VarChar).Value        = shift;
                 return(cmd.ExecuteNonQuery());
             }
         catch (Exception ex)
         {
             MessageBox.Show("error " + ex.Message);
             return(-1);
         }
     }
Esempio n. 34
0
        public void TampilGrid(ref DataGridView dtgOrder, String noMeja)
        {
            try
            {
                koneksi = new Koneksi();
                koneksi.cmd = koneksi.conn.CreateCommand();
                koneksi.cmd.CommandText = "select menu, jumlah, harga, total from tblOrder where noMeja = '" + noMeja + "'";

                koneksi.conn.Open();
                koneksi.da = new MySqlDataAdapter(koneksi.cmd);
                koneksi.conn.Close();

                koneksi.ds = new DataSet();
                koneksi.da.Fill(koneksi.ds, "tblOrder");
                dtgOrder.DataSource = koneksi.ds;
                dtgOrder.DataMember = "tblOrder";

                dtgOrder.Columns[0].HeaderText = "Menu";
                dtgOrder.Columns[1].HeaderText = "Jumlah";
                dtgOrder.Columns[2].HeaderText = "Harga";
                dtgOrder.Columns[3].HeaderText = "Total";
                dtgOrder.Columns[0].Width = 110;
                dtgOrder.Columns[1].Width = 60;
                dtgOrder.Columns[2].Width = 60;
                dtgOrder.Columns[3].Width = 60;
                dtgOrder.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGray;
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("{0}", ex.Message), "Özil Cafe", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }