예제 #1
0
파일: UserCVs.cs 프로젝트: jiqsaw/pikcv
        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);
            }
        }
예제 #2
0
파일: UserCVs.cs 프로젝트: jiqsaw/pikcv
 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);
 }