/// <summary> /// 删除经费统计 /// </summary> /// <param name="entity">实体对象</param> /// <returns></returns> public override bool Delete(Fund entity) { // delete the records FundRecordBusiness recordBusiness = new FundRecordBusiness(); recordBusiness.DeleteByFund(entity.Id); return(base.Delete(entity)); }
/// <summary> /// 导入经费记录 /// </summary> /// <param name="fundId">经费统计ID</param> /// <param name="departmentId">部门ID</param> /// <returns></returns> public List <AllowanceTarget> ImportFund(string fundId, string departmentId) { List <AllowanceTarget> data = new List <AllowanceTarget>(); var frBusiness = new FundRecordBusiness(); var fundRecord = frBusiness.FindByDepartment(fundId, departmentId); if (fundRecord == null) { return(data); } if (fundRecord.HorizontalResearch > 0) { AllowanceTarget at = new AllowanceTarget(); at.Name = "横向科研"; at.Code = EnergyConstant.HorizontalResearchCode; at.Cardinal = fundRecord.HorizontalResearch; at.Factor = 0.0005m; at.MonthCount = 1; at.MonthKilowatt = 1; at.UnitPrice = 0.6m; at.YearAmount = Math.Round(at.Factor * at.Cardinal, 0); at.YearKilowatt = Math.Round(at.YearAmount / at.UnitPrice, 0); at.Remark = ""; data.Add(at); } if (fundRecord.VerticalResearch > 0) { AllowanceTarget at = new AllowanceTarget(); at.Name = "纵向科研"; at.Code = EnergyConstant.VerticalResearchCode; at.Cardinal = fundRecord.VerticalResearch; at.Factor = 0.0025m; at.MonthCount = 1; at.MonthKilowatt = 1; at.UnitPrice = 0.6m; at.YearAmount = Math.Round(at.Factor * at.Cardinal, 0); at.YearKilowatt = Math.Round(at.YearAmount / at.UnitPrice, 0); at.Remark = ""; data.Add(at); } return(data); }