提交代码

This commit is contained in:
高飞 2024-10-30 17:15:30 +08:00
parent a2afd22163
commit 254c7ac7c0
24 changed files with 1527 additions and 828 deletions

View File

@ -0,0 +1,42 @@
alter table Environmental_OperationReport drop column Code
alter table Environmental_OperationReport drop column UnitLevel
alter table Environmental_OperationReport drop column CreateDate
alter table Environmental_OperationReport drop column Place
alter table Environmental_OperationReport drop column PersonNum
alter table Environmental_OperationReport drop column TotalAssets
alter table Environmental_OperationReport drop column TotalValue
alter table Environmental_OperationReport drop column NewInvestment
GO
CREATE TABLE [dbo].[Environmental_OperationReportItem](
[BusinessReportItemId] [nvarchar](50) NOT NULL,
[BusinessReportId] [nvarchar](50) NULL,
[SortIndex] [int] NULL,
[Code] [nvarchar](50) NULL,
[UnitLevel] [nvarchar](50) NULL,
[CreateDate] [datetime] NULL,
[Place] [nvarchar](200) NULL,
[PersonNum] [int] NULL,
[TotalAssets] [decimal](18, 4) NULL,
[TotalValue] [decimal](18, 4) NULL,
[NewInvestment] [decimal](18, 4) NULL,
[UnitName] [nvarchar](200) NULL,
[SortUnitName] [nvarchar](200) NULL,
CONSTRAINT [PK_Environmental_OperationReportItem] PRIMARY KEY CLUSTERED
(
[BusinessReportItemId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Environmental_OperationReportItem] WITH CHECK ADD CONSTRAINT [FK_Environmental_OperationReportItem_Environmental_OperationReport] FOREIGN KEY([BusinessReportId])
REFERENCES [dbo].[Environmental_OperationReport] ([BusinessReportId])
GO
ALTER TABLE [dbo].[Environmental_OperationReportItem] CHECK CONSTRAINT [FK_Environmental_OperationReportItem_Environmental_OperationReport]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'中央企业节能环保产业企业基本情况和经营情况报表明细表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReportItem'
GO
update sys_menu set IsUsed=0 where menuid='EFA6E45F-1267-4804-BEE7-41E0C5461204';

View File

@ -0,0 +1,6 @@
--
alter table Environmental_EnergyReportItem
add SortUnit int NULL;
GO
update Environmental_EnergyReportItem set SortUnit=1 where EnergyReportId='template';
GO

View File

@ -889,183 +889,6 @@
}
#endregion
#region
public static string UpOperationReport(string businessReportId, Model.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
var upReport = from x in db.Environmental_OperationReport
where x.BusinessReportId == businessReportId
select new Model.OperationReportDto
{
BusinessReportId = x.BusinessReportId,
UnitId = x.UnitId,
Year = x.Year,
Quarters = x.Quarters,
Code = x.Code,
UnitLevel = x.UnitLevel,
CreateDate = x.CreateDate,
Place = x.Place,
PersonNum = x.PersonNum,
TotalAssets = x.TotalAssets,
TotalValue = x.TotalValue,
NewInvestment = x.NewInvestment,
FillingMan = x.FillingMan,
FillingDate = x.FillingDate,
StatisticsDutyPerson = x.StatisticsDutyPerson,
UnitDutyPerson = x.UnitDutyPerson,
Remark = x.Remark
};
//新接口Api
code = UpApiOperationReport(upReport).ToString();
if (code == "1")
{
var report = db.Environmental_OperationReport.FirstOrDefault(e => e.BusinessReportId == businessReportId);
if (report != null)
{
report.UpState = BLL.Const.UpState_3;
db.SubmitChanges();
}
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
else
{
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
private static int UpApiOperationReport(IQueryable<Model.OperationReportDto> upReport)
{
string baseurl = "/api/InformationData/SaveOperationReport";
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
#region
/// <summary>
/// 中央企业节能环保产业企业生产和服务业务情况报表上报
/// </summary>
public static string UpEnergyReport(string energyReportId, Model.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
var upReport = from x in db.Environmental_EnergyReport
where x.EnergyReportId == energyReportId
select new Model.EnergyReport
{
EnergyReportId = x.EnergyReportId,
UnitId = x.UnitId,
Year = x.Year,
Quarters = x.Quarters,
FillingMan = x.FillingMan,
FillingDate = x.FillingDate,
DutyPerson = x.DutyPerson,
};
var upReportItem = from x in db.Environmental_EnergyReportItem
where x.EnergyReportId == energyReportId
select new Model.EnergyReportItem
{
EnergyReportItemId = x.EnergyReportItemId,
EnergyReportId = x.EnergyReportId,
SortIndex = x.SortIndex,
BusinessCategory = x.BusinessCategory,
Throughput_BasePeriod = x.Throughput_BasePeriod,
Throughput_LastPeriod = x.Throughput_LastPeriod,
Throughput_ThisPeriod = x.Throughput_ThisPeriod,
Throughput_UnitOfMeasurement = x.Throughput_UnitOfMeasurement,
Yield_BasePeriod = x.Yield_BasePeriod,
Yield_LastPeriod = x.Yield_LastPeriod,
Yield_ThisPeriod = x.Yield_ThisPeriod,
Yield_UnitOfMeasurement = x.Yield_UnitOfMeasurement,
OutputValue_BasePeriod = x.OutputValue_BasePeriod,
OutputValue_LastYear = x.OutputValue_LastYear,
OutputValue_ThisYear = x.OutputValue_ThisYear,
OperationScale_BasePeriod = x.OperationScale_BasePeriod,
OperationScale_LastYear = x.OperationScale_LastYear,
OperationScale_ThisYear = x.OperationScale_ThisYear,
OperationScale_UnitOfMeasurement = x.OperationScale_UnitOfMeasurement,
ServiceOperatingIncome_BasePeriod = x.ServiceOperatingIncome_BasePeriod,
ServiceOperatingIncome_LastYear = x.ServiceOperatingIncome_LastYear,
ServiceOperatingIncome_ThisYear = x.ServiceOperatingIncome_ThisYear,
};
//老接口Serveice
//var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList());
//新接口Api
code = UpApiEnergyReport(upReport, upReportItem).ToString();
if (code == "1")
{
foreach (var item in upReport.Select(p => p.EnergyReportId))
{
var report = db.Environmental_EnergyReport.FirstOrDefault(e => e.EnergyReportId == item);
if (report != null)
{
report.UpState = BLL.Const.UpState_3;
db.SubmitChanges();
////更新 当前人要处理的意见
//ProjectDataFlowSetService.CloseFlowOperate(Const.ChemicalReportMenuId, item, string.Empty);
// //更新催报信息
//UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Quarters.ToString());
}
}
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
else
{
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
/// <summary>
/// UpApiChemicalReportApi调用
/// </summary>
/// <param name="upReport">主表</param>
/// <param name="upReportItem">明细表</param>
/// <returns></returns>
private static int UpApiEnergyReport(IQueryable<Model.EnergyReport> upReport, IQueryable<Model.EnergyReportItem> upReportItem)
{
string baseurl = "/api/InformationData/SaveEnergyReport";
//合并
//var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem });
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var resultJsonReportItem = JsonConvert.SerializeObject(new { EnergyReportItem = upReportItem });
resultJsonReport = "{\"InformationDataItems\":[" + (resultJsonReport + resultJsonReportItem).Replace("}{", ",") + "]}";
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
#region
/// <summary>
/// 建筑行业能源节约与生态环境保护汇总表上报
@ -1158,8 +981,209 @@
}
#endregion
#region
private static List<Model.reportItemListDto> getreportItemList(string BusinessReportId)
{
return Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == BusinessReportId)
.OrderBy(x => x.SortIndex).OrderBy(x => x.SortUnitName).Select(x => new Model.reportItemListDto()
{
BusinessReportItemId = x.BusinessReportItemId,
BusinessReportId = x.BusinessReportId,
SortIndex = x.SortIndex,
Code = x.Code,
UnitLevel = x.UnitLevel,
CreateDate = x.CreateDate,
Place = x.Place,
PersonNum = x.PersonNum,
TotalAssets = x.TotalAssets,
TotalValue = x.TotalValue,
NewInvestment = x.NewInvestment,
UnitName = x.UnitName,
SortUnitName = x.SortUnitName
}).ToList();
}
public static string UpOperationReport(string businessReportId, Model.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
var upReport = from x in db.Environmental_OperationReport
where x.BusinessReportId == businessReportId
select new Model.Environmental_OperationReportDto
{
BusinessReportId = x.BusinessReportId,
UnitId = x.UnitId,
Year = x.Year,
Quarters = x.Quarters,
FillingMan = x.FillingMan,
FillingDate = x.FillingDate,
StatisticsDutyPerson = x.StatisticsDutyPerson,
UnitDutyPerson = x.UnitDutyPerson,
Remark = x.Remark,
reportItemList = getreportItemList(x.BusinessReportId)
};
//新接口Api
code = UpApiOperationReportNew(upReport).ToString();
if (code == "1")
{
var report = db.Environmental_OperationReport.FirstOrDefault(e => e.BusinessReportId == businessReportId);
if (report != null)
{
report.UpState = BLL.Const.UpState_3;
db.SubmitChanges();
}
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
else
{
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
#region
private static int UpApiOperationReport(IQueryable<Model.OperationReportDto> upReport)
{
string baseurl = "/api/InformationData/SaveOperationReport";
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
private static int UpApiOperationReportNew(IQueryable<Model.Environmental_OperationReportDto> upReport)
{
string baseurl = "/api/InformationData/SaveOperationReportNew";
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
#endregion
#region
/// <summary>
/// 中央企业节能环保产业企业生产和服务业务情况报表上报
/// </summary>
public static string UpEnergyReport(string energyReportId, Model.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
var upReport = from x in db.Environmental_EnergyReport
where x.EnergyReportId == energyReportId
select new Model.EnergyReport
{
EnergyReportId = x.EnergyReportId,
UnitId = x.UnitId,
Year = x.Year,
Quarters = x.Quarters,
FillingMan = x.FillingMan,
FillingDate = x.FillingDate,
DutyPerson = x.DutyPerson,
};
var upReportItem = from x in db.Environmental_EnergyReportItem
where x.EnergyReportId == energyReportId
select new Model.EnergyReportItem
{
EnergyReportItemId = x.EnergyReportItemId,
EnergyReportId = x.EnergyReportId,
SortIndex = x.SortIndex,
BusinessCategory = x.BusinessCategory,
Throughput_BasePeriod = x.Throughput_BasePeriod,
Throughput_LastPeriod = x.Throughput_LastPeriod,
Throughput_ThisPeriod = x.Throughput_ThisPeriod,
Throughput_UnitOfMeasurement = x.Throughput_UnitOfMeasurement,
Yield_BasePeriod = x.Yield_BasePeriod,
Yield_LastPeriod = x.Yield_LastPeriod,
Yield_ThisPeriod = x.Yield_ThisPeriod,
Yield_UnitOfMeasurement = x.Yield_UnitOfMeasurement,
OutputValue_BasePeriod = x.OutputValue_BasePeriod,
OutputValue_LastYear = x.OutputValue_LastYear,
OutputValue_ThisYear = x.OutputValue_ThisYear,
OperationScale_BasePeriod = x.OperationScale_BasePeriod,
OperationScale_LastYear = x.OperationScale_LastYear,
OperationScale_ThisYear = x.OperationScale_ThisYear,
OperationScale_UnitOfMeasurement = x.OperationScale_UnitOfMeasurement,
ServiceOperatingIncome_BasePeriod = x.ServiceOperatingIncome_BasePeriod,
ServiceOperatingIncome_LastYear = x.ServiceOperatingIncome_LastYear,
ServiceOperatingIncome_ThisYear = x.ServiceOperatingIncome_ThisYear,
SortUnit = x.SortUnit
};
//老接口Serveice
//var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList());
//新接口Api
code = UpApiEnergyReport(upReport, upReportItem).ToString();
if (code == "1")
{
foreach (var item in upReport.Select(p => p.EnergyReportId))
{
var report = db.Environmental_EnergyReport.FirstOrDefault(e => e.EnergyReportId == item);
if (report != null)
{
report.UpState = BLL.Const.UpState_3;
db.SubmitChanges();
////更新 当前人要处理的意见
//ProjectDataFlowSetService.CloseFlowOperate(Const.ChemicalReportMenuId, item, string.Empty);
// //更新催报信息
//UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Quarters.ToString());
}
}
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
else
{
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
/// <summary>
/// UpApiChemicalReportApi调用
/// </summary>
/// <param name="upReport">主表</param>
/// <param name="upReportItem">明细表</param>
/// <returns></returns>
private static int UpApiEnergyReport(IQueryable<Model.EnergyReport> upReport, IQueryable<Model.EnergyReportItem> upReportItem)
{
string baseurl = "/api/InformationData/SaveEnergyReport";
//合并
//var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem });
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var resultJsonReportItem = JsonConvert.SerializeObject(new { EnergyReportItem = upReportItem });
resultJsonReport = "{\"InformationDataItems\":[" + (resultJsonReport + resultJsonReportItem).Replace("}{", ",") + "]}";
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
#region
/// <summary>
/// 安全管理工作总结报告

View File

@ -63,13 +63,8 @@ namespace BLL
IRestResponse response = client.Execute(request);
APICommonService.SaveSysHttpLog("api_Out", baseurl, response.Content);
var returnData = JsonConvert.DeserializeObject<Model.ResponeData>(response.Content.ToString());
if (returnData.code == 0)
{
responeData.code = 0;
responeData.message = returnData.message;
return responeData;
}
responeData.code = returnData.code;
responeData.message = returnData.message;
return responeData;
}
public static Model.TokenItem GetToken()

View File

@ -142,7 +142,7 @@ namespace BLL
}
public static void DeleteEnvironmental_EnergyReportById(string EnergyReportId)
{
Model.SGGLDB db = Funs.DB;
Model.Environmental_EnergyReport table = db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId);
if (table != null)
{

View File

@ -99,7 +99,7 @@ namespace BLL
{
return (from x in Funs.DB.Environmental_EnergyReportItem
where x.EnergyReportId == EnergyReportId
orderby x.SortIndex
orderby x.SortIndex,x.SortUnit
select x).ToList();
}
@ -141,38 +141,39 @@ namespace BLL
{
var q = (from x in Funs.DB.Environmental_EnergyReportItem
where x.EnergyReportId == EnergyReportId
orderby x.SortIndex
orderby x.SortIndex,x.SortUnit
select x).ToList();
List<Model.Environmental_EnergyReportItem> newItems = new List<Model.Environmental_EnergyReportItem>();
foreach (var item in q)
{
Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem();
//List<Model.Environmental_EnergyReportItem> newItems = new List<Model.Environmental_EnergyReportItem>();
//foreach (var item in q)
//{
// Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem();
newItem.EnergyReportItemId = item.EnergyReportItemId;
newItem.EnergyReportId = item.EnergyReportId;
newItem.SortIndex = item.SortIndex;
newItem.BusinessCategory = item.BusinessCategory;
newItem.Throughput_BasePeriod = item.Throughput_BasePeriod;
newItem.Throughput_LastPeriod = item.Throughput_LastPeriod;
newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod;
newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement;
newItem.Yield_BasePeriod = item.Yield_BasePeriod;
newItem.Yield_LastPeriod = item.Yield_LastPeriod;
newItem.Yield_ThisPeriod = item.Yield_ThisPeriod;
newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement;
newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod;
newItem.OutputValue_LastYear = item.OutputValue_LastYear;
newItem.OutputValue_ThisYear = item.OutputValue_ThisYear;
newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod;
newItem.OperationScale_LastYear = item.OperationScale_LastYear;
newItem.OperationScale_ThisYear = item.OperationScale_ThisYear;
newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement;
newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod;
newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear;
newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear;
newItems.Add(newItem);
}
return newItems;
// newItem.EnergyReportItemId = item.EnergyReportItemId;
// newItem.EnergyReportId = item.EnergyReportId;
// newItem.SortIndex = item.SortIndex;
// newItem.BusinessCategory = item.BusinessCategory;
// newItem.Throughput_BasePeriod = item.Throughput_BasePeriod;
// newItem.Throughput_LastPeriod = item.Throughput_LastPeriod;
// newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod;
// newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement;
// newItem.Yield_BasePeriod = item.Yield_BasePeriod;
// newItem.Yield_LastPeriod = item.Yield_LastPeriod;
// newItem.Yield_ThisPeriod = item.Yield_ThisPeriod;
// newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement;
// newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod;
// newItem.OutputValue_LastYear = item.OutputValue_LastYear;
// newItem.OutputValue_ThisYear = item.OutputValue_ThisYear;
// newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod;
// newItem.OperationScale_LastYear = item.OperationScale_LastYear;
// newItem.OperationScale_ThisYear = item.OperationScale_ThisYear;
// newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement;
// newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod;
// newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear;
// newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear;
// newItems.Add(newItem);
//}
return q;
}
public static void AddEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable)
{
@ -268,11 +269,12 @@ namespace BLL
}
public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId)
{
Model.SGGLDB db = Funs.DB;
var q = from x in Funs.DB.Environmental_EnergyReportItem where x.EnergyReportId == EnergyReportId select x;
if (q != null)
{
Funs.DB.Environmental_EnergyReportItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
db.Environmental_EnergyReportItem.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}

View File

@ -1093,11 +1093,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[0].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 != 0)
{
this.Grid1.Rows[14].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E20, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 != 0)
{
this.Grid1.Rows[14].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F20, 4);
}
@ -1105,11 +1105,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[14].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E22 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E22 != 0)
{
this.Grid1.Rows[16].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E22, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F22 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F22 != 0)
{
this.Grid1.Rows[16].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F22, 4);
}
@ -1117,11 +1117,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[16].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 != 0)
{
this.Grid1.Rows[18].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E24, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 != 0)
{
this.Grid1.Rows[18].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F24, 4);
}
@ -1129,11 +1129,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[18].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E26 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E26 != 0)
{
this.Grid1.Rows[20].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E26, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F26 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F26 != 0)
{
this.Grid1.Rows[20].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F26, 4);
}
@ -1141,11 +1141,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[20].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E28 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E28 != 0)
{
this.Grid1.Rows[22].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E28, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F28 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F28 != 0)
{
this.Grid1.Rows[22].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F28, 4);
}
@ -1153,11 +1153,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[22].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E42 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E42 != 0)
{
this.Grid1.Rows[36].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E42, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F42 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F42 != 0)
{
this.Grid1.Rows[36].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F42, 4);
}
@ -1165,11 +1165,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[36].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[4].ToString()), 2).ToString() + "%";
}
if (E64 > 0 && E65 > 0 && E20 > 0)
if (E64 != 0 && E65 != 0 && E20 != 0)
{
this.Grid1.Rows[58].Values[4] = decimal.Round((E64 + E65) / E20, 4);
}
if (F64 > 0 && F65 > 0 && F20 > 0)
if (F64 != 0 && F65 != 0 && F20 != 0)
{
this.Grid1.Rows[58].Values[5] = decimal.Round((F64 + F65) / F20, 4);
}
@ -1265,6 +1265,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else if (code=="3")
{
Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error);
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
@ -1280,26 +1284,26 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void btnSave_Click(object sender, EventArgs e)
{
//bool isEmpty = false;
//foreach (JObject mergedRow in Grid1.GetMergedData())
//{
// JObject values = mergedRow.Value<JObject>("values");
// int rowIndex = mergedRow.Value<int>("index");
// string sortIndex = values.Value<string>("SortIndex");
// if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
// {
// if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
// {
// isEmpty = true;
// break;
// }
// }
//}
//if (isEmpty)
//{
// ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
// return;
//}
/* bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}*/
Save("add");
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
@ -1332,26 +1336,26 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void btnSubmit_Click(object sender, EventArgs e)
{
//bool isEmpty = false;
//foreach (JObject mergedRow in Grid1.GetMergedData())
//{
// JObject values = mergedRow.Value<JObject>("values");
// int rowIndex = mergedRow.Value<int>("index");
// string sortIndex = values.Value<string>("SortIndex");
// if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
// {
// if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
// {
// isEmpty = true;
// break;
// }
// }
//}
//if (isEmpty)
//{
// ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
// return;
//}
bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}
Save("submit");
}
#endregion

View File

@ -1887,6 +1887,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else if (code == "3")
{
Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error);
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
@ -1902,26 +1906,26 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void btnSave_Click(object sender, EventArgs e)
{
//bool isEmpty = false;
//foreach (JObject mergedRow in Grid1.GetMergedData())
//{
// JObject values = mergedRow.Value<JObject>("values");
// int rowIndex = mergedRow.Value<int>("index");
// string sortIndex = values.Value<string>("SortIndex");
// if (sortIndex == "19" || sortIndex == "69" || sortIndex == "70")
// {
// if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
// {
// isEmpty = true;
// break;
// }
// }
//}
//if (isEmpty)
//{
// ShowNotify("工业总产值(可比价)、万元产值二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
// return;
//}
bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "19" || sortIndex == "69" || sortIndex == "70")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("工业总产值(可比价)、万元产值二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}
Save("add");
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
@ -1954,26 +1958,26 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void btnSubmit_Click(object sender, EventArgs e)
{
//bool isEmpty = false;
//foreach (JObject mergedRow in Grid1.GetMergedData())
//{
// JObject values = mergedRow.Value<JObject>("values");
// int rowIndex = mergedRow.Value<int>("index");
// string sortIndex = values.Value<string>("SortIndex");
// if (sortIndex == "19" || sortIndex == "69" || sortIndex == "70")
// {
// if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
// {
// isEmpty = true;
// break;
// }
// }
//}
//if (isEmpty)
//{
// ShowNotify("工业总产值(可比价)、万元产值二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
// return;
//}
bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "19" || sortIndex == "69" || sortIndex == "70")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("工业总产值(可比价)、万元产值二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}
Save("submit");
}
#endregion

View File

@ -161,6 +161,8 @@
<script type="text/jscript">
function renderIndexName(value) {
return value.replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;").replace("\t\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp")
.replace("A", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
.replace("B", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
}
</script>
</body>

View File

@ -86,35 +86,35 @@ namespace FineUIPro.Web.ZHGL.Environmental
var businessCategorys = EnergyreportItemService.GetItems("Template");
//之前月度合计值集合
List<Model.Environmental_EnergyReportItem> reportItems = BLL.EnergyreportItemService.GetItems(report.EnergyReportId);
List<Model.Environmental_EnergyReportItem> newItemList = new List<Model.Environmental_EnergyReportItem>();
foreach (var item in reportItems)
{
Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem();
newItem.EnergyReportItemId = item.EnergyReportItemId;
newItem.EnergyReportId = item.EnergyReportId;
newItem.SortIndex = item.SortIndex;
newItem.BusinessCategory = item.BusinessCategory;
newItem.Throughput_BasePeriod = item.Throughput_BasePeriod;
newItem.Throughput_LastPeriod = item.Throughput_LastPeriod;
newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod;
newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement;
newItem.Yield_BasePeriod = item.Yield_BasePeriod;
newItem.Yield_LastPeriod = item.Yield_LastPeriod;
newItem.Yield_ThisPeriod = item.Yield_ThisPeriod;
newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement;
newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod;
newItem.OutputValue_LastYear = item.OutputValue_LastYear;
newItem.OutputValue_ThisYear = item.OutputValue_ThisYear;
newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod;
newItem.OperationScale_LastYear = item.OperationScale_LastYear;
newItem.OperationScale_ThisYear = item.OperationScale_ThisYear;
newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement;
newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod;
newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear;
newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear;
newItemList.Add(item);
}
Grid1.DataSource = newItemList;
//List<Model.Environmental_EnergyReportItem> newItemList = new List<Model.Environmental_EnergyReportItem>();
//foreach (var item in reportItems)
//{
// Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem();
// newItem.EnergyReportItemId = item.EnergyReportItemId;
// newItem.EnergyReportId = item.EnergyReportId;
// newItem.SortIndex = item.SortIndex;
// newItem.BusinessCategory = item.BusinessCategory;
// newItem.Throughput_BasePeriod = item.Throughput_BasePeriod;
// newItem.Throughput_LastPeriod = item.Throughput_LastPeriod;
// newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod;
// newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement;
// newItem.Yield_BasePeriod = item.Yield_BasePeriod;
// newItem.Yield_LastPeriod = item.Yield_LastPeriod;
// newItem.Yield_ThisPeriod = item.Yield_ThisPeriod;
// newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement;
// newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod;
// newItem.OutputValue_LastYear = item.OutputValue_LastYear;
// newItem.OutputValue_ThisYear = item.OutputValue_ThisYear;
// newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod;
// newItem.OperationScale_LastYear = item.OperationScale_LastYear;
// newItem.OperationScale_ThisYear = item.OperationScale_ThisYear;
// newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement;
// newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod;
// newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear;
// newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear;
// newItemList.Add(item);
//}
Grid1.DataSource = reportItems;
Grid1.DataBind();
}
else
@ -201,7 +201,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
if (getReport != null)
{
this.btnNew.Hidden = true;
//if (getReport.HandleMan == this.CurrUser.PersonId) //当前人是下一步办理入
//if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入
//{
// if (getReport.HandleState == BLL.Const.HandleState_2)
// {

View File

@ -48,8 +48,9 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
BoxFlex="1" DataKeyNames="EnergyReportItemId" AllowCellEditing="true" ForceFit="false"
ClicksToEdit="1" DataIDField="EnergyReportItemId" EnableColumnLines="true" OnRowDataBound="Grid1_RowDataBound"
EnableHeaderMenu="false" Height="380px">
EnableHeaderMenu="false" Height="700px">
<Columns>
<f:RenderField Width="400px" ColumnID="BusinessCategory" DataField="BusinessCategory" FieldType="String"
HeaderText="业务类别" HeaderTextAlign="Center" TextAlign="Left" RendererFunction="renderIndexName">
</f:RenderField>
@ -191,6 +192,12 @@
</f:RenderField>
</Columns>
</f:GroupField>
<f:RenderField Width="100px" ColumnID="SortUnit" DataField="SortUnit" FieldType="String" Hidden="true"
HeaderText="排序" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
</Columns>
</f:GroupField>
</Columns>
@ -209,7 +216,7 @@
ValidateForms="SimpleForm1" OnClick="btnCopy_Click" Hidden="true">
</f:Button>--%>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Hidden="true" Text="保存"
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Hidden="true" Text="计算合计并保存"
ValidateForms="SimpleForm1" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnUpdata" Icon="PageSave" runat="server" ConfirmText="确定上报?" Text="上报" Hidden="true"
@ -227,6 +234,8 @@
<script type="text/jscript">
function renderIndexName(value) {
return value.replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;").replace("\t\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp")
.replace("A", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
.replace("B", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
}
function onGridAfterEdit(event, value, params) {

View File

@ -1,9 +1,11 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using Org.BouncyCastle.Asn1.Ocsp;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web.UI.WebControls;
@ -78,7 +80,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
if (report != null)
{
//this.btnCopy.Hidden = true;
//if (this.CurrUser.PersonId == BLL.Const.sysglyId || this.CurrUser.PersonId == BLL.Const.hfnbdId)
//if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId)
//{
// this.btnSave.Hidden = false;
//}
@ -113,11 +115,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
}
else
{
string arg = GetRequestEventArgument(); // 此函数所在文件PageBase.cs
if (arg == "UPDATE_SUMMARY")
{
SaveData();
}
//string arg = GetRequestEventArgument(); // 此函数所在文件PageBase.cs
//if (arg == "UPDATE_SUMMARY")
//{
// SaveData();
//}
}
}
@ -129,7 +131,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
JObject values = mergedRow.Value<JObject>("values");
string sortIndex = values.Value<string>("SortIndex");
var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex);
var SortUnit = values.Value<int>("SortUnit");
var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex && x.SortUnit == SortUnit);
if (newItem != null)
{
newItem.EnergyReportItemId = SQLHelper.GetNewID();
@ -137,17 +140,17 @@ namespace FineUIPro.Web.ZHGL.Environmental
newItem.SortIndex = values.Value<string>("SortIndex");
newItem.BusinessCategory = values.Value<string>("BusinessCategory");
newItem.Throughput_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_BasePeriod")).ToString();
newItem.Throughput_LastPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_LastPeriod")).ToString();
newItem.Throughput_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_ThisPeriod")).ToString();
newItem.Throughput_LastPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_LastPeriod")).ToString();
newItem.Throughput_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_ThisPeriod")).ToString();
newItem.Throughput_UnitOfMeasurement = values.Value<string>("Throughput_UnitOfMeasurement");
newItem.Yield_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_BasePeriod")).ToString();
newItem.Yield_LastPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_LastPeriod")).ToString();
newItem.Yield_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_ThisPeriod")).ToString();
newItem.Yield_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_BasePeriod")).ToString();
newItem.Yield_LastPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_LastPeriod")).ToString();
newItem.Yield_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_ThisPeriod")).ToString();
newItem.Yield_UnitOfMeasurement = values.Value<string>("Yield_UnitOfMeasurement");
newItem.OutputValue_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_BasePeriod")).ToString();
newItem.OutputValue_LastYear = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_LastYear")).ToString();
newItem.OutputValue_ThisYear = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_ThisYear")).ToString();
newItem.OperationScale_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("OperationScale_BasePeriod")).ToString();
newItem.OutputValue_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_BasePeriod")).ToString();
newItem.OutputValue_LastYear = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_LastYear")).ToString();
newItem.OutputValue_ThisYear = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_ThisYear")).ToString();
newItem.OperationScale_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("OperationScale_BasePeriod")).ToString();
newItem.OperationScale_LastYear = Funs.GetNewDecimalOrZero(values.Value<string>("OperationScale_LastYear")).ToString();
newItem.OperationScale_ThisYear = Funs.GetNewDecimalOrZero(values.Value<string>("OperationScale_ThisYear")).ToString();
newItem.OperationScale_UnitOfMeasurement = values.Value<string>("OperationScale_UnitOfMeasurement");
@ -203,18 +206,27 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
Model.Environmental_EnergyReportItem a = (Model.Environmental_EnergyReportItem)e.DataItem;
Model.Environmental_EnergyReportItem a = (Model.Environmental_EnergyReportItem)e.DataItem;
e.DataItem.ToString();
//string SortIndex = Convert.ToString(row["SortIndex"]);
if (a.SortIndex == "01")
{
for (int i = 0; i < e.CellCssClasses.Count(); i++)
{
e.CellCssClasses[i] = "f-grid-cell-uneditable";
}
}
//合计行全部禁止输入
if (a.SortUnit == 1)
{
for (int i = 0; i < e.CellCssClasses.Count(); i++)
{
e.CellCssClasses[i] = "f-grid-cell-uneditable";
}
}
}
@ -281,35 +293,14 @@ namespace FineUIPro.Web.ZHGL.Environmental
EnergyReportId = report.EnergyReportId;
BLL.EnergyreportItemService.DeleteEnergyReportItemByChemicalReportId(report.EnergyReportId);
GetItems(report.EnergyReportId);
List<Model.Environmental_EnergyReportItem> mReportItemList = new List<Environmental_EnergyReportItem>();
foreach (var item in items)
if (items.Count > 0)
{
Model.Environmental_EnergyReportItem newItem = new Environmental_EnergyReportItem();
newItem.EnergyReportItemId = item.EnergyReportItemId;
newItem.EnergyReportId = item.EnergyReportId;
newItem.SortIndex = item.SortIndex;
newItem.BusinessCategory = item.BusinessCategory;
newItem.Throughput_BasePeriod = item.Throughput_BasePeriod;
newItem.Throughput_LastPeriod = item.Throughput_LastPeriod;
newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod;
newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement;
newItem.Yield_BasePeriod = item.Yield_BasePeriod;
newItem.Yield_LastPeriod = item.Yield_LastPeriod;
newItem.Yield_ThisPeriod = item.Yield_ThisPeriod;
newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement;
newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod;
newItem.OutputValue_LastYear = item.OutputValue_LastYear;
newItem.OutputValue_ThisYear = item.OutputValue_ThisYear;
newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod;
newItem.OperationScale_LastYear = item.OperationScale_LastYear;
newItem.OperationScale_ThisYear = item.OperationScale_ThisYear;
newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement;
newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod;
newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear;
newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear;
EnergyreportItemService.AddEnvironmental_EnergyReportItem(newItem);
mReportItemList.Add(newItem);
Funs.DB.Environmental_EnergyReportItem.InsertAllOnSubmit(items);
Funs.DB.SubmitChanges();
////计算合计
//UpdateEnvironmental_EnergyReportItem(EnergyReportId);
}
if (type == "updata") //数据同步
{
if (report.UpState == BLL.Const.UpState_2)
@ -321,6 +312,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else if (code == "3")
{
Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error);
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
@ -361,7 +356,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
JObject values = mergedRow.Value<JObject>("values");
string sortIndex = values.Value<string>("SortIndex");
var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex);
var SortUnit = values.Value<int>("SortUnit");
var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex && x.SortUnit == SortUnit);
if (newItem != null)
{
newItem.EnergyReportItemId = SQLHelper.GetNewID();
@ -390,11 +386,63 @@ namespace FineUIPro.Web.ZHGL.Environmental
}
}
items = newItemLists;
//计算合计
getAllSum();
}
#endregion
#region
private void getAllSum()
{
items.ForEach(x =>
{
//需要合计的时候
if (x.SortUnit == 1)
{
if (x.BusinessCategory == "合计")
{
x.Throughput_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_BasePeriod)).ToString();
x.Throughput_LastPeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_LastPeriod)).ToString();
x.Throughput_ThisPeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_ThisPeriod)).ToString();
x.Yield_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_BasePeriod)).ToString();
x.Yield_LastPeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_LastPeriod)).ToString();
x.Yield_ThisPeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_ThisPeriod)).ToString();
x.OutputValue_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_BasePeriod)).ToString();
x.OutputValue_LastYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_LastYear)).ToString();
x.OutputValue_ThisYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_ThisYear)).ToString();
x.OperationScale_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_BasePeriod)).ToString();
x.OperationScale_LastYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_LastYear)).ToString();
x.OperationScale_ThisYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_ThisYear)).ToString();
x.ServiceOperatingIncome_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_BasePeriod)).ToString();
x.ServiceOperatingIncome_LastYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_LastYear)).ToString();
x.ServiceOperatingIncome_ThisYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_ThisYear)).ToString();
}
else
{
x.Throughput_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_BasePeriod)).ToString();
x.Throughput_LastPeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_LastPeriod)).ToString();
x.Throughput_ThisPeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_ThisPeriod)).ToString();
x.Yield_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_BasePeriod)).ToString();
x.Yield_LastPeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_LastPeriod)).ToString();
x.Yield_ThisPeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_ThisPeriod)).ToString();
x.OutputValue_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_BasePeriod)).ToString();
x.OutputValue_LastYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_LastYear)).ToString();
x.OutputValue_ThisYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_ThisYear)).ToString();
x.OperationScale_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_BasePeriod)).ToString();
x.OperationScale_LastYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_LastYear)).ToString();
x.OperationScale_ThisYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_ThisYear)).ToString();
x.ServiceOperatingIncome_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_BasePeriod)).ToString();
x.ServiceOperatingIncome_LastYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_LastYear)).ToString();
x.ServiceOperatingIncome_ThisYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_ThisYear)).ToString();
}
}
});
}
#endregion
#region
private void GetNewItems(int year, int Quarters)
private void GetNewItems(int year, int Quarters)
{
var indexNames = EnergyreportItemService.GetItems("Template");
foreach (var indexName in indexNames)
@ -405,11 +453,48 @@ namespace FineUIPro.Web.ZHGL.Environmental
EnergyReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReportItem)),
BusinessCategory = indexName.BusinessCategory,
SortIndex = indexName.SortIndex,
SortUnit = indexName.SortUnit
};
items.Add(item);
//修改2024-10-23 14:15:06
#region
if (item.BusinessCategory != "合计")
{
//第一个本单位
var isthisUnit = CommonService.GetIsThisUnit();
var model = new Environmental_EnergyReportItem
{
EnergyReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReportItem)),
BusinessCategory = getLenthSpace(indexName.SortIndex) +isthisUnit.UnitName,
SortIndex = item.SortIndex,
SortUnit = 2,
};
items.Add(model);
//加载分单位
var unitList = Funs.DB.Base_Unit.Where(x => x.IsBranch == true).ToList();
var j = 3;
foreach (var unitItem in unitList)
{
model = new Environmental_EnergyReportItem
{
EnergyReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReportItem)),
BusinessCategory = getLenthSpace(indexName.SortIndex) +unitItem.UnitName,
SortIndex = item.SortIndex,
SortUnit = j,
};
items.Add(model);
j++;
}
}
#endregion
}
var ListProjectEnergyItemReport= ProjectEnergyreportItemService.GetItemsByDate(year, Quarters);
var ListProjectEnergyItemReport = ProjectEnergyreportItemService.GetItemsByDate(year, Quarters);
var q = from x in ListProjectEnergyItemReport
group x by x.SortIndex into g
select new
@ -516,9 +601,9 @@ namespace FineUIPro.Web.ZHGL.Environmental
// newChemicalReport.UnitId = this.drpUnit.SelectedValue;
// newChemicalReport.Year = Convert.ToInt32(this.drpYear.SelectedValue);
// newChemicalReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue);
// newChemicalReport.FillingMan = this.CurrUser.PersonName;
// newChemicalReport.FillingMan = this.CurrUser.UserName;
// newChemicalReport.FillingDate = DateTime.Now;
// newChemicalReport.DutyPerson = this.CurrUser.PersonName;
// newChemicalReport.DutyPerson = this.CurrUser.UserName;
// newChemicalReport.UpState = BLL.Const.UpState_2;
// BLL.EnergyReportService.ad(newChemicalReport);
@ -567,5 +652,20 @@ namespace FineUIPro.Web.ZHGL.Environmental
}
}
#endregion
#region
private string getLenthSpace(string SortIndex) {
string returnVal = "";
if (SortIndex == "02" || SortIndex == "16" || SortIndex == "44")
{
returnVal += "A";
}
else {
returnVal += "B";
}
return returnVal;
}
#endregion
}
}

View File

@ -21,8 +21,7 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" Title="中央企业节能环保和经营状况季报" EnableCollapse="true"
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="BusinessReportId"
DataIDField="BusinessReportId" AllowSorting="true" ForceFit="true"
SortField="FillingDate" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
SortField="FillingDate" AllowPaging="true"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
@ -49,7 +48,10 @@
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField Width="60px" ColumnID="Code" DataField="Code" SortField="Code"
<f:RenderField Width="120px" ColumnID="UnitName" DataField="UnitName"
FieldType="String" HeaderText="企业名称" HeaderTextAlign="Center" TextAlign="Left" />
<f:RenderField Width="60px" ColumnID="Code" DataField="Code"
FieldType="String" HeaderText="代码" HeaderTextAlign="Center" TextAlign="Center" />
<f:GroupField EnableLock="true" HeaderText="企业基本情况" TextAlign="Center">
@ -86,7 +88,7 @@
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<%-- <PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
@ -94,14 +96,14 @@
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
</f:DropDownList>
</PageItems>
</PageItems>--%>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="编辑安全生产数据季报" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1000px" Height="560px">
<f:Window ID="Window1" Title="编辑中央企业节能环保企业基本情况和经营状况" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" PercentWidth="100%" PercentHeight="100%">
</f:Window>
<f:Window ID="Window2" Title="打印安全生产数据季报" Hidden="true" EnableIFrame="true" EnableMaximize="true"
<f:Window ID="Window2" Title="打印中央企业节能环保企业基本情况和经营状况" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1000px" Height="560px">
</f:Window>
<f:Menu ID="Menu1" runat="server">

View File

@ -18,7 +18,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
//Funs.DropDownPageSize(this.ddlPageSize);
//权限按钮方法
this.GetButtonPower();
@ -35,9 +35,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
drpUnit.DataBind();
this.drpUnit.Readonly = true;
Grid1.PageSize = 10;
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
//if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
//{
// Grid1.PageSize = this.CurrUser.PageSize.Value;
//}
//this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
this.BindGrid();
}
@ -50,7 +52,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
string strSql = "select * from Environmental_OperationReport where 1=1 ";
strSql += " AND UnitId = '" + Const.UnitId_SEDIN + "'";
strSql += " AND UnitId = '" + BLL.Const.UnitId_SEDIN + "'";
List<SqlParameter> listStr = new List<SqlParameter>();
@ -65,18 +67,25 @@ namespace FineUIPro.Web.ZHGL.Environmental
listStr.Add(new SqlParameter("@Quarters", Funs.GetNewInt(this.drpQuarters.SelectedValue)));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
//SqlParameter[] parameter = listStr.ToArray();
//DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
//var table = this.GetPagedDataTable(Grid1, tb);
//Grid1.DataSource = table;
//Grid1.DataBind();
Model.Environmental_OperationReport report = Funs.DB.Environmental_OperationReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Funs.GetNewInt(this.drpQuarters.SelectedValue) && e.Year == Funs.GetNewInt(this.drpYear.SelectedValue));
if (report != null)
{
//根据主表id加载子表
var reportItem = Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == report.BusinessReportId)
.OrderBy(x => x.SortIndex).ToList();
Grid1.DataSource = reportItem;
Grid1.DataBind();
string upState = string.Empty;
if (report.UpState == BLL.Const.UpState_3)
{
@ -88,6 +97,14 @@ namespace FineUIPro.Web.ZHGL.Environmental
}
this.Grid1.Title = "中央企业节能环保和经营状况季报" + this.drpQuarters.SelectedItem.Text + this.drpYear.SelectedItem.Text + upState;
}
else {
var upState = "(未上报)";
this.Grid1.Title = "中央企业节能环保和经营状况季报" + this.drpQuarters.SelectedItem.Text + this.drpYear.SelectedItem.Text + upState;
this.Grid1.DataSource = null;
this.Grid1.DataBind();
}
}
#endregion
@ -121,8 +138,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
BindGrid();
//this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
//BindGrid();
}
/// <summary>
@ -161,7 +178,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}", Const.UnitId_SEDIN, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}", BLL.Const.UnitId_SEDIN, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - ")));
}
/// <summary>
/// 双击事件
@ -197,7 +214,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
var operationReport = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == id);
if (operationReport != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}", Const.UnitId_SEDIN, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, id, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}", BLL.Const.UnitId_SEDIN, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, id, "编辑 - ")));
}
}
@ -208,14 +225,19 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnUpdata_Click(object sender, EventArgs e)
{
var currUnitId = Const.UnitId_SEDIN;
var currUnitId = BLL.Const.UnitId_SEDIN;
var year = this.drpYear.SelectedValue;
var quarter = this.drpQuarters.SelectedValue;
Model.Environmental_OperationReport report = Funs.DB.Environmental_OperationReport.Where(s => s.UnitId == currUnitId && s.Year.ToString() == year && s.Quarters.ToString() == quarter).FirstOrDefault();
if (report != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}&type=Update", Const.UnitId_SEDIN, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, report.BusinessReportId, "编辑 - ")));
if (report.UpState=="3")
{
ShowNotify("当前报表已经上报!不能重复上报。", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}&type=Update", BLL.Const.UnitId_SEDIN, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, report.BusinessReportId, "编辑 - ")));
}
else
{
@ -262,15 +284,22 @@ namespace FineUIPro.Web.ZHGL.Environmental
var getD = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == rowID);
if (getD != null)
{
//先删子表
var list = Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == getD.BusinessReportId).ToList();
if (list.Count > 0)
{
Funs.DB.Environmental_OperationReportItem.DeleteAllOnSubmit(list);
Funs.DB.SubmitChanges();
}
BLL.LogService.AddSys_Log(this.CurrUser, null, getD.BusinessReportId, BLL.Const.OperationReportMenuId, BLL.Const.BtnDelete);
Funs.DB.Environmental_OperationReport.DeleteOnSubmit(getD);
Funs.DB.SubmitChanges();
}
}
this.BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
this.BindGrid();
}
}
#endregion
@ -320,7 +349,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
}
}
var unitId = Const.UnitId_SEDIN;
var unitId = BLL.Const.UnitId_SEDIN;
var year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
var quarter = Funs.GetNewIntOrZero(drpQuarters.SelectedValue);

View File

@ -113,33 +113,6 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// </remarks>
protected global::FineUIPro.Button btnUpdata;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>

View File

@ -16,7 +16,7 @@
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" BodyPadding="5px" runat="server" ShowHeader="false" EnableCollapse="True"
Title="编辑环保与经营状况数据季报" AutoScroll="true">
Title="编辑中央企业节能环保企业基本情况和经营状况" AutoScroll="true">
<Items>
<f:Form ID="Form2" runat="server" ShowHeader="false" BodyPadding="5px" RedStarPosition="BeforeText">
<Items>
@ -35,7 +35,132 @@
</Items>
</f:Form>
<f:Form ID="Form11" runat="server" ShowHeader="false" BodyPadding="5px">
<Items>
<f:FormRow>
<Items>
<f:TextBox ID="txtCompileMan" runat="server" Label="填报人" LabelAlign="Right" LabelWidth="140px">
</f:TextBox>
<f:TextBox ID="txtStatisticsDutyPerson" runat="server" Label="统计负责人" LabelAlign="Right" LabelWidth="140px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtUnitDutyPerson" runat="server" Label="单位负责人" LabelAlign="Right" LabelWidth="140px">
</f:TextBox>
<f:DatePicker ID="txtFillingDate" runat="server" Label="填报日期" LabelAlign="Right" LabelWidth="140px"
EnableEdit="true">
</f:DatePicker>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Form ID="Form6" runat="server" ShowHeader="false" BodyPadding="5px">
<Items>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注" LabelAlign="Right" LabelWidth="140px">
</f:TextBox>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Form ID="Form4" runat="server" ShowHeader="false" BodyPadding="5px">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="BusinessReportItemId"
DataKeyNames="BusinessReportItemId" ShowGridHeader="true" SortField="SortIndex" SortDirection="ASC"
AllowCellEditing="true" ClicksToEdit="1" AllowSorting="true" EnableColumnLines="true"
EnableTextSelection="True">
<Columns>
<f:RenderField minWidth="300px" ColumnID="UnitName" DataField="UnitName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="单位名称">
<Editor>
<f:TextBox ID="TextBox1" runat="server">
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField minWidth="100px" ColumnID="Code" DataField="Code"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="代码">
<Editor>
<f:TextBox ID="TextBox2" runat="server">
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField minWidth="100px" ColumnID="UnitLevel" DataField="UnitLevel"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="企业层级">
<Editor>
<f:TextBox ID="TextBox3" runat="server">
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField minWidth="120px" ColumnID="CreateDate" DataField="CreateDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd"
HeaderTextAlign="Center" TextAlign="Left" HeaderText="成立时间">
<Editor>
<f:DatePicker ID="DatePicker1" DateFormatString="yyyy-MM-dd" runat="server">
</f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField minWidth="160px" ColumnID="Place" DataField="Place"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="所在地">
<Editor>
<f:TextBox ID="TextBox4" runat="server">
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField minWidth="120px" ColumnID="PersonNum" DataField="PersonNum"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="职工人数">
<Editor>
<f:NumberBox ID="txtPersonNum" runat="server" NoDecimal="false"
NoNegative="false" EmptyText="0">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField minWidth="160px" ColumnID="TotalAssets" DataField="TotalAssets"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="资产总额(万元)">
<Editor>
<f:NumberBox ID="txtTotalAssets" runat="server"
NoDecimal="false" NoNegative="false" EmptyText="0" DecimalPrecision="4">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField minWidth="160px" ColumnID="TotalValue" DataField="TotalValue"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="总产值(万元)">
<Editor>
<f:NumberBox ID="NumberBox1" runat="server"
NoDecimal="false" NoNegative="false" EmptyText="0" DecimalPrecision="4">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField minWidth="160px" ColumnID="NewInvestment" DataField="NewInvestment"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="新增投资(万元)">
<Editor>
<f:NumberBox ID="NumberBox2" runat="server"
NoDecimal="false" NoNegative="false" EmptyText="0" DecimalPrecision="4">
</f:NumberBox>
</Editor>
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:Form>
<%--<f:Form ID="Form4" runat="server" ShowHeader="false" BodyPadding="5px">
<Items>
<f:FormRow>
<Items>
@ -90,41 +215,7 @@
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Form ID="Form6" runat="server" ShowHeader="false" BodyPadding="5px">
<Items>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注" LabelAlign="Right" LabelWidth="140px">
</f:TextBox>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Form ID="Form11" runat="server" ShowHeader="false" BodyPadding="5px">
<Items>
<f:FormRow>
<Items>
<f:TextBox ID="txtCompileMan" runat="server" Label="填报人" LabelAlign="Right" LabelWidth="140px">
</f:TextBox>
<f:TextBox ID="txtStatisticsDutyPerson" runat="server" Label="统计负责人" LabelAlign="Right" LabelWidth="140px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtUnitDutyPerson" runat="server" Label="单位负责人" LabelAlign="Right" LabelWidth="140px">
</f:TextBox>
<f:DatePicker ID="txtFillingDate" runat="server" Label="填报日期" LabelAlign="Right" LabelWidth="140px"
EnableEdit="true">
</f:DatePicker>
</Items>
</f:FormRow>
</Items>
</f:Form>
</f:GroupPanel>--%>
</Items>
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Bottom" ToolbarAlign="Right" runat="server">

View File

@ -1,10 +1,8 @@
using BLL;
using Microsoft.Office.Interop.Excel;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ZHGL.Environmental
@ -65,8 +63,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
this.btnSave.Hidden = false;
this.btnUpdata.Hidden = true;
}
ddlUnitId.SelectedValue = BLL.Const.UnitId_SEDIN;
BindGrid(year, quarter, unitId);
}
}
@ -92,53 +92,59 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.txtCompileMan.Text = operationReport.FillingMan.ToString();
}
if (!string.IsNullOrWhiteSpace(operationReport.UnitLevel))
{
this.txtUnitLevel.Text = operationReport.UnitLevel;
}
if (!string.IsNullOrWhiteSpace(operationReport.Place))
{
this.txtPlace.Text = operationReport.Place;
}
//if (!string.IsNullOrWhiteSpace(operationReport.UnitLevel))
//{
// this.txtUnitLevel.Text = operationReport.UnitLevel;
//}
//if (!string.IsNullOrWhiteSpace(operationReport.Place))
//{
// this.txtPlace.Text = operationReport.Place;
//}
if (operationReport.FillingDate != null)
{
this.txtFillingDate.Text = operationReport.FillingDate.Value.ToString("yyyy-MM-dd");
}
if (operationReport.CreateDate != null)
{
this.txtCreateDate.Text = operationReport.CreateDate.Value.ToString("yyyy-MM-dd");
}
if (!string.IsNullOrWhiteSpace(operationReport.Code))
{
this.txtCode.Text = operationReport.Code;
}
if (operationReport.PersonNum != null)
{
this.txtPersonNum.Text = operationReport.PersonNum.ToString();
}
if (operationReport.TotalAssets != null)
{
this.txtTotalAssets.Text = operationReport.TotalAssets.ToString();
}
if (operationReport.TotalValue != null)
{
this.txtTotalValue.Text = operationReport.TotalValue.ToString();
}
if (operationReport.NewInvestment != null)
{
this.txtNewInvestment.Text = operationReport.NewInvestment.ToString();
}
//if (operationReport.CreateDate != null)
//{
// this.txtCreateDate.Text = operationReport.CreateDate.Value.ToString("yyyy-MM-dd");
//}
//if (!string.IsNullOrWhiteSpace(operationReport.Code))
//{
// this.txtCode.Text = operationReport.Code;
//}
//if (operationReport.PersonNum != null)
//{
// this.txtPersonNum.Text = operationReport.PersonNum.ToString();
//}
//if (operationReport.TotalAssets != null)
//{
// this.txtTotalAssets.Text = operationReport.TotalAssets.ToString();
//}
//if (operationReport.TotalValue != null)
//{
// this.txtTotalValue.Text = operationReport.TotalValue.ToString();
//}
//if (operationReport.NewInvestment != null)
//{
// this.txtNewInvestment.Text = operationReport.NewInvestment.ToString();
//}
this.txtStatisticsDutyPerson.Text = operationReport.StatisticsDutyPerson;
this.txtUnitDutyPerson.Text = operationReport.UnitDutyPerson;
this.txtRemark.Text = operationReport.Remark;
//根据主表id加载子表
var reportItem = Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == operationReport.BusinessReportId)
.OrderBy(x => x.SortIndex).ToList();
Grid1.DataSource = reportItem;
Grid1.DataBind();
#endregion
}
}
else
{
#region
this.ddlUnitId.SelectedValue = unitId;
//this.ddlUnitId.SelectedValue = unitId;
this.drpYear.SelectedValue = year;
this.ddlQuarter.SelectedValue = quarter;
this.txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
@ -151,15 +157,57 @@ namespace FineUIPro.Web.ZHGL.Environmental
if (items.Any())
{
this.txtPersonNum.Text = items.Sum(s => s.PersonNum ?? 0).ToString();
this.txtTotalAssets.Text = items.Sum(s => s.TotalAssets ?? 0).ToString();
this.txtTotalValue.Text = items.Sum(s => s.TotalValue ?? 0).ToString();
this.txtNewInvestment.Text = items.Sum(s => s.NewInvestment ?? 0).ToString();
//this.txtPersonNum.Text = items.Sum(s => s.PersonNum ?? 0).ToString();
//this.txtTotalAssets.Text = items.Sum(s => s.TotalAssets ?? 0).ToString();
//this.txtTotalValue.Text = items.Sum(s => s.TotalValue ?? 0).ToString();
//this.txtNewInvestment.Text = items.Sum(s => s.NewInvestment ?? 0).ToString();
}
this.txtCompileMan.Text = this.CurrUser.PersonName;
this.txtStatisticsDutyPerson.Text = this.CurrUser.PersonName;
this.txtUnitDutyPerson.Text = this.CurrUser.PersonName;
//加载子表
var reportItemlist = new List<Model.Environmental_OperationReportItem>();
//第一个本单位
var isthisUnit = CommonService.GetIsThisUnit();
var reportItemModel = new Model.Environmental_OperationReportItem() {
BusinessReportItemId = Guid.NewGuid().ToString(),
SortIndex = 1,
UnitName = isthisUnit.UnitName,
SortUnitName= isthisUnit.UnitName,
Code = isthisUnit.UnitCode,
UnitLevel = "",
CreateDate=null,
Place= isthisUnit.Address,
PersonNum=0,
TotalAssets=0,
TotalValue=0,
NewInvestment=0,
};
reportItemlist.Add(reportItemModel);
//加载分单位
var unitList = Funs.DB.Base_Unit.Where(x => x.IsBranch == true).ToList();
foreach (var item in unitList)
{
var reportItemModelb = new Model.Environmental_OperationReportItem()
{
BusinessReportItemId = Guid.NewGuid().ToString(),
SortIndex = 1,
UnitName = item.UnitName,
SortUnitName = isthisUnit.UnitName,
Code = item.UnitCode,
UnitLevel = "",
CreateDate = null,
Place = item.Address,
PersonNum = 0,
TotalAssets = 0,
TotalValue = 0,
NewInvestment = 0,
};
reportItemlist.Add(reportItemModelb);
}
Grid1.DataSource = reportItemlist;
Grid1.DataBind();
#endregion
}
}
@ -220,14 +268,14 @@ namespace FineUIPro.Web.ZHGL.Environmental
operationReport.StatisticsDutyPerson = this.txtStatisticsDutyPerson.Text.Trim();
operationReport.UnitDutyPerson = this.txtUnitDutyPerson.Text.Trim();
operationReport.FillingDate = Funs.GetNewDateTime(this.txtFillingDate.Text);
operationReport.Code = this.txtCode.Text.Trim();
operationReport.PersonNum = Funs.GetNewInt(this.txtPersonNum.Text.Trim());
operationReport.TotalAssets = Funs.GetNewDecimalOrZero(this.txtTotalAssets.Text.Trim());
operationReport.TotalValue = Funs.GetNewDecimalOrZero(this.txtTotalValue.Text.Trim());
operationReport.NewInvestment = Funs.GetNewDecimalOrZero(this.txtNewInvestment.Text.Trim());
operationReport.UnitLevel = this.txtUnitLevel.Text.Trim();
operationReport.CreateDate = Funs.GetNewDateTime(this.txtCreateDate.Text);
operationReport.Place = this.txtPlace.Text.Trim();
//operationReport.Code = this.txtCode.Text.Trim();
//operationReport.PersonNum = Funs.GetNewInt(this.txtPersonNum.Text.Trim());
//operationReport.TotalAssets = Funs.GetNewDecimalOrZero(this.txtTotalAssets.Text.Trim());
//operationReport.TotalValue = Funs.GetNewDecimalOrZero(this.txtTotalValue.Text.Trim());
//operationReport.NewInvestment = Funs.GetNewDecimalOrZero(this.txtNewInvestment.Text.Trim());
//operationReport.UnitLevel = this.txtUnitLevel.Text.Trim();
//operationReport.CreateDate = Funs.GetNewDateTime(this.txtCreateDate.Text);
//operationReport.Place = this.txtPlace.Text.Trim();
operationReport.Remark = this.txtRemark.Text.Trim();
if (!string.IsNullOrEmpty(this.BusinessReportId))
@ -235,17 +283,17 @@ namespace FineUIPro.Web.ZHGL.Environmental
var model = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == this.BusinessReportId);
if (model != null)
{
model.Code = operationReport.Code;
model.PersonNum = operationReport.PersonNum;
model.TotalAssets = operationReport.TotalAssets;
model.TotalValue = operationReport.TotalValue;
model.NewInvestment = operationReport.NewInvestment;
//model.Code = operationReport.Code;
//model.PersonNum = operationReport.PersonNum;
//model.TotalAssets = operationReport.TotalAssets;
//model.TotalValue = operationReport.TotalValue;
//model.NewInvestment = operationReport.NewInvestment;
model.Quarters = operationReport.Quarters;
model.Year = operationReport.Year;
model.FillingMan = operationReport.FillingMan;
model.FillingDate = operationReport.FillingDate;
model.CreateDate = operationReport.CreateDate;
model.Place = operationReport.Place;
//model.CreateDate = operationReport.CreateDate;
//model.Place = operationReport.Place;
model.Remark = operationReport.Remark;
model.StatisticsDutyPerson = operationReport.StatisticsDutyPerson;
model.UnitDutyPerson = operationReport.UnitDutyPerson;
@ -255,6 +303,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
BLL.LogService.AddSys_Log(this.CurrUser, operationReport.Year.ToString() + "-" + operationReport.Quarters.ToString(), operationReport.BusinessReportId, BLL.Const.OperationReportMenuId, BLL.Const.BtnModify);
Funs.DB.SubmitChanges();
saveReportItem(operationReport.BusinessReportId);
}
}
else
@ -274,6 +323,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
BLL.Const.OperationReportMenuId, BLL.Const.BtnAdd);
Funs.DB.SubmitChanges();
saveReportItem(operationReport.BusinessReportId);
}
else
{
@ -293,6 +343,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else if (code == "3")
{
Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error);
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
@ -308,6 +362,49 @@ namespace FineUIPro.Web.ZHGL.Environmental
#endregion
#region
private void saveReportItem(string BusinessReportId) {
var list = Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == BusinessReportId).ToList();
//先删除
if (list.Count>0)
{
Funs.DB.Environmental_OperationReportItem.DeleteAllOnSubmit(list);
Funs.DB.SubmitChanges();
}
//再保存
JArray mergedData = Grid1.GetMergedData();
var reportItemlist = new List<Model.Environmental_OperationReportItem>();
var isthisUnit = CommonService.GetIsThisUnit();
foreach (var item in mergedData)
{
JObject values = item.Value<JObject>("values");
int i = item.Value<int>("index");
var model = new Model.Environmental_OperationReportItem() {
BusinessReportItemId= Grid1.Rows[i].DataKeys[0].ToString(),
BusinessReportId= BusinessReportId,
SortIndex= i+1,
UnitName = values.Value<string>("UnitName").ToString(),
SortUnitName= isthisUnit.UnitName,
Code= values.Value<string>("Code").ToString(),
UnitLevel= values.Value<string>("UnitLevel").ToString(),
Place= values.Value<string>("Place").ToString(),
PersonNum= values.Value<int>("PersonNum"),
TotalAssets= values.Value<decimal>("TotalAssets"),
TotalValue = values.Value<decimal>("TotalValue"),
NewInvestment = values.Value<decimal>("NewInvestment"),
};
if (!string.IsNullOrEmpty(values.Value<string>("CreateDate").ToString()))
{
model.CreateDate = Convert.ToDateTime(values.Value<string>("CreateDate").ToString());
}
reportItemlist.Add(model);
}
Funs.DB.Environmental_OperationReportItem.InsertAllOnSubmit(reportItemlist);
Funs.DB.SubmitChanges();
}
#endregion
#region
/// <summary>
/// 年季度变化事件

View File

@ -77,141 +77,6 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// </remarks>
protected global::FineUIPro.DropDownList ddlQuarter;
/// <summary>
/// Form4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form4;
/// <summary>
/// txtCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCode;
/// <summary>
/// GroupPanel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupPanel GroupPanel1;
/// <summary>
/// Form3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form3;
/// <summary>
/// txtUnitLevel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUnitLevel;
/// <summary>
/// txtCreateDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtCreateDate;
/// <summary>
/// txtPlace 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPlace;
/// <summary>
/// txtPersonNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtPersonNum;
/// <summary>
/// GroupPanel2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupPanel GroupPanel2;
/// <summary>
/// Form5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form5;
/// <summary>
/// txtTotalAssets 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtTotalAssets;
/// <summary>
/// txtTotalValue 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtTotalValue;
/// <summary>
/// txtNewInvestment 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtNewInvestment;
/// <summary>
/// Form6 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form6;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemark;
/// <summary>
/// Form11 控件。
/// </summary>
@ -257,6 +122,123 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// </remarks>
protected global::FineUIPro.DatePicker txtFillingDate;
/// <summary>
/// Form6 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form6;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemark;
/// <summary>
/// Form4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form4;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// TextBox1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox TextBox1;
/// <summary>
/// TextBox2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox TextBox2;
/// <summary>
/// TextBox3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox TextBox3;
/// <summary>
/// DatePicker1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker DatePicker1;
/// <summary>
/// TextBox4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox TextBox4;
/// <summary>
/// txtPersonNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtPersonNum;
/// <summary>
/// txtTotalAssets 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtTotalAssets;
/// <summary>
/// NumberBox1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox NumberBox1;
/// <summary>
/// NumberBox2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox NumberBox2;
/// <summary>
/// Toolbar2 控件。
/// </summary>

View File

@ -32,8 +32,8 @@
<TreeNode id="ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14" Text="化工行业能源节约与生态环境保护汇总表" NavigateUrl="ZHGL/Environmental/ChemicalReport.aspx"></TreeNode>
<TreeNode id="7652D239-1897-4886-8DF2-B71E3B060D21" Text="中央企业节能环保产业企业基本情况和经营情况报表" NavigateUrl="ZHGL/Environmental/OperationReport.aspx"></TreeNode>
<TreeNode id="30579BFE-AB4B-49A7-A73D-B7CE902A8B69" Text="中央企业节能环保产业企业生产和服务业务情况报表" NavigateUrl="ZHGL/Environmental/EnergyReport.aspx"></TreeNode>
<TreeNode id="CB76394B-BDEB-4F45-9D19-F38612DC6591" Text="中央企业安全生产治本攻坚三年行动工作台账" NavigateUrl="ZHGL/Information/ActionWorkLedger.aspx"></TreeNode>
<TreeNode id="C48087A8-4C9F-485D-B0A4-C85E112BA705" Text="中央企业安全生产管理评价工作调度台账" NavigateUrl="ZHGL/Information/SafetyProductionEvaluation.aspx"></TreeNode>
<TreeNode id="CB76394B-BDEB-4F45-9D19-F38612DC6591" Text="安全生产治本攻坚三年行动工作台账" NavigateUrl="ZHGL/Information/ActionWorkLedger.aspx"></TreeNode>
<TreeNode id="C48087A8-4C9F-485D-B0A4-C85E112BA705" Text="安全生产管理评价工作调度台账" NavigateUrl="ZHGL/Information/SafetyProductionEvaluation.aspx"></TreeNode>
</TreeNode>
<TreeNode id="76E236DA-DDFC-4CE8-8CB8-02F8A27A8535" Text="专业技术方案评审" NavigateUrl=""><TreeNode id="B6A2B6EB-6B90-4953-B544-83FFF4F0EC19" Text="安全实施计划" NavigateUrl="ZHGL/Plan/ActionPlanList.aspx"></TreeNode>
<TreeNode id="B9ADD006-BA46-4191-BCD1-CCB56767C82B" Text="总包施工质量计划" NavigateUrl="ZHGL/Plan/MainPlan.aspx"></TreeNode>

View File

@ -38,15 +38,6 @@ namespace Model
set;
}
/// <summary>
/// 季度
/// </summary>
public int? Quarter
{
get;
set;
}
/// <summary>
///
/// </summary>
@ -125,5 +116,13 @@ namespace Model
get;
set;
}
/// <summary>
/// 季度
/// </summary>
public int? Quarter
{
get;
set;
}
}
}

View File

@ -100,6 +100,7 @@ namespace Model
/// 服务营业收入-本年
///</summary>
public string ServiceOperatingIncome_ThisYear { get; set; }
public int? SortUnit { get; set; }
}
}

View File

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
/// <summary>
///
/// </summary>
public class Environmental_OperationReportDto
{
public string BusinessReportId { get; set; }
public string UnitId { get; set; }
public int? Year { get; set; }
public int? Quarters { get; set; }
public string FillingMan { get; set; }
public DateTime? FillingDate { get; set; }
public string StatisticsDutyPerson { get; set; }
public string UnitDutyPerson { get; set; }
public string Remark { get; set; }
public string UpState { get; set; }
/// <summary>
/// 子表数据
/// </summary>
public List<reportItemListDto> reportItemList
{
get;
set;
}
}
/// <summary>
///
/// </summary>
public class reportItemListDto
{
public string BusinessReportItemId { get; set; }
public string BusinessReportId { get; set; }
public int? SortIndex { get; set; }
public string Code { get; set; }
public string UnitLevel { get; set; }
public DateTime? CreateDate { get; set; }
public string Place { get; set; }
public int? PersonNum { get; set; }
public decimal? TotalAssets { get; set; }
public decimal? TotalValue { get; set; }
public decimal? NewInvestment { get; set; }
public string UnitName { get; set; }
public string SortUnitName { get; set; }
}
}

View File

@ -530,6 +530,9 @@ namespace Model
partial void InsertEnvironmental_OperationReport(Environmental_OperationReport instance);
partial void UpdateEnvironmental_OperationReport(Environmental_OperationReport instance);
partial void DeleteEnvironmental_OperationReport(Environmental_OperationReport instance);
partial void InsertEnvironmental_OperationReportItem(Environmental_OperationReportItem instance);
partial void UpdateEnvironmental_OperationReportItem(Environmental_OperationReportItem instance);
partial void DeleteEnvironmental_OperationReportItem(Environmental_OperationReportItem instance);
partial void InsertEnvironmental_ProjectArchitectureReport(Environmental_ProjectArchitectureReport instance);
partial void UpdateEnvironmental_ProjectArchitectureReport(Environmental_ProjectArchitectureReport instance);
partial void DeleteEnvironmental_ProjectArchitectureReport(Environmental_ProjectArchitectureReport instance);
@ -3200,6 +3203,14 @@ namespace Model
}
}
public System.Data.Linq.Table<Environmental_OperationReportItem> Environmental_OperationReportItem
{
get
{
return this.GetTable<Environmental_OperationReportItem>();
}
}
public System.Data.Linq.Table<Environmental_ProjectArchitectureReport> Environmental_ProjectArchitectureReport
{
get
@ -75436,6 +75447,8 @@ namespace Model
private string _ServiceOperatingIncome_ThisYear;
private System.Nullable<int> _SortUnit;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
@ -75484,6 +75497,8 @@ namespace Model
partial void OnServiceOperatingIncome_LastYearChanged();
partial void OnServiceOperatingIncome_ThisYearChanging(string value);
partial void OnServiceOperatingIncome_ThisYearChanged();
partial void OnSortUnitChanging(System.Nullable<int> value);
partial void OnSortUnitChanged();
#endregion
public Environmental_EnergyReportItem()
@ -75931,6 +75946,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortUnit", DbType="Int")]
public System.Nullable<int> SortUnit
{
get
{
return this._SortUnit;
}
set
{
if ((this._SortUnit != value))
{
this.OnSortUnitChanging(value);
this.SendPropertyChanging();
this._SortUnit = value;
this.SendPropertyChanged("SortUnit");
this.OnSortUnitChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
@ -76556,22 +76591,6 @@ namespace Model
private System.Nullable<int> _Quarters;
private string _Code;
private string _UnitLevel;
private System.Nullable<System.DateTime> _CreateDate;
private string _Place;
private System.Nullable<int> _PersonNum;
private System.Nullable<decimal> _TotalAssets;
private System.Nullable<decimal> _TotalValue;
private System.Nullable<decimal> _NewInvestment;
private string _FillingMan;
private System.Nullable<System.DateTime> _FillingDate;
@ -76586,6 +76605,8 @@ namespace Model
private EntityRef<Base_Unit> _Base_Unit;
private EntitySet<Environmental_OperationReportItem> _Environmental_OperationReportItem;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
@ -76598,22 +76619,6 @@ namespace Model
partial void OnYearChanged();
partial void OnQuartersChanging(System.Nullable<int> value);
partial void OnQuartersChanged();
partial void OnCodeChanging(string value);
partial void OnCodeChanged();
partial void OnUnitLevelChanging(string value);
partial void OnUnitLevelChanged();
partial void OnCreateDateChanging(System.Nullable<System.DateTime> value);
partial void OnCreateDateChanged();
partial void OnPlaceChanging(string value);
partial void OnPlaceChanged();
partial void OnPersonNumChanging(System.Nullable<int> value);
partial void OnPersonNumChanged();
partial void OnTotalAssetsChanging(System.Nullable<decimal> value);
partial void OnTotalAssetsChanged();
partial void OnTotalValueChanging(System.Nullable<decimal> value);
partial void OnTotalValueChanged();
partial void OnNewInvestmentChanging(System.Nullable<decimal> value);
partial void OnNewInvestmentChanged();
partial void OnFillingManChanging(string value);
partial void OnFillingManChanged();
partial void OnFillingDateChanging(System.Nullable<System.DateTime> value);
@ -76631,6 +76636,7 @@ namespace Model
public Environmental_OperationReport()
{
this._Base_Unit = default(EntityRef<Base_Unit>);
this._Environmental_OperationReportItem = new EntitySet<Environmental_OperationReportItem>(new Action<Environmental_OperationReportItem>(this.attach_Environmental_OperationReportItem), new Action<Environmental_OperationReportItem>(this.detach_Environmental_OperationReportItem));
OnCreated();
}
@ -76718,6 +76724,342 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FillingMan", DbType="NVarChar(50)")]
public string FillingMan
{
get
{
return this._FillingMan;
}
set
{
if ((this._FillingMan != value))
{
this.OnFillingManChanging(value);
this.SendPropertyChanging();
this._FillingMan = value;
this.SendPropertyChanged("FillingMan");
this.OnFillingManChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FillingDate", DbType="DateTime")]
public System.Nullable<System.DateTime> FillingDate
{
get
{
return this._FillingDate;
}
set
{
if ((this._FillingDate != value))
{
this.OnFillingDateChanging(value);
this.SendPropertyChanging();
this._FillingDate = value;
this.SendPropertyChanged("FillingDate");
this.OnFillingDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsDutyPerson", DbType="NVarChar(50)")]
public string StatisticsDutyPerson
{
get
{
return this._StatisticsDutyPerson;
}
set
{
if ((this._StatisticsDutyPerson != value))
{
this.OnStatisticsDutyPersonChanging(value);
this.SendPropertyChanging();
this._StatisticsDutyPerson = value;
this.SendPropertyChanged("StatisticsDutyPerson");
this.OnStatisticsDutyPersonChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitDutyPerson", DbType="NVarChar(50)")]
public string UnitDutyPerson
{
get
{
return this._UnitDutyPerson;
}
set
{
if ((this._UnitDutyPerson != value))
{
this.OnUnitDutyPersonChanging(value);
this.SendPropertyChanging();
this._UnitDutyPerson = value;
this.SendPropertyChanged("UnitDutyPerson");
this.OnUnitDutyPersonChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")]
public string Remark
{
get
{
return this._Remark;
}
set
{
if ((this._Remark != value))
{
this.OnRemarkChanging(value);
this.SendPropertyChanging();
this._Remark = value;
this.SendPropertyChanged("Remark");
this.OnRemarkChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UpState", DbType="Char(1)")]
public string UpState
{
get
{
return this._UpState;
}
set
{
if ((this._UpState != value))
{
this.OnUpStateChanging(value);
this.SendPropertyChanging();
this._UpState = value;
this.SendPropertyChanged("UpState");
this.OnUpStateChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Environmental_OperationReport_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)]
public Base_Unit Base_Unit
{
get
{
return this._Base_Unit.Entity;
}
set
{
Base_Unit previousValue = this._Base_Unit.Entity;
if (((previousValue != value)
|| (this._Base_Unit.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Base_Unit.Entity = null;
previousValue.Environmental_OperationReport.Remove(this);
}
this._Base_Unit.Entity = value;
if ((value != null))
{
value.Environmental_OperationReport.Add(this);
this._UnitId = value.UnitId;
}
else
{
this._UnitId = default(string);
}
this.SendPropertyChanged("Base_Unit");
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Environmental_OperationReportItem_Environmental_OperationReport", Storage="_Environmental_OperationReportItem", ThisKey="BusinessReportId", OtherKey="BusinessReportId", DeleteRule="NO ACTION")]
public EntitySet<Environmental_OperationReportItem> Environmental_OperationReportItem
{
get
{
return this._Environmental_OperationReportItem;
}
set
{
this._Environmental_OperationReportItem.Assign(value);
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
private void attach_Environmental_OperationReportItem(Environmental_OperationReportItem entity)
{
this.SendPropertyChanging();
entity.Environmental_OperationReport = this;
}
private void detach_Environmental_OperationReportItem(Environmental_OperationReportItem entity)
{
this.SendPropertyChanging();
entity.Environmental_OperationReport = null;
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Environmental_OperationReportItem")]
public partial class Environmental_OperationReportItem : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _BusinessReportItemId;
private string _BusinessReportId;
private System.Nullable<int> _SortIndex;
private string _Code;
private string _UnitLevel;
private System.Nullable<System.DateTime> _CreateDate;
private string _Place;
private System.Nullable<int> _PersonNum;
private System.Nullable<decimal> _TotalAssets;
private System.Nullable<decimal> _TotalValue;
private System.Nullable<decimal> _NewInvestment;
private string _UnitName;
private string _SortUnitName;
private EntityRef<Environmental_OperationReport> _Environmental_OperationReport;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnBusinessReportItemIdChanging(string value);
partial void OnBusinessReportItemIdChanged();
partial void OnBusinessReportIdChanging(string value);
partial void OnBusinessReportIdChanged();
partial void OnSortIndexChanging(System.Nullable<int> value);
partial void OnSortIndexChanged();
partial void OnCodeChanging(string value);
partial void OnCodeChanged();
partial void OnUnitLevelChanging(string value);
partial void OnUnitLevelChanged();
partial void OnCreateDateChanging(System.Nullable<System.DateTime> value);
partial void OnCreateDateChanged();
partial void OnPlaceChanging(string value);
partial void OnPlaceChanged();
partial void OnPersonNumChanging(System.Nullable<int> value);
partial void OnPersonNumChanged();
partial void OnTotalAssetsChanging(System.Nullable<decimal> value);
partial void OnTotalAssetsChanged();
partial void OnTotalValueChanging(System.Nullable<decimal> value);
partial void OnTotalValueChanged();
partial void OnNewInvestmentChanging(System.Nullable<decimal> value);
partial void OnNewInvestmentChanged();
partial void OnUnitNameChanging(string value);
partial void OnUnitNameChanged();
partial void OnSortUnitNameChanging(string value);
partial void OnSortUnitNameChanged();
#endregion
public Environmental_OperationReportItem()
{
this._Environmental_OperationReport = default(EntityRef<Environmental_OperationReport>);
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BusinessReportItemId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string BusinessReportItemId
{
get
{
return this._BusinessReportItemId;
}
set
{
if ((this._BusinessReportItemId != value))
{
this.OnBusinessReportItemIdChanging(value);
this.SendPropertyChanging();
this._BusinessReportItemId = value;
this.SendPropertyChanged("BusinessReportItemId");
this.OnBusinessReportItemIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BusinessReportId", DbType="NVarChar(50)")]
public string BusinessReportId
{
get
{
return this._BusinessReportId;
}
set
{
if ((this._BusinessReportId != value))
{
if (this._Environmental_OperationReport.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnBusinessReportIdChanging(value);
this.SendPropertyChanging();
this._BusinessReportId = value;
this.SendPropertyChanged("BusinessReportId");
this.OnBusinessReportIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")]
public System.Nullable<int> SortIndex
{
get
{
return this._SortIndex;
}
set
{
if ((this._SortIndex != value))
{
this.OnSortIndexChanging(value);
this.SendPropertyChanging();
this._SortIndex = value;
this.SendPropertyChanged("SortIndex");
this.OnSortIndexChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Code", DbType="NVarChar(50)")]
public string Code
{
@ -76878,156 +77220,76 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FillingMan", DbType="NVarChar(50)")]
public string FillingMan
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitName", DbType="NVarChar(200)")]
public string UnitName
{
get
{
return this._FillingMan;
return this._UnitName;
}
set
{
if ((this._FillingMan != value))
if ((this._UnitName != value))
{
this.OnFillingManChanging(value);
this.OnUnitNameChanging(value);
this.SendPropertyChanging();
this._FillingMan = value;
this.SendPropertyChanged("FillingMan");
this.OnFillingManChanged();
this._UnitName = value;
this.SendPropertyChanged("UnitName");
this.OnUnitNameChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FillingDate", DbType="DateTime")]
public System.Nullable<System.DateTime> FillingDate
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortUnitName", DbType="NVarChar(200)")]
public string SortUnitName
{
get
{
return this._FillingDate;
return this._SortUnitName;
}
set
{
if ((this._FillingDate != value))
if ((this._SortUnitName != value))
{
this.OnFillingDateChanging(value);
this.OnSortUnitNameChanging(value);
this.SendPropertyChanging();
this._FillingDate = value;
this.SendPropertyChanged("FillingDate");
this.OnFillingDateChanged();
this._SortUnitName = value;
this.SendPropertyChanged("SortUnitName");
this.OnSortUnitNameChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsDutyPerson", DbType="NVarChar(50)")]
public string StatisticsDutyPerson
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Environmental_OperationReportItem_Environmental_OperationReport", Storage="_Environmental_OperationReport", ThisKey="BusinessReportId", OtherKey="BusinessReportId", IsForeignKey=true)]
public Environmental_OperationReport Environmental_OperationReport
{
get
{
return this._StatisticsDutyPerson;
return this._Environmental_OperationReport.Entity;
}
set
{
if ((this._StatisticsDutyPerson != value))
{
this.OnStatisticsDutyPersonChanging(value);
this.SendPropertyChanging();
this._StatisticsDutyPerson = value;
this.SendPropertyChanged("StatisticsDutyPerson");
this.OnStatisticsDutyPersonChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitDutyPerson", DbType="NVarChar(50)")]
public string UnitDutyPerson
{
get
{
return this._UnitDutyPerson;
}
set
{
if ((this._UnitDutyPerson != value))
{
this.OnUnitDutyPersonChanging(value);
this.SendPropertyChanging();
this._UnitDutyPerson = value;
this.SendPropertyChanged("UnitDutyPerson");
this.OnUnitDutyPersonChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")]
public string Remark
{
get
{
return this._Remark;
}
set
{
if ((this._Remark != value))
{
this.OnRemarkChanging(value);
this.SendPropertyChanging();
this._Remark = value;
this.SendPropertyChanged("Remark");
this.OnRemarkChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UpState", DbType="Char(1)")]
public string UpState
{
get
{
return this._UpState;
}
set
{
if ((this._UpState != value))
{
this.OnUpStateChanging(value);
this.SendPropertyChanging();
this._UpState = value;
this.SendPropertyChanged("UpState");
this.OnUpStateChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Environmental_OperationReport_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)]
public Base_Unit Base_Unit
{
get
{
return this._Base_Unit.Entity;
}
set
{
Base_Unit previousValue = this._Base_Unit.Entity;
Environmental_OperationReport previousValue = this._Environmental_OperationReport.Entity;
if (((previousValue != value)
|| (this._Base_Unit.HasLoadedOrAssignedValue == false)))
|| (this._Environmental_OperationReport.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Base_Unit.Entity = null;
previousValue.Environmental_OperationReport.Remove(this);
this._Environmental_OperationReport.Entity = null;
previousValue.Environmental_OperationReportItem.Remove(this);
}
this._Base_Unit.Entity = value;
this._Environmental_OperationReport.Entity = value;
if ((value != null))
{
value.Environmental_OperationReport.Add(this);
this._UnitId = value.UnitId;
value.Environmental_OperationReportItem.Add(this);
this._BusinessReportId = value.BusinessReportId;
}
else
{
this._UnitId = default(string);
this._BusinessReportId = default(string);
}
this.SendPropertyChanged("Base_Unit");
this.SendPropertyChanged("Environmental_OperationReport");
}
}
}

View File

@ -73,6 +73,7 @@
<Compile Include="APIItem\DigData\SafeLawItem.cs" />
<Compile Include="APIItem\EnergyReport.cs" />
<Compile Include="APIItem\EnergyReportItem.cs" />
<Compile Include="APIItem\Environmental_OperationReportDto.cs" />
<Compile Include="APIItem\EPSummaryReport.cs" />
<Compile Include="APIItem\HJGL\AttachSourceItems.cs" />
<Compile Include="APIItem\HJGL\BatchItem.cs" />