public bool SaveUserDriverLicenses(int UserID, ArrayList arrDriverLicenses) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { Tran.BeginTransaction(); PIKCV.DAL.UserDriverLicense obj = new PIKCV.DAL.UserDriverLicense(); obj.Where.UserID.Value = UserID; obj.Query.Load(); obj.DeleteAll(); obj.Save(); for (int i = 0; i < arrDriverLicenses.Count; i++) { obj.AddNew(); obj.UserID = UserID; obj.DriverLicenseTypeID = Convert.ToInt32(arrDriverLicenses[i]); obj.Save(); } Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public DataTable GetUserDriverLicenses(int UserID, PIKCV.COM.EnumDB.LanguageID LanguageID) { try { PIKCV.DAL.UserDriverLicense obj = new PIKCV.DAL.UserDriverLicense(); return(obj.GetUserDriverLicense(UserID, (int)LanguageID)); } catch (Exception) { return(null); } return(null); }