예제 #1
0
        private void editRoundToolStripMenuItem_Click(object sender, EventArgs e)
        {
            loadcr._read = false;
            FRound fr = new FRound();

            fr.ShowDialog(this);
            loaddata();
            loadcr._read = true;
        }
예제 #2
0
        private void Print()
        {
            if (RCheck == "ออกแล้ว")
            {
                if (MessageBox.Show("ข้อมูลนี้ได้ปริ้นออกไปแล้ว คุณต้องการแก้ไข้เพื่อให้สามารถปริ้นได้อีกครั้งหรือไม่", "ตรวจพบข้อผิดพลาด", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    loadcr._read = false;
                    FRound fr = new FRound();
                    fr._cRound  = true;
                    fr._cIDCard = cIDCard;
                    fr._cRTime  = cRTime;
                    fr.ShowDialog();
                    loaddata();
                    loadcr._read = true;
                }
                return;
            }
            else
            {
                if (MessageBox.Show("คุณแน่ใจแล้วที่ปริ้นข้อมูล", "คำเตือน", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    try
                    {
                        loadcr._read = false;
                        FPrint fp = new FPrint();
                        fp.rpDate   = lblDate.Text.Replace("วันที่ : ", "");
                        fp.rpIDRR   = cIRRD;
                        fp.rpIDCard = cIDCard;
                        fp.rpName   = cRName;
                        fp.rpLName  = cRLName;
                        fp.rpPST    = cRPST;
                        fp.rpNCar   = cRNCar;
                        fp.rpTime   = cRTime;
                        fp.rpRound  = cRound;
                        fp.rpTicket = cRTicket;
                        fp.rpMoney  = RMoney;
                        fp.ShowDialog(this);

                        string print = "ออกแล้ว";

                        loaddb.checkdb();
                        string       upp = "UPDATE DBRunRound SET RCheck='" + print + "' WHERE IDCard='" + cIDCard + "' AND [RTime] ='" + cRTime + "'";
                        OleDbCommand cmd = new OleDbCommand(upp, loaddb.cnn);
                        cmd.ExecuteNonQuery();
                        loaddb.cnn.Dispose();
                        loaddb.cnn.Close();
                        loaddata();
                        loadcr._read = true;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "ตรวจพบข้อผิดพลาด");
                    }
                }
            }
        }