Example #1
0
        private void LuuTienTCS(object sender, ItemClickEventArgs e)
        {
            if (this.isTienTCSTab() && this.tientcsBindingSource.Current != null)
            {
                if (this.ValidateTienTCSFields())
                {
                    QLThuChi.Dao.ThuChi.tientcsRow row = (QLThuChi.Dao.ThuChi.tientcsRow)((DataRowView)this.tientcsBindingSource.Current).Row;

                    this.tientcsBindingSource.EndEdit();
                    this.thuChi.tientcs.GetChanges();
                    this.tientcsTableAdapter.Update(this.thuChi.tientcs);
                    this.thuChi.tientcs.AcceptChanges();

                    this.iTienTCSXoa.Enabled = true;
                    this.gcTienTCS.Enabled   = true;
                }
            }
            else if (this.tientcsBindingSource.Current == null)
            {
                var confirmResult = MessageBox.Show("Không có dữ liệu TCS nào trong danh sách hiện tại. Bạn có tạo một TCS mới không ?", "Confirm",
                                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (confirmResult == DialogResult.Yes)
                {
                    this.iTienTCSThem_ItemClick(sender, e);
                }
            }
        }
Example #2
0
        private void ThemTienTCS()
        {
            if (this.isTienTCSTab() && !this.IsCurrentTienTCSAddingNew)
            {
                DataRowView rowView = (DataRowView)this.tientcsBindingSource.AddNew();
                QLThuChi.Dao.ThuChi.tientcsRow row = rowView.Row as QLThuChi.Dao.ThuChi.tientcsRow;
                row.Ngay    = DateTime.Today;
                row.ThuPhat = 0;
                row.ThuTCS  = 0;

                this.iTienTCSXoa.Enabled = false;
                this.gcTienTCS.Enabled   = false;
            }
        }
Example #3
0
        private void fillReportUser(RptCTTM rpt)
        {
            this.calulateSoDuBanDau(rpt);

            this.tientcsTableAdapter.FillByNgay(this.thuChi.tientcs, this.txtNgay.DateTime);

            if (this.thuChi.tientcs.Rows.Count > 0)
            {
                QLThuChi.Dao.ThuChi.tientcsRow row = this.thuChi.tientcs[0];
                rpt.TienTCS.Value = row.ThuPhat + row.ThuTCS;
            }
            else
            {
                rpt.TienTCS.Value = 0;
            }

            rpt.Ngay.Value   = txtNgay.DateTime;
            rpt.lblNgay.Text = string.Format("Ngày {0} tháng {1} năm {2}", txtNgay.DateTime.Day, txtNgay.DateTime.Month, txtNgay.DateTime.Year);
        }