Sitelet https://github.com/itangiang/QuanLyTaiSan/commit/cc37aa83c71f76c47784ca7d2d910da9ba3dd8d7
Skip to content

Commit cc37aa8

Browse files
committed
fix data report
1 parent c7675e7 commit cc37aa8

8 files changed

Lines changed: 247 additions & 101 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace TSCD.DataFilter.ReportFilter
7+
{
8+
public class SoTaiSanCoDinh_DataFilter
9+
{
10+
public DateTime? ngay { get; set; }
11+
public String sohieu_ct { get; set; }
12+
public String ten { get; set; }
13+
public String nuocsx { get; set; }
14+
public long dongia_tang { get; set; }
15+
public String sohieu_ct_tang { get; set; }
16+
public DateTime? ngay_ct_tang { get; set; }
17+
public String sohieu_ct_giam { get; set; }
18+
public DateTime? ngay_ct_giam { get; set; }
19+
public String ghichu { get; set; }
20+
public Double phantramhaomon_32 { get; set; }
21+
public long sotientrongmotnam { get; set; }
22+
public long haomon_1nam { get; set; }
23+
public long giatriconlai_final { get; set; }
24+
public long haomonluyke { get; set; }
25+
public long haomonnamtruocchuyensang { get; set; }
26+
}
27+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace TSCD.DataFilter.ReportFilter
7+
{
8+
public class SoTheoDoiTaiSanCoDinhTaiNoiSuDung_DataFilter
9+
{
10+
public String sohieu_ct { get; set; }
11+
public DateTime? ngay_ct { get; set; }
12+
public String ten { get; set; }
13+
public String donvitinh { get; set; }
14+
public int? soluong_tang { get; set; }
15+
public long? dongia_tang { get; set; }
16+
public long? thanhtien_tang { get; set; }
17+
public int? soluong_giam { get; set; }
18+
public long? dongia_giam { get; set; }
19+
public long? thanhtien_giam { get; set; }
20+
public String ghichu { get; set; }
21+
}
22+
}

‎TSCD/Entities/DonVi.cs‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public DonVi()
6060
/// </summary>
6161
public virtual ICollection<CTTaiSan> cttaisan_dangsudungs { get; set; }
6262

63-
63+
6464
public virtual ICollection<LogTangGiamTaiSan> logtaisan_dangquanlys { get; set; }
6565
public virtual ICollection<LogTangGiamTaiSan> logtaisan_dangsudungs { get; set; }
6666
#endregion
@@ -84,16 +84,22 @@ public List<CTTaiSan> cttaisans
8484
/// <returns></returns>
8585
public IQueryable<CTTaiSan> getAllCTTaiSanRecursive()
8686
{
87-
List<Guid> tmp = this.getAllChildsRecursive(true).Select(c=>c.id).ToList();
87+
List<Guid> tmp = this.getAllChildsRecursive(true).Select(c => c.id).ToList();
8888
return CTTaiSan.getQuery().Where(c => c.soluong > 0 && ((c.donviquanly != null && tmp.Contains(c.donviquanly.id)) || (c.donvisudung != null && tmp.Contains(c.donvisudung.id))));
8989
}
90+
91+
public IQueryable<CTTaiSan> getAllCTTaiSanRecursive_All(Boolean included_root_in_result = true)
92+
{
93+
List<Guid> tmp = this.getAllChildsRecursive(true).Select(c => c.id).ToList();
94+
return CTTaiSan.getQuery().Where(c => ((c.donviquanly != null && tmp.Contains(c.donviquanly.id)) || (c.donvisudung != null && tmp.Contains(c.donvisudung.id))));
95+
}
9096
/// <summary>
9197
/// Lấy tất cả đám con cháu Đơn vị dưới root
9298
/// </summary>
9399
/// <param name="root"></param>
94100
/// <param name="included_root_in_result"></param>
95101
/// <returns></returns>
96-
public List<DonVi> getAllChildsRecursive(Boolean included_root_in_result=true)
102+
public List<DonVi> getAllChildsRecursive(Boolean included_root_in_result = true)
97103
{
98104
List<DonVi> tmp = new List<DonVi>();
99105
if (included_root_in_result)
@@ -121,7 +127,7 @@ public List<DonVi> getAllChildsRecursive(Boolean included_root_in_result=true)
121127
}
122128
public override string niceName()
123129
{
124-
130+
125131
return loaidonvi.ten + ": " + ten;
126132
}
127133
protected override void init()

‎TSCD/TSCD.csproj‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
<Reference Include="System.Xml" />
9393
</ItemGroup>
9494
<ItemGroup>
95+
<Compile Include="DataFilter\ReportFilter\SoTaiSanCoDinh_DataFilter.cs" />
96+
<Compile Include="DataFilter\ReportFilter\SoTheoDoiTaiSanCoDinhTaiNoiSuDung_DataFilter.cs" />
9597
<Compile Include="DataFilter\SearchFilter\CoSoSF.cs" />
9698
<Compile Include="DataFilter\SearchFilter\DayySF.cs" />
9799
<Compile Include="DataFilter\SearchFilter\DonViTaiSanFS.cs" />

‎TSCD_GUI/ReportTSCD/XtraReport_SoChiTietTaiSanCoDinh.cs‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,23 @@ public XtraReport_SoChiTietTaiSanCoDinh()
1919
public XtraReport_SoChiTietTaiSanCoDinh(Object Data, int Year, String TenDonVi)
2020
{
2121
InitializeComponent();
22-
this.DataSource = Data;
23-
xrLabel_Nam.Text = "Năm " + Year.ToString();
24-
xrLabel_PhongBan.Text = "Phòng ban: " + TenDonVi;
25-
IntReport();
22+
if (!Object.Equals(Data, null))
23+
{
24+
this.DataSource = Data;
25+
xrLabel_Nam.Text = "Năm " + Year.ToString();
26+
xrLabel_PhongBan.Text = "Phòng ban: " + TenDonVi;
27+
IntReport();
28+
}
2629
}
2730

2831
public XtraReport_SoChiTietTaiSanCoDinh(Object Data)
2932
{
3033
InitializeComponent();
31-
this.DataSource = Data;
32-
IntReport();
34+
if (!Object.Equals(Data, null))
35+
{
36+
this.DataSource = Data;
37+
IntReport();
38+
}
3339
}
3440

3541
private void IntReport()

‎TSCD_GUI/ReportTSCD/XtraReport_SoTheoDoiTSCDTaiNoiSuDung.cs‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,22 @@ public XtraReport_SoTheoDoiTSCDTaiNoiSuDung()
2020
public XtraReport_SoTheoDoiTSCDTaiNoiSuDung(Object Data, String strTenDonVi)
2121
{
2222
InitializeComponent();
23-
this.DataSource = Data;
24-
xrLabel_PhongBan.Text = "Phòng ban: " + strTenDonVi;
25-
IntReport();
23+
if (!Object.Equals(Data, null))
24+
{
25+
this.DataSource = Data;
26+
xrLabel_PhongBan.Text = "Phòng ban: " + strTenDonVi;
27+
IntReport();
28+
}
2629
}
2730

2831
public XtraReport_SoTheoDoiTSCDTaiNoiSuDung(Object Data)
2932
{
3033
InitializeComponent();
31-
this.DataSource = Data;
32-
IntReport();
34+
if (!Object.Equals(Data, null))
35+
{
36+
this.DataSource = Data;
37+
IntReport();
38+
}
3339
}
3440

3541
private void IntReport()

‎TSCD_GUI/ReportTSCD/frmReport.Designer.cs‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)