public int DeletebyScreenCD(NZString ScreenCD) { CommonLib.Common.CurrentDatabase.KeepConnection = true; CommonLib.Common.CurrentDatabase.BeginTransaction(); try { IScreenDAO dao = DAOFactory.CreateScreenDAO(CommonLib.Common.CurrentDatabase); dao.DeleteByScreenCD(null, ScreenCD.StrongValue); CommonLib.Common.CurrentDatabase.Commit(); return(1); } catch { CommonLib.Common.CurrentDatabase.Rollback(); throw; } }
public bool ClearData(List <string> ScreenCDList) { IScreenDAO daoScreen = DAOFactory.CreateScreenDAO(CommonLib.Common.CurrentDatabase); IScreenLangDAO daoScreenLang = DAOFactory.CreateScreenLangDAO(CommonLib.Common.CurrentDatabase); IScreenDetailDAO daoScreenDetail = DAOFactory.CreateScreenDetailDAO(CommonLib.Common.CurrentDatabase); IScreenDetailLangDAO daoScreenDetailLang = DAOFactory.CreateScreenDetailLangDAO(CommonLib.Common.CurrentDatabase); CommonLib.Common.CurrentDatabase.KeepConnection = true; CommonLib.Common.CurrentDatabase.BeginTransaction(); foreach (string ScreenCD in ScreenCDList) { daoScreen.DeleteByScreenCD(CommonLib.Common.CurrentDatabase, ScreenCD); daoScreenLang.DeleteByScreenCD(CommonLib.Common.CurrentDatabase, ScreenCD); daoScreenDetail.DeleteByScreenCD(CommonLib.Common.CurrentDatabase, ScreenCD); daoScreenDetailLang.DeleteByScreenCD(CommonLib.Common.CurrentDatabase, ScreenCD); } CommonLib.Common.CurrentDatabase.Commit(); return(true); }