public static void DeletePBSUnit(string PBSUnitCode) { try { EntityData entity = ProductDAO.GetBuildingByPBSUnitCode(PBSUnitCode); foreach (DataRow row in entity.CurrentTable.Rows) { string text = row["BuildingCode"].ToString(); row["PBSUnitCode"] = DBNull.Value; } ProductDAO.UpdateBuilding(entity); entity.Dispose(); entity = ConstructDAO.GetConstructAnnualPlanByPBSUnit(PBSUnitCode); if (entity.HasRecord()) { ConstructDAO.DeleteConstructAnnualPlan(entity); } entity.Dispose(); entity = ConstructDAO.GetConstructPlanStepByPBSUnit(PBSUnitCode); if (entity.HasRecord()) { ConstructDAO.DeleteConstructPlanStep(entity); } entity.Dispose(); entity = ConstructDAO.GetConstructProgressRiskByPBSUnitCode(PBSUnitCode); if (entity.HasRecord()) { ConstructDAO.DeleteConstructProgressRisk(entity); } entity.Dispose(); entity = ConstructDAO.GetConstructProgressByPBSUnit(PBSUnitCode); if (entity.HasRecord()) { ConstructDAO.DeleteConstructProgress(entity); } entity.Dispose(); entity = ConstructDAO.GetConstructProgressStepByPBSUnit(PBSUnitCode); if (entity.HasRecord()) { ConstructDAO.DeleteConstructProgressStep(entity); } entity.Dispose(); entity = PBSDAO.GetPBSUnitByCode(PBSUnitCode); if (entity.HasRecord()) { PBSDAO.DeletePBSUnit(entity); } entity.Dispose(); } catch (Exception exception) { throw exception; } }
public static void DeleteConstructAnnualPlan(string ProjectCode, int IYear) { try { if (ProjectCode != "") { EntityData entity = ConstructDAO.GetConstructPlanStepByProjectYear(ProjectCode, IYear); ConstructDAO.DeleteConstructPlanStep(entity); entity.Dispose(); EntityData constructAnnualPlanByProjectYear = ConstructDAO.GetConstructAnnualPlanByProjectYear(ProjectCode, IYear); ConstructDAO.DeleteConstructAnnualPlan(constructAnnualPlanByProjectYear); constructAnnualPlanByProjectYear.Dispose(); } } catch (Exception exception) { throw exception; } }
public static void DeleteConstructAnnualPlan(string AnnuelPlanCode) { try { if (AnnuelPlanCode != "") { EntityData entity = ConstructDAO.GetConstructAnnualPlanByCode(AnnuelPlanCode); if (entity.HasRecord()) { string pBSUnitCode = entity.GetString("PBSUnitCode"); int iYear = entity.GetInt("IYear"); EntityData constructPlanStepByPBSUnitYear = ConstructDAO.GetConstructPlanStepByPBSUnitYear(pBSUnitCode, iYear); ConstructDAO.DeleteConstructPlanStep(constructPlanStepByPBSUnitYear); constructPlanStepByPBSUnitYear.Dispose(); } ConstructDAO.DeleteConstructAnnualPlan(entity); entity.Dispose(); } } catch (Exception exception) { throw exception; } }