public ActionResult listphieuthu(int id) { if (Request.IsAjaxRequest()) { var model = PhieuChiService.GetAll(id); return(PartialView(model)); } return(View()); }
public ActionResult CreatePhieuthu(phieuchi pt) { if (Request.IsAjaxRequest()) { var rq = PhieuChiService.insert(pt); return(Json(rq, JsonRequestBehavior.AllowGet)); } return(View()); }
private void updatePhieuChi() { DateTime ngay = this.dateNgay.DateTime; string maPhieu = this.txtMaPhieu.Text; string ghiChu = this.txtGhiChu.Text; int phanLoaiChiId = (int)this.cmbPhanLoaiChi.EditValue; string noiDung = txtNoiDung.Text; double soLuong = (double)txtSoLuong.Value; double donGia = (double)txtDonGia.Value; long soTien = (long)this.txtSoTien.Value; PhieuChiService phieuChiService = new PhieuChiService(); phieuChiService.UpdatePhieuChi(this.phieuChiTableAdapter, this.PhieuChiRow, ngay, soTien, maPhieu, ghiChu, phanLoaiChiId, noiDung, soLuong, donGia); }
private void luuPhieuChi() { if (this.IsEditing) { this.updatePhieuChi(); } else { this.insertPhieuChi(); } if (this.GridView != null) { BindingSource phieuChiBindingSource = this.GridView.GridControl.DataSource as BindingSource; PhieuChiService phieuChiService = new PhieuChiService(); phieuChiBindingSource.DataSource = phieuChiService.LoadPhieuChi(this.phieuChiTableAdapter); } }
private void addPhieuChiToReport(SortedList soQuyTienMatMap, DateTime fromDate, DateTime toDate, List <int> phanLoaiChiIds) { PhieuChiService phieuChiService = new PhieuChiService(); QLMamNon.Dao.QLMamNonDs.PhieuChiDataTable phieuChiDataTable = phieuChiService.LoadPhieuChiByDateRange(fromDate, toDate, phanLoaiChiIds); foreach (QLMamNon.Dao.QLMamNonDs.PhieuChiRow phieuChiRow in phieuChiDataTable) { SoQuyTienMatItem soQuyTienMatItemChi = new SoQuyTienMatItem() { DienGiai = phieuChiRow.NoiDung, GhiChu = phieuChiRow.GhiChu, NgayChungTu = phieuChiRow.Ngay.AddMilliseconds(soQuyTienMatMap.Count), SoChungTuChi = phieuChiRow.MaPhieu, SoTienChi = phieuChiRow.SoTien }; soQuyTienMatMap.Add(soQuyTienMatItemChi.NgayChungTu, soQuyTienMatItemChi); } }
private void loadPhieuChi() { PhieuChiService phieuChiService = new PhieuChiService(); this.phieuChiRowBindingSource.DataSource = phieuChiService.LoadPhieuChi(this.phieuChiTableAdapter); }
private void btnXemBaoCao_Click(object sender, EventArgs e) { if (this.dateTuNgay.DateTime == null || this.dateDenNgay.DateTime == null) { MessageBox.Show("Xin vui lòng chọn ngày", "Chọn ngày", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } List <int> phanLoaiThuIds = new List <int>(); int[] selectedThuRowHandlers = this.gvThu.GetSelectedRows(); if (ArrayUtil.IsEmpty(selectedThuRowHandlers)) { MessageBox.Show("Xin vui lòng chọn Phân loại thu", "Chọn Phân loại thu", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (int rowHandler in selectedThuRowHandlers) { int phanLoaiThuId = (int)this.gvThu.GetRowCellValue(rowHandler, "PhanLoaiThuId"); phanLoaiThuIds.Add(phanLoaiThuId); } List <int> phanLoaiChiIds = new List <int>(); int[] selectedRowHandlers = this.gvMain.GetSelectedRows(); if (ArrayUtil.IsEmpty(selectedRowHandlers)) { MessageBox.Show("Xin vui lòng chọn Mã loại chi", "Chọn Mã loại chi", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (chkTon.Checked && StringUtil.IsEmpty(txtTon.Text)) { MessageBox.Show("Xin vui lòng nhập số tiền tồn tháng trước", "Nhập số tiền tồn tháng trước", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (int rowHandler in selectedRowHandlers) { int phanLoaiChiId = (int)this.gvMain.GetRowCellValue(rowHandler, "PhanLoaiChiId"); phanLoaiChiIds.Add(phanLoaiChiId); } DateTime fromDate = DateTimeUtil.StartOfDate(this.dateTuNgay.DateTime); DateTime toDate = DateTimeUtil.EndOfDate(this.dateDenNgay.DateTime); UnknownColumnViewTableAdapter unknownColumnViewTableAdapter = (UnknownColumnViewTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterUnknownColumnView); RptTinhHinhThuChi rpt = new RptTinhHinhThuChi(); rpt.TuNgay.Value = fromDate; rpt.DenNgay.Value = toDate; rpt.TongThu.Value = unknownColumnViewTableAdapter.GetSumSoTienThuByDateRange(fromDate, toDate, StringUtil.JoinWithCommas(phanLoaiThuIds)); rpt.TongChi.Value = unknownColumnViewTableAdapter.GetSumSoTienChiByDateRange(fromDate, toDate, StringUtil.JoinWithCommas(phanLoaiChiIds)); rpt.Ton.Value = findSoTienTonDauKy(toDate); rpt.ChenhLech.Value = (decimal)rpt.Ton.Value + (decimal)rpt.TongThu.Value - (decimal)rpt.TongChi.Value; PhieuThuService phieuThuService = new PhieuThuService(); rpt.thuDataSource.DataSource = phieuThuService.LoadPhieuThuByDateRangeWithGroupPhanLoaiThu(fromDate, toDate, phanLoaiThuIds); PhieuChiService phieuChiService = new PhieuChiService(); rpt.chiDataSource.DataSource = phieuChiService.LoadPhieuChiByDateRangeWithGroupPhanLoaiChi(fromDate, toDate, phanLoaiChiIds); FormMainFacade.ShowReport(rpt); }