///<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; } }
///<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; } }