Beispiel #1
0
        ///<Summary>
        ///AddTechnician
        ///This method persists a BOTechnician object to the database collection
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BOTechnician
        ///</parameters>
        public virtual void AddTechnician(BOTechnician boTechnician)
        {
            DAOTechnician daoTechnician = new DAOTechnician();

            RegisterDataObject(daoTechnician);
            BeginTransaction("addTechnician");
            try
            {
                daoTechnician.Id            = boTechnician.Id;
                daoTechnician.Name          = boTechnician.Name;
                daoTechnician.Designationid = boTechnician.Designationid;
                daoTechnician.Roleid        = _id.Value;
                daoTechnician.Insert();
                CommitTransaction();

                /*pick up any primary keys, computed values etc*/
                boTechnician = new BOTechnician(daoTechnician);
                if (_boTechnicianCollection != null)
                {
                    _boTechnicianCollection.Add(boTechnician);
                }
            }
            catch
            {
                RollbackTransaction("addTechnician");
                throw;
            }
        }
Beispiel #2
0
 ///<Summary>
 ///TechnicianCollectionFromSearchFieldsCount
 ///This method returns the collection count of BOTechnician objects, filtered by a search object
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 TechnicianCollectionFromSearchFieldsCount(BOTechnician boTechnician)
 {
     try
     {
         DAOTechnician daoTechnician = new DAOTechnician();
         daoTechnician.Id            = boTechnician.Id;
         daoTechnician.Name          = boTechnician.Name;
         daoTechnician.Designationid = boTechnician.Designationid;
         daoTechnician.Roleid        = boTechnician.Roleid;
         Int32 objCount = DAOTechnician.SelectAllBySearchFieldsCount(daoTechnician);
         return(objCount);
     }
     catch
     {
         throw;
     }
 }
Beispiel #3
0
        ///<Summary>
        ///TechnicianCollectionFromSearchFields
        ///This method returns the collection of BOTechnician objects, filtered by a search object
        ///</Summary>
        ///<returns>
        ///List<BOTechnician>
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BOTechnician> TechnicianCollectionFromSearchFields(BOTechnician boTechnician)
        {
            try
            {
                IList <BOTechnician> boTechnicianCollection = new List <BOTechnician>();
                DAOTechnician        daoTechnician          = new DAOTechnician();
                daoTechnician.Id            = boTechnician.Id;
                daoTechnician.Name          = boTechnician.Name;
                daoTechnician.Designationid = boTechnician.Designationid;
                daoTechnician.Roleid        = boTechnician.Roleid;
                IList <DAOTechnician> daoTechnicianCollection = DAOTechnician.SelectAllBySearchFields(daoTechnician);

                foreach (DAOTechnician resdaoTechnician in daoTechnicianCollection)
                {
                    boTechnicianCollection.Add(new BOTechnician(resdaoTechnician));
                }

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