예제 #1
0
        private void frmChiTietKiemKe_Load(object sender, EventArgs e)
        {
            var dt = PhieuNhapService.LoadDataTable();

            //dt.Columns.Add("Status");
            grcPhieuNhap.DataSource = dt;
        }
예제 #2
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            string key = null;
            Nullable <DateTime> dateStart = null, dateEnd = null;

            if (cedKey.Checked == true)
            {
                if (sctKey.Text != "")
                {
                    key = sctKey.Text;
                }
            }
            if (cedDate.Checked == true)
            {
                if (dedDateStart.Text != "")
                {
                    dateStart = dedDateStart.DateTime.Date;
                }
                if (dedDateEnd.Text != "")
                {
                    dateEnd = dedDateEnd.DateTime.Date;
                }
            }
            if (key == null && dateStart == null && dateEnd == null)
            {
                grcPhieuNhap.DataSource = PhieuNhapService.LoadDataTable();
            }
            else
            {
                grcPhieuNhap.DataSource = PhieuNhapService.Search(key, dateStart, dateEnd);
            }
        }
예제 #3
0
        private void Reload(object sender, FormClosingEventArgs e)
        {
            frmPhieuNhapThemSua f = (frmPhieuNhapThemSua)sender;

            if (f.isDataChanged == true)
            {
                grcPhieuNhap.DataSource = PhieuNhapService.LoadDataTable();
            }
        }
예제 #4
0
        private void btnHuyPhieu_Click(object sender, EventArgs e)
        {
            string soPhieu = grvPhieuNhap.GetRowCellValue(grvPhieuNhap.FocusedRowHandle, "SoPhieuNhap").ToString();

            if (MessageBox.Show("Hủy phiếu nhập " + soPhieu + " ?", "Xác Nhận", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (ChiTietPhieuNhapService.Delete(soPhieu))
                {
                    if (PhieuNhapService.Delete(soPhieu))
                    {
                        grcPhieuNhap.DataSource = PhieuNhapService.LoadDataTable();
                        MessageBox.Show("Hủy phiếu thành công!");
                    }
                    else
                    {
                        MessageBox.Show("Không thể hủy phiếu!");
                    }
                }
                else
                {
                    MessageBox.Show("Không thể hủy chi tiết phiếu!");
                }
            }
        }
예제 #5
0
 private void frmPhieuNhap_Load(object sender, EventArgs e)
 {
     grcPhieuNhap.DataSource = PhieuNhapService.LoadDataTable();
 }