コード例 #1
0
        ///<Summary>
        ///AddIssue
        ///This method persists a BOIssue object to the database collection
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BOIssue
        ///</parameters>
        public virtual void AddIssue(BOIssue boIssue)
        {
            DAOIssue daoIssue = new DAOIssue();

            RegisterDataObject(daoIssue);
            BeginTransaction("addIssue");
            try
            {
                daoIssue.Id           = boIssue.Id;
                daoIssue.Staffid      = boIssue.Staffid;
                daoIssue.Departmentid = boIssue.Departmentid;
                daoIssue.Statusid     = boIssue.Statusid;
                daoIssue.Details      = boIssue.Details;
                daoIssue.Technicianid = boIssue.Technicianid;
                daoIssue.Remarks      = boIssue.Remarks;
                daoIssue.Typeid       = _id.Value;
                daoIssue.Insert();
                CommitTransaction();

                /*pick up any primary keys, computed values etc*/
                boIssue = new BOIssue(daoIssue);
                if (_boIssueCollection != null)
                {
                    _boIssueCollection.Add(boIssue);
                }
            }
            catch
            {
                RollbackTransaction("addIssue");
                throw;
            }
        }
コード例 #2
0
ファイル: BOIssue.cs プロジェクト: duhowise/HelpDeskManager
        ///<Summary>
        ///SaveNew
        ///This method persists a new Issue record to the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void SaveNew()
        {
            DAOIssue daoIssue = new DAOIssue();

            RegisterDataObject(daoIssue);
            BeginTransaction("savenewBOIssue");
            try
            {
                daoIssue.Typeid       = _typeid;
                daoIssue.Staffid      = _staffid;
                daoIssue.Departmentid = _departmentid;
                daoIssue.Statusid     = _statusid;
                daoIssue.Details      = _details;
                daoIssue.Technicianid = _technicianid;
                daoIssue.Remarks      = _remarks;
                daoIssue.Insert();
                CommitTransaction();

                _id           = daoIssue.Id;
                _typeid       = daoIssue.Typeid;
                _staffid      = daoIssue.Staffid;
                _departmentid = daoIssue.Departmentid;
                _statusid     = daoIssue.Statusid;
                _details      = daoIssue.Details;
                _technicianid = daoIssue.Technicianid;
                _remarks      = daoIssue.Remarks;
                _isDirty      = false;
            }
            catch
            {
                RollbackTransaction("savenewBOIssue");
                throw;
            }
        }
コード例 #3
0
ファイル: BOIssue.cs プロジェクト: duhowise/HelpDeskManager
        ///<Summary>
        ///IssueCollectionFromSearchFields
        ///This method returns the collection of BOIssue objects, filtered by a search object
        ///</Summary>
        ///<returns>
        ///List<BOIssue>
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BOIssue> IssueCollectionFromSearchFields(BOIssue boIssue)
        {
            try
            {
                IList <BOIssue> boIssueCollection = new List <BOIssue>();
                DAOIssue        daoIssue          = new DAOIssue();
                daoIssue.Id           = boIssue.Id;
                daoIssue.Typeid       = boIssue.Typeid;
                daoIssue.Staffid      = boIssue.Staffid;
                daoIssue.Departmentid = boIssue.Departmentid;
                daoIssue.Statusid     = boIssue.Statusid;
                daoIssue.Details      = boIssue.Details;
                daoIssue.Technicianid = boIssue.Technicianid;
                daoIssue.Remarks      = boIssue.Remarks;
                IList <DAOIssue> daoIssueCollection = DAOIssue.SelectAllBySearchFields(daoIssue);

                foreach (DAOIssue resdaoIssue in daoIssueCollection)
                {
                    boIssueCollection.Add(new BOIssue(resdaoIssue));
                }

                return(boIssueCollection);
            }
            catch
            {
                throw;
            }
        }
コード例 #4
0
ファイル: BOIssue.cs プロジェクト: duhowise/HelpDeskManager
 ///<Summary>
 ///IssueCollectionCount
 ///This method returns the collection count of BOIssue objects
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 IssueCollectionCount()
 {
     try
     {
         Int32 objCount = DAOIssue.SelectAllCount();
         return(objCount);
     }
     catch
     {
         throw;
     }
 }
コード例 #5
0
        ///<Summary>
        ///LoadIssueCollection
        ///This method loads the internal collection of BOIssue objects from storage.
        ///Call this if you need to ensure the collection is up-to-date (concurrency)
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void LoadIssueCollection()
        {
            try
            {
                _boIssueCollection = new List <BOIssue>();
                IList <DAOIssue> daoIssueCollection = DAOIssue.SelectAllByTypeid(_id.Value);

                foreach (DAOIssue daoIssue in daoIssueCollection)
                {
                    _boIssueCollection.Add(new BOIssue(daoIssue));
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #6
0
ファイル: BOIssue.cs プロジェクト: duhowise/HelpDeskManager
 ///<Summary>
 ///Constructor
 ///This constructor initializes the business object from its respective data object
 ///</Summary>
 ///<returns>
 ///void
 ///</returns>
 ///<parameters>
 ///DAOIssue
 ///</parameters>
 protected internal BOIssue(DAOIssue daoIssue)
 {
     try
     {
         _id           = daoIssue.Id;
         _typeid       = daoIssue.Typeid;
         _staffid      = daoIssue.Staffid;
         _departmentid = daoIssue.Departmentid;
         _statusid     = daoIssue.Statusid;
         _details      = daoIssue.Details;
         _technicianid = daoIssue.Technicianid;
         _remarks      = daoIssue.Remarks;
     }
     catch
     {
         throw;
     }
 }
コード例 #7
0
ファイル: BOIssue.cs プロジェクト: duhowise/HelpDeskManager
        ///<Summary>
        ///IssueCollection
        ///This method returns the collection of BOIssue objects
        ///</Summary>
        ///<returns>
        ///List[BOIssue]
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BOIssue> IssueCollection()
        {
            try
            {
                IList <BOIssue>  boIssueCollection  = new List <BOIssue>();
                IList <DAOIssue> daoIssueCollection = DAOIssue.SelectAll();

                foreach (DAOIssue daoIssue in daoIssueCollection)
                {
                    boIssueCollection.Add(new BOIssue(daoIssue));
                }

                return(boIssueCollection);
            }
            catch
            {
                throw;
            }
        }
コード例 #8
0
 ///<Summary>
 ///DeleteAllIssue
 ///This method deletes all BOIssue objects from its collection
 ///</Summary>
 ///<returns>
 ///void
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public virtual void DeleteAllIssue()
 {
     RegisterDataObject(null);
     BeginTransaction("deleteAllIssue");
     try
     {
         DAOIssue.DeleteAllByTypeid(ConnectionProvider, _id.Value);
         CommitTransaction();
         if (_boIssueCollection != null)
         {
             _boIssueCollection.Clear();
             _boIssueCollection = null;
         }
     }
     catch
     {
         RollbackTransaction("deleteAllIssue");
         throw;
     }
 }
コード例 #9
0
ファイル: BOIssue.cs プロジェクト: duhowise/HelpDeskManager
 ///<Summary>
 ///IssueCollectionFromSearchFieldsCount
 ///This method returns the collection count of BOIssue objects, filtered by a search object
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 IssueCollectionFromSearchFieldsCount(BOIssue boIssue)
 {
     try
     {
         DAOIssue daoIssue = new DAOIssue();
         daoIssue.Id           = boIssue.Id;
         daoIssue.Typeid       = boIssue.Typeid;
         daoIssue.Staffid      = boIssue.Staffid;
         daoIssue.Departmentid = boIssue.Departmentid;
         daoIssue.Statusid     = boIssue.Statusid;
         daoIssue.Details      = boIssue.Details;
         daoIssue.Technicianid = boIssue.Technicianid;
         daoIssue.Remarks      = boIssue.Remarks;
         Int32 objCount = DAOIssue.SelectAllBySearchFieldsCount(daoIssue);
         return(objCount);
     }
     catch
     {
         throw;
     }
 }