Example #1
0
        private void msds_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e)
        {
            fr_CTHDN fr = new fr_CTHDN();

            fr.SOHDN = txtma.Text;
            this.Close();
            fr.Show();
        }
Example #2
0
        private void btluu_Click(object sender, EventArgs e)
        {
            if (txtma.Text != "")
            {
                if (cbnv.Text != "")
                {
                    if (cbncc.Text != "")
                    {
                        if (themmoi == true)
                        {
                            try
                            {
                                ck.SOHDN    = txtma.Text;
                                ck.MANV     = cbnv.Text;
                                ck.NGAYNHAN = txtngay.Text;
                                ck.MANCC    = cbncc.Text;
                                ck.TONGTIEN = txttt.Text;

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

                                thucthi.suahdn(ck);
                                MessageBox.Show("Đã Sửa Thành Công Thành Công", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                fr_CTHDN fr = new fr_CTHDN();
                                fr.SOHDN = txtma.Text;
                                this.Hide();
                                fr.ShowDialog();
                            }
                            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();
            }
        }