Beispiel #1
0
        private void iPTLuu_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (this.isPhieuThuTab() && this.phieuthuBindingSource.Current != null)
            {
                if (this.ValidatePhieuThuFields())
                {
                    this.txtPTHoTen.Focus();
                    QLCMND.CMND.phieuthuRow row = (QLCMND.CMND.phieuthuRow)((DataRowView)this.phieuthuBindingSource.Current).Row;

                    if (row.IscreateddateNull())
                    {
                        row.createddate = DateTime.Now;
                        row.ngaylap     = DateTime.Now;
                    }

                    this.IsPTAddingNew = false;
                    this.phieuthuBindingSource.EndEdit();
                    this.cMND.phieuthu.GetChanges();
                    this.phieuthuTableAdapter.Update(this.cMND.phieuthu);
                    this.cMND.phieuthu.AcceptChanges();
                }
            }
            else if (this.phieuthuBindingSource.Current == null)
            {
                var confirmResult = MessageBox.Show("Không có Phiếu thu nào trong danh sách hiện tại. Bạn có tạo một Phiếu thu mới không ??", "Confirm",
                                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (confirmResult == DialogResult.Yes)
                {
                    this.iPTThem_ItemClick(sender, e);
                }
            }
        }
Beispiel #2
0
        private void phieuthuBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            if (this.isPhieuThuTab() && this.IsProcessChangingCurrentPTRow && this.phieuthuBindingSource.Current != null && !(this.phieuthuBindingSource.Current as DataRowView).IsNew)
            {
                QLCMND.CMND.phieuthuRow row = (QLCMND.CMND.phieuthuRow)((DataRowView)this.phieuthuBindingSource.Current).Row;

                if (!row.IsngaylapNull())
                {
                    this.lblPTNgayLap.Text = string.Format("Ngày {0} tháng {1} năm {2}", row.ngaylap.Day, row.ngaylap.Month, row.ngaylap.Year);
                }

                this.HuyPT();
            }
        }
Beispiel #3
0
        private void fillReportPhieuThu(RptPhieuThu rpt)
        {
            QLCMND.CMND.phieuthuRow row = (QLCMND.CMND.phieuthuRow)((DataRowView)this.phieuthuBindingSource.Current).Row;
            rpt.lblHoTen.Text = row.hoten.ToUpper();

            if (!row.IsdiachiNull())
            {
                rpt.lblDiaChi.Text = row.diachi;
            }
            else
            {
                rpt.lblDiaChi.Text = "";
            }

            if (!row.IslydoNull())
            {
                rpt.lblLyDo.Text = row.lydo;
            }
            else
            {
                rpt.lblLyDo.Text = "";
            }

            if (!row.IschungtugocNull())
            {
                rpt.lblChungTuGoc.Text = row.chungtugoc;
            }
            else
            {
                rpt.lblChungTuGoc.Text = "";
            }

            if (!row.IskemtheoNull())
            {
                rpt.lblKemTheo.Text = row.kemtheo;
            }
            else
            {
                rpt.lblKemTheo.Text = "";
            }

            rpt.lblSoTien.Text    = string.Format("{0:n0}, đồng", row.sotien);
            rpt.lblSoTienChu.Text = "                                    " + VNCurrency.ToString((double)row.sotien);

            if (!row.IsngaylapNull())
            {
                rpt.lblNgayLap.Text = string.Format("Ngày {0} tháng {1} năm {2}", row.ngaylap.Day, row.ngaylap.Month, row.ngaylap.Year);
            }
            else
            {
                rpt.lblNgayLap.Text = "";
            }

            if (!row.IscotkNull())
            {
                rpt.lblCoTK.Text = row.cotk;
            }
            else
            {
                rpt.lblCoTK.Text = "";
            }
        }