示例#1
0
        public void binding()
        {
            DataSet data = new DtlTransasksiDao().ShowTransaction();

            dgv_transaksi.DataSource = data;
            dgv_transaksi.DataMember = "db_ticket";

            DataGridViewColumn column0 = dgv_transaksi.Columns[0];

            column0.Width      = 125;
            column0.HeaderText = "ID Order";

            DataGridViewColumn column1 = dgv_transaksi.Columns[1];

            column1.Width      = 125;
            column1.HeaderText = "ID Transaction";

            DataGridViewColumn column2 = dgv_transaksi.Columns[2];

            column2.Width      = 150;
            column2.HeaderText = "Transaction Date";

            DataGridViewColumn column3 = dgv_transaksi.Columns[3];

            column3.Width      = 100;
            column3.HeaderText = "Employee ID";

            DataGridViewColumn column4 = dgv_transaksi.Columns[4];

            column4.Width      = 100;
            column4.HeaderText = "Games ID";

            DataGridViewColumn column5 = dgv_transaksi.Columns[5];

            column5.Width      = 150;
            column5.HeaderText = "Game Category";

            DataGridViewColumn column6 = dgv_transaksi.Columns[6];

            column6.Width      = 100;
            column6.HeaderText = "Price";

            DataGridViewColumn column7 = dgv_transaksi.Columns[7];

            column7.Width      = 50;
            column7.HeaderText = "Amount";

            DataGridViewColumn column8 = dgv_transaksi.Columns[8];

            column8.Width      = 100;
            column8.HeaderText = "Total";
        }
        private void Frm_rpt_ticket_Load(object sender, EventArgs e)
        {
            DataSet   data = new DtlTransasksiDao().ShowTransaction();
            DataTable dt   = new DataTable();

            dt = data.Tables[0];

            Cr_ticket obj_rpt = new Cr_ticket();

            obj_rpt.SetDataSource(dt);
            Crv_ticket.ReportSource = obj_rpt;
            Crv_ticket.Refresh();
        }
示例#3
0
        private void btn_tambah_Click(object sender, EventArgs e)
        {
            // Insert Data in Form

            Frm_tmbh_transaksi frm_tmbh = new Frm_tmbh_transaksi(id_pegawai, txt_id_transaksi.Text);

            if (frm_tmbh.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show("Data Has Been Added To Cart", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                binding();
                DataSet ds = new DtlTransasksiDao().GrandTotal(dtl);

                lbl_total.Text = ds.Tables[0].Rows[0][0].ToString();
            }
        }
示例#4
0
        //Get Data From databases, post to Data Grid View
        public void binding()
        {
            DataSet data = new DtlTransasksiDao().CountTicket(dtl);

            dgv_transaksi.DataSource = data;
            dgv_transaksi.DataMember = "db_ticket";

            DataGridViewColumn column0 = dgv_transaksi.Columns[0];

            column0.Width      = 125;
            column0.HeaderText = "Transaction ID";

            DataGridViewColumn column1 = dgv_transaksi.Columns[1];

            column1.Width      = 125;
            column1.HeaderText = "Transaction Date";

            DataGridViewColumn column2 = dgv_transaksi.Columns[2];

            column2.Width      = 80;
            column2.HeaderText = "Games ID";

            DataGridViewColumn column3 = dgv_transaksi.Columns[3];

            column3.Width      = 150;
            column3.HeaderText = "Games Category";

            DataGridViewColumn column4 = dgv_transaksi.Columns[4];

            column4.Width      = 50;
            column4.HeaderText = "Price";

            DataGridViewColumn column5 = dgv_transaksi.Columns[5];

            column5.Width      = 50;
            column5.HeaderText = "Amount";

            DataGridViewColumn column6 = dgv_transaksi.Columns[6];

            column6.Width      = 100;
            column6.HeaderText = "Total";
        }
示例#5
0
        private void btn_bayar_Click(object sender, EventArgs e)
        {
            DtlTransaksi dtl = new DtlTransaksi();

            if (txt_bayar.Text == "")
            {
                MessageBox.Show("Please input cash money !", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                DataSet ds = new DtlTransasksiDao().GrandTotal(dtl);
                lbl_total.Text = ds.Tables[0].Rows[0][0].ToString();

                double bayar       = Convert.ToDouble(txt_bayar.Text);
                double grand_total = Convert.ToDouble(lbl_total.Text);

                double kembalian = bayar - grand_total;
                lbl_kembalian.Text = Convert.ToString(kembalian);
            }
        }
示例#6
0
 private void btn_cari_tgl_Click(object sender, EventArgs e)
 {
     if ((dtp_awal.Text == "") || (dtp_akhir.Text == ""))
     {
         MessageBox.Show("Please Input Keywords ! ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         try {
             DtlTransaksi dtl_transaksi = new DtlTransaksi();
             dtl_transaksi.tgl_transaksi_awal  = dtp_awal.Value.ToString("yyyy-MM-dd");
             dtl_transaksi.tgl_transaksi_akhir = dtp_akhir.Value.ToString("yyyy-MM-dd");
             DataSet ds = new DtlTransasksiDao().FindByDate(dtl_transaksi);
             dgv_transaksi.DataSource = ds;
             dgv_transaksi.DataMember = "dtl_transaksi";
         }
         catch (DataException) {
             MessageBox.Show("Games Category Not Found !", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
示例#7
0
        private void btn_cari_Click(object sender, EventArgs e)
        {
            if (txt_cari.Text == "")
            {
                MessageBox.Show("Please Input Keywords ! ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            DtlTransaksi dtl_transaksi = new DtlTransaksi();

            if (cmb_cari.Text == "ID Transaction")
            {
                try{
                    dtl_transaksi.id_transaksi = txt_cari.Text;
                    DataSet ds = new DtlTransasksiDao().FindById(dtl_transaksi);

                    dgv_transaksi.DataSource = ds;
                    dgv_transaksi.DataMember = "dtl_transaksi";
                    eventclickgrid();
                }
                catch (DataException) {
                    MessageBox.Show("ID Transaction Not Found !", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else if (cmb_cari.Text == "ID Games")
            {
                try {
                    dtl_transaksi.id_games = txt_cari.Text;
                    DataSet ds = new DtlTransasksiDao().FindByCategory(dtl_transaksi);
                    dgv_transaksi.DataSource = ds;
                    dgv_transaksi.DataMember = "dtl_transaksi";
                    eventclickgrid();
                }
                catch (DataException) {
                    MessageBox.Show("ID Games Not Found !", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }