コード例 #1
0
        public bool XoaBHYT(BHYT bh)
        {
            string[] param  = { "@SoTheBH", "@TenChuThe" };
            object[] values = { bh.SoTheBH, bh.TenChuThe };
            string   query  = "Delete from BHYTe where SoTheBH=@SoTheBH ";

            return(db.ExecuteNonQueryPara(query, param, values));
        }
コード例 #2
0
        public bool SuaBHYT(BHYT bh)
        {
            string[] param  = { "@SoTheBH", "@TenChuThe" };
            object[] values = { bh.SoTheBH, bh.TenChuThe };
            string   query  = "Update BHYTe set TenChuThe=@TenChuThe where SoTheBH=@SoTheBH";

            return(db.ExecuteNonQueryPara(query, param, values));
        }
コード例 #3
0
        public bool ThemBHYT(BHYT bh)
        {
            string[] param  = { "@SoTheBH", "@TenChuThe" };
            object[] values = { bh.SoTheBH, bh.TenChuThe };
            string   query  = "Insert into BHYTe(SoTheBH,TenChuThe) values (@SoTheBH,@TenChuThe)";

            return(db.ExecuteNonQueryPara(query, param, values));
        }
コード例 #4
0
ファイル: frmQLTTBHYT.cs プロジェクト: HongTham06/DoAn
        private BHYT getDataBHYT()
        {
            BHYT bh = new BHYT();

            bh.SoTheBH   = txtSoThe.Text;
            bh.TenChuThe = txtTenChuThe.Text;
            return(bh);
        }
コード例 #5
0
ファイル: frmQLTTBHYT.cs プロジェクト: HongTham06/DoAn
        private void btnXoa_Click(object sender, EventArgs e)
        {
            BHYT bh = getDataBHYT();

            if (MessageBox.Show("Bạn có chắc muốn xóa thẻ bảo hiểm này?", "Xác Nhận", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                if (bhytBO.XoaBHYT(bh))
                {
                    MessageBox.Show("Xóa thành công");
                }
                else
                {
                    MessageBox.Show("Không thể xóa");
                }
            }
            bindData();
        }
コード例 #6
0
ファイル: frmQLTTBHYT.cs プロジェクト: HongTham06/DoAn
        private void btnLuu_Click(object sender, EventArgs e)
        {
            BHYT bh = getDataBHYT();

            if (txtSoThe.Text == "" || txtTenChuThe.Text == "")
            {
                MessageBox.Show("Bạn cần nhập đủ thông tin");
            }
            else
            {
                if (btnSua.Enabled == false)
                {
                    if (bhytBO.kiemTraBHYT(txtSoThe.Text) == false)
                    {
                        if (bhytBO.ThemBHYT(bh))
                        {
                            MessageBox.Show("Thêm thành công");
                        }
                        else
                        {
                            MessageBox.Show("Lỗi nhập dữ liệu");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Đã có bảo hiểm " + txtSoThe.Text + " trong hệ thống");
                    }
                }
                else
                {
                    if (bhytBO.SuaBHYT(bh))
                    {
                        MessageBox.Show("Sửa thành công");
                    }
                    else
                    {
                        MessageBox.Show("Không thể sửa thông tin");
                    }
                }
            }
            bindData();
            btnSua.Enabled = true;
        }