public static void UpdateConstructAnnualPlanInvest(string PBSUnitCode) { try { if (PBSUnitCode != "") { EntityData pBSUnitByCode = PBSDAO.GetPBSUnitByCode(PBSUnitCode); if (pBSUnitByCode.HasRecord()) { decimal totalInvest = ConvertRule.ToDecimal(pBSUnitByCode.CurrentRow["PInvest"]); EntityData entity = ConstructDAO.GetConstructAnnualPlanByPBSUnit(PBSUnitCode); foreach (DataRow row2 in entity.CurrentTable.Rows) { string visualProgress = ConvertRule.ToString(row2["VisualProgress"]); int currFloorCount = ConvertRule.ToInt(row2["CurrentFloor"]); int totalFloorCount = PBSRule.GetPBSUnitFloorCount(PBSUnitCode); decimal num4 = CalcInvestByVisualProgress(totalInvest, visualProgress, totalFloorCount, currFloorCount); decimal num5 = ConvertRule.ToDecimal(row2["InvestBefore"]); decimal num6 = num4 - num5; row2["PInvest"] = num6; } ConstructDAO.UpdateConstructAnnualPlan(entity); entity.Dispose(); pBSUnitByCode.Dispose(); } } } catch (Exception exception) { throw exception; } }
public static decimal CalcPBSUnitCompleteInvest(string PBSUnitCode) { decimal num5; try { decimal num = 0M; EntityData data = PBSDAO.GetV_PBSUnitByCode(PBSUnitCode); if (data.HasRecord()) { decimal totalInvest = data.GetDecimal("PInvest"); string visualProgress = data.GetString("VisualProgress"); int totalFloorCount = PBSRule.GetPBSUnitFloorCount(PBSUnitCode); int currFloorCount = PBSRule.GetPBSUnitCurrentFloorCount(PBSUnitCode); num = CalcInvestByVisualProgress(totalInvest, visualProgress, totalFloorCount, currFloorCount); } data.Dispose(); num5 = num; } catch (Exception exception) { throw exception; } return(num5); }