20230531 脚本、版本日志整理

This commit is contained in:
2023-05-31 10:18:16 +08:00
parent 3092ce4b48
commit f105770a47
18 changed files with 448 additions and 1158 deletions
@@ -59,7 +59,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
bf.DataField = "CostTypeName";
bf.DataFormatString = "{0}";
bf.HeaderText = "分项名称";
bf.Width = 120;
bf.Width = 150;
bf.HeaderTextAlign = TextAlign.Center;
Grid1.Columns.Add(bf);
@@ -87,7 +87,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
bf.DataField = item.UnitId;
bf.DataFormatString = "{0}";
bf.HeaderText = item.UnitName;
bf.Width = 200;
bf.Width = 220;
Grid1.Columns.Add(bf);
}
@@ -100,6 +100,10 @@ namespace FineUIPro.Web.HSSE.CostGoods
Grid1.Columns.Add(bf);
Grid1.DataKeyNames = new string[] { "Id", "CostTypeName" };
if (Grid1.Columns.Count() > 9)
{
Grid1.ForceFit = false;
}
}
#endregion
@@ -163,45 +167,49 @@ namespace FineUIPro.Web.HSSE.CostGoods
where y.ProjectId == this.ProjectId && y.Year == year
orderby y.Year, x.SupSortIndex, x.SortIndex
select new { x.ExpenseDetailId, x.ExpenseId,y.UnitId, y.Year, x.SupCostTypeId, x.SupCostTypeName, x.SupSortIndex, x.CostType, x.CostTypeName, x.SortIndex, x.CostMoney };
foreach (var item in getDetail)
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
foreach (var item in getType)
{
DataRow row = table.NewRow();
row[0] = item.ExpenseDetailId +"#" +item.ExpenseId;
row[1] = item.SupCostTypeName;
row[2] = item.CostTypeName;
int r = 3;
foreach (var uitem in getUnit)
var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType);
if (getD != null)
{
var getD1 = getDetail.Where(x => x.UnitId == uitem.UnitId && x.CostType == item.CostType);
if (getD1.Count() > 0)
DataRow row = table.NewRow();
row[0] = getD.ExpenseDetailId + "#" + getD.ExpenseId;
row[1] = getD.SupCostTypeName;
row[2] = getD.CostTypeName;
int r = 3;
foreach (var uitem in getUnit)
{
row[r] = getD1.Sum(X => X.CostMoney ?? 0).ToString();
}
else
{
row[r] = 0.00;
var getD1 = getDetail.Where(x => x.UnitId == uitem.UnitId && x.CostType == item.CostType);
if (getD1.Count() > 0)
{
row[r] = getD1.Sum(X => X.CostMoney ?? 0).ToString();
}
else
{
row[r] = 0.00;
}
r++;
}
r++;
foreach (var suitem in getSUnit)
{
var getD2 = getDetail.Where(x => x.UnitId == suitem.UnitId && x.CostType == item.CostType);
if (getD2.Count() > 0)
{
row[r] = getD2.Sum(X => X.CostMoney ?? 0).ToString();
}
else
{
row[r] = 0.00;
}
r++;
}
row[r] = getDetail.Where(x => x.Year == getD.Year && x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
table.Rows.Add(row);
}
foreach (var suitem in getSUnit)
{
var getD2 = getDetail.Where(x => x.UnitId == suitem.UnitId && x.CostType == item.CostType);
if (getD2.Count() > 0)
{
row[r] = getD2.Sum(X => X.CostMoney ?? 0).ToString();
}
else
{
row[r] = 0.00;
}
r++;
}
row[r] = getDetail.Where(x =>x.Year==item.Year && x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
table.Rows.Add(row);
}
}
else
@@ -212,44 +220,49 @@ namespace FineUIPro.Web.HSSE.CostGoods
orderby y.Year, x.SupSortIndex, x.SortIndex
select new { x.ExpenseDetailId, x.ExpenseId,y.UnitId, y.Year, x.SupCostTypeId, x.SupCostTypeName, x.SupSortIndex, x.CostType, x.CostTypeName, x.SortIndex, x.CostMoney };
foreach (var item in getDetail)
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
foreach (var item in getType)
{
DataRow row = table.NewRow();
row[0] = item.ExpenseDetailId + "#" + item.ExpenseId;
row[1] = item.SupCostTypeName;
row[2] = item.CostTypeName;
int r = 3;
foreach (var uitem in getUnit)
var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType);
if (getD != null)
{
var getD1 = getDetail.Where(x => x.UnitId == uitem.UnitId && x.CostType == item.CostType);
if (getD1.Count() > 0)
DataRow row = table.NewRow();
row[0] = getD.ExpenseDetailId + "#" + getD.ExpenseId;
row[1] = getD.SupCostTypeName;
row[2] = getD.CostTypeName;
int r = 3;
foreach (var uitem in getUnit)
{
row[r] = getD1.Sum(X=>X.CostMoney ?? 0).ToString();
}
else
{
row[r] = 0.00;
}
r++;
}
var getD1 = getDetail.Where(x => x.UnitId == uitem.UnitId && x.CostType == item.CostType);
if (getD1.Count() > 0)
{
row[r] = getD1.Sum(X => X.CostMoney ?? 0).ToString();
}
else
{
row[r] = 0.00;
}
foreach (var suitem in getSUnit)
{
var getD2 = getDetail.Where(x => x.UnitId == suitem.UnitId && x.CostType == item.CostType);
if (getD2.Count() > 0)
{
row[r] = getD2.Sum(X => X.CostMoney ?? 0).ToString();
r++;
}
else
{
row[r] = 0.00;
}
r++;
}
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
table.Rows.Add(row);
foreach (var suitem in getSUnit)
{
var getD2 = getDetail.Where(x => x.UnitId == suitem.UnitId && x.CostType == item.CostType);
if (getD2.Count() > 0)
{
row[r] = getD2.Sum(X => X.CostMoney ?? 0).ToString();
}
else
{
row[r] = 0.00;
}
r++;
}
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
table.Rows.Add(row);
}
}
}
@@ -271,7 +284,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = this.Grid1.RecordCount;
Response.Write(GetTableHtml(GetDataTable()));
Response.Write(GetGridTableHtml(this.Grid1));
Response.End();
}
#endregion