コード例 #1
0
        public void addtransaction(CurrentTransaction_DB sDB)
        {
            string         query = String.Format("Insert into CurrentTransaction Values('{0}','{1}',{2}, {3})", sDB.Item, sDB.Quantity, sDB.Price, sDB.PayPrice);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
コード例 #2
0
        public void deletetransaction(CurrentTransaction_DB sDB)
        {
            string         query = String.Format("delete from CurrentTransaction where item = '{0}'", sDB.Item);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
コード例 #3
0
        private void btn_cancel_Click(object sender, EventArgs e)
        {
            CurrentTransaction_DB cTR = new CurrentTransaction_DB();

            cTR.Item = cBox_Item.Text;
            cTR.deletetransaction(cTR);
        }
コード例 #4
0
        private void NewTransaction_Load(object sender, EventArgs e)
        {
            lbl_ShowDate.Text = DateTime.Now.ToString();
            Storage_DB sDB = new Storage_DB();

            sDB.fillcombobox(cBox_Item);

            CurrentTransaction_DB cTR = new CurrentTransaction_DB();

            dataGridView1.AutoGenerateColumns = true;
            cTR.FillGrid(dataGridView1);
        }
コード例 #5
0
        private void Bill_Load(object sender, EventArgs e)
        {
            Transaction_DB cTR = new Transaction_DB();

            /* label5.Text = cTR.CustomerName;
             * label6.Text = cTR.Mobile;
             * label7.Text = cTR.PurchaseDate;
             * label8.Text = cTR.TotalBill;
             * */
            CurrentTransaction_DB TR = new CurrentTransaction_DB();

            dataGridView1.AutoGenerateColumns = true;
            TR.FillGrid(dataGridView1);
        }
コード例 #6
0
        private void btn_Ok_Click(object sender, EventArgs e)
        {
            CurrentTransaction_DB cTR = new CurrentTransaction_DB();
            int price = cTR.getprice(cBox_Item.Text);
            int paid  = price * (Convert.ToInt32(cBox_Quantity.Text));

            cTR.Item     = cBox_Item.Text;
            cTR.Quantity = cBox_Quantity.Text;
            cTR.Price    = price.ToString();
            cTR.PayPrice = paid.ToString();
            cTR.addtransaction(cTR);
            // dataGridView1.AutoGenerateColumns = true;
            //cTR.FillGrid(dataGridView1);

            sum = sum + paid;
            lbl_ShowBill.Text = sum.ToString();
        }
コード例 #7
0
        private void btn_Submit_Click(object sender, EventArgs e)
        {
            CurrentTransaction_DB cTR = new CurrentTransaction_DB();
            Transaction_DB        tr  = new Transaction_DB();
            int price = cTR.getprice(cBox_Item.Text);
            int paid  = price * (Convert.ToInt32(cBox_Quantity.Text));

            sum = sum + paid;

            tr.CustomerName = txt_Name.Text;
            tr.Mobile       = txt_Mobile.Text;
            tr.PurchaseDate = lbl_ShowDate.Text;
            tr.TotalBill    = sum.ToString();
            tr.addtransaction(tr);
            Bill b = new Bill();

            b.label5.Text = tr.CustomerName;
            b.label6.Text = tr.Mobile;
            b.label7.Text = tr.PurchaseDate;
            b.label8.Text = tr.TotalBill;
            b.Show();
            cTR.empty();
        }