private void btnLuuHachToan_Click(object sender, EventArgs e)
        {
            if (this.chungTuDTNSNNBindingSource.Current != null)
            {
                this.ValidateDuToanNSNNFields();

                if (!this.IsNSNNValidatingError)
                {
                    btnLuuHachToan.Enabled = false;

                    DTNSNN.NSNNRow currentRow = ((chungTuDTNSNNBindingSource.Current as DataRowView).Row as DuToanNSNN.DTNSNN.NSNNRow);

                    if (currentRow != null)
                    {
                        if (chiTietDuToanNSNNBindingSource.Current != null)
                        {
                            DuToanNSNN.DTNSNN.HachToanRow hachToanRow = ((chiTietDuToanNSNNBindingSource.Current as DataRowView).Row as DuToanNSNN.DTNSNN.HachToanRow);
                            if (hachToanRow != null)
                            {
                                hachToanRow.nsnnId = currentRow.uid;
                            }
                        }

                        if (currentRow.ladulieucuoinam)
                        {
                            currentRow.ngayhachtoan = new DateTime((int)txtNgay32Year.Value, 12, 31);
                        }
                    }

                    this.CapNhatDuToanNSNN();

                    btnLuuHachToan.Enabled = true;
                }
            }
        }
Beispiel #2
0
        private void btnChiTietDTNSNN_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            xtraTabControl1.SelectedTabPageIndex = 1;

            DTNSNN.NSNNRow currentRow = ((chungTuDTNSNNBindingSource.Current as DataRowView).Row as DuToanNSNN.DTNSNN.NSNNRow);
            chkNgay32.Checked   = currentRow.ladulieucuoinam;
            txtNgay32Year.Value = currentRow.ngayhachtoan.Year;
            currentRow.BeginEdit();

            chiTietDuToanNSNNBindingSource.Filter = "nsnnId = " + currentRow.uid;
        }
        private void cnavHachToan_ButtonClick(object sender, NavigatorButtonClickEventArgs e)
        {
            if (e.Button.ButtonType == NavigatorButtonType.Append)
            {
                DTNSNN.NSNNRow currentRow = ((chungTuDTNSNNBindingSource.Current as DataRowView).Row as DuToanNSNN.DTNSNN.NSNNRow);

                if (currentRow != null)
                {
                    if (chiTietDuToanNSNNBindingSource.Current != null)
                    {
                        DuToanNSNN.DTNSNN.HachToanRow hachToanRow = ((chiTietDuToanNSNNBindingSource.Current as DataRowView).Row as DuToanNSNN.DTNSNN.HachToanRow);
                        if (hachToanRow != null)
                        {
                            hachToanRow.nsnnId = currentRow.uid;
                        }
                    }
                }
            }
        }