Exemplo n.º 1
0
        private void chiTietToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_CTHDB fr = new fr_CTHDB();

            fr.MdiParent = this;
            fr.Show();
        }
Exemplo n.º 2
0
        private void msds_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            dong = e.RowIndex;
            fr_CTHDB fr = new fr_CTHDB();

            fr.SOHDB = msds.Rows[dong].Cells[0].Value.ToString();
            this.Close();
            fr.Show();
        }
Exemplo n.º 3
0
        private void btluu_Click(object sender, EventArgs e)
        {
            if (txtma.Text != "")
            {
                if (cbnv.Text != "")
                {
                    if (cbncc.Text != "")
                    {
                        if (themmoi == true)
                        {
                            try
                            {
                                ck.SOHDB    = txtma.Text;
                                ck.MANV     = cbnv.Text;
                                ck.NGAYBAN  = txtngay.Text;
                                ck.MAKH     = cbncc.Text;
                                ck.TONGTIEN = txttt.Text;

                                thucthi.themoihdb(ck);
                                locktext();
                                hienthi();
                                MessageBox.Show("Đã Lưu Thành Công", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                fr_CTHDB fr = new fr_CTHDB();
                                fr.SOHDB = txtma.Text;
                                this.Close();
                                fr.Show();
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.ToString(), "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                        else
                        {
                            try
                            {
                                ck.SOHDB    = txtma.Text;
                                ck.MANV     = cbnv.Text;
                                ck.NGAYBAN  = txtngay.Text;
                                ck.MAKH     = cbncc.Text;
                                ck.TONGTIEN = txttt.Text;

                                thucthi.suahdb(ck);
                                MessageBox.Show("Đã Sửa Thành Công Thành Công", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                fr_CTHDB fr = new fr_CTHDB();
                                fr.SOHDB = txtma.Text;
                                this.Close();
                                fr.Show();
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.ToString(), "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                        txtma.Enabled = true;
                        locktext();
                        hienthi();
                    }
                    else
                    {
                        MessageBox.Show("Mã Không được để trống", "Chú Ý", MessageBoxButtons.OK);
                        cbncc.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("Mã Không được để trống", "Chú Ý", MessageBoxButtons.OK);
                    cbnv.Focus();
                }
            }
            else
            {
                MessageBox.Show("Mã Không được để trống", "Chú Ý", MessageBoxButtons.OK);
                txtma.Focus();
            }
        }