Exemple #1
0
        ///<Summary>
        ///AddLogin
        ///This method persists a BOLogin object to the database collection
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BOLogin
        ///</parameters>
        public virtual void AddLogin(BOLogin boLogin)
        {
            DAOLogin daoLogin = new DAOLogin();

            RegisterDataObject(daoLogin);
            BeginTransaction("addLogin");
            try
            {
                daoLogin.Id           = boLogin.Id;
                daoLogin.Username     = boLogin.Username;
                daoLogin.Password     = boLogin.Password;
                daoLogin.Technicianid = _id.Value;
                daoLogin.Insert();
                CommitTransaction();

                /*pick up any primary keys, computed values etc*/
                boLogin = new BOLogin(daoLogin);
                if (_boLoginCollection != null)
                {
                    _boLoginCollection.Add(boLogin);
                }
            }
            catch
            {
                RollbackTransaction("addLogin");
                throw;
            }
        }
Exemple #2
0
 ///<Summary>
 ///LoginCollectionFromSearchFieldsCount
 ///This method returns the collection count of BOLogin objects, filtered by a search object
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 LoginCollectionFromSearchFieldsCount(BOLogin boLogin)
 {
     try
     {
         DAOLogin daoLogin = new DAOLogin();
         daoLogin.Id           = boLogin.Id;
         daoLogin.Username     = boLogin.Username;
         daoLogin.Password     = boLogin.Password;
         daoLogin.Technicianid = boLogin.Technicianid;
         Int32 objCount = DAOLogin.SelectAllBySearchFieldsCount(daoLogin);
         return(objCount);
     }
     catch
     {
         throw;
     }
 }
Exemple #3
0
        ///<Summary>
        ///LoginCollectionFromSearchFields
        ///This method returns the collection of BOLogin objects, filtered by a search object
        ///</Summary>
        ///<returns>
        ///List<BOLogin>
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BOLogin> LoginCollectionFromSearchFields(BOLogin boLogin)
        {
            try
            {
                IList <BOLogin> boLoginCollection = new List <BOLogin>();
                DAOLogin        daoLogin          = new DAOLogin();
                daoLogin.Id           = boLogin.Id;
                daoLogin.Username     = boLogin.Username;
                daoLogin.Password     = boLogin.Password;
                daoLogin.Technicianid = boLogin.Technicianid;
                IList <DAOLogin> daoLoginCollection = DAOLogin.SelectAllBySearchFields(daoLogin);

                foreach (DAOLogin resdaoLogin in daoLoginCollection)
                {
                    boLoginCollection.Add(new BOLogin(resdaoLogin));
                }

                return(boLoginCollection);
            }
            catch
            {
                throw;
            }
        }