예제 #1
0
        private void dgv_2_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            CRUD sql = new CRUD();

            try
            {
                S_ID    = dgv_2.SelectedRows[0].Cells[0].Value.ToString();
                S_price = dgv_2.SelectedRows[0].Cells[4].Value.ToString();
                id_inv  = dgv_2.SelectedRows[0].Cells[5].Value.ToString();

                AddTransLine add = new AddTransLine();
                add.get_data(code_store, customer, S_ID, id_spg);
                add.get_data_trans_line(Convert.ToInt32(S_price), t_id);
                //add.Post_Discount();
                discCalcSP(t_id, S_ID, purchQty, id_spg, "");
                //add.cek_article2();

                //MEMOTONG ARTICLE
                Inv_Line inv          = new Inv_Line();
                int      qty_min_plus = -1;
                String   type_trans   = "1";
                inv.cek_qty_inv(id_inv);
                inv.cek_type_trans(type_trans);
                inv.cek_inv_line(t_id, qty_min_plus);

                back_uc();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
예제 #2
0
        //=================SELECT VALUE BY PRESS ENTER=======================
        private void dgv_2_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                try
                {
                    //S_ID = dgv_2.SelectedRows[0].Cells[0].Value.ToString();

                    //S_price = dgv_2.SelectedRows[0].Cells[4].Value.ToString();
                    //id_inv = dgv_2.SelectedRows[0].Cells[5].Value.ToString();

                    ////============================================================
                    //Post_Discount();
                    ////============================================================
                    //cek_article2();
                    ////MEMOTONG ARTICLE
                    //Inv_Line inv = new Inv_Line();
                    //int qty_min_plus = -1;
                    //String type_trans = "1";
                    //inv.cek_qty_inv(id_inv);
                    //inv.cek_type_trans(type_trans);
                    //inv.cek_inv_line(t_id, qty_min_plus);

                    //back_uc();
                    S_ID    = dgv_2.SelectedRows[0].Cells[0].Value.ToString();
                    S_price = dgv_2.SelectedRows[0].Cells[4].Value.ToString();
                    id_inv  = dgv_2.SelectedRows[0].Cells[5].Value.ToString();

                    AddTransLine add = new AddTransLine();
                    add.get_data(code_store, customer, S_ID, id_spg);
                    add.get_data_trans_line(Convert.ToInt32(S_price), t_id);
                    //add.Post_Discount();
                    discCalcSP(t_id, S_ID, purchQty, id_spg, "");
                    //add.cek_article2();

                    //MEMOTONG ARTICLE
                    Inv_Line inv          = new Inv_Line();
                    int      qty_min_plus = -1;
                    String   type_trans   = "1";
                    inv.cek_qty_inv(id_inv);
                    inv.cek_type_trans(type_trans);
                    inv.cek_inv_line(t_id, qty_min_plus);

                    back_uc();
                }
                catch
                {
                    MessageBox.Show("Select a value in the table");
                }
                //MessageBox.Show("Enter pressed");
            }
        }