public Issue(IssueDS.IssueTableRow issue, IssueDS actions, IssueDS attachments) { //Constructor try { this.mActions = new IssueDS(); this.mAttachments = new IssueDS(); if (issue == null) { //New issue- add an 'Open' action this.mActions.ActionTable.AddActionTableRow(0, Action.ACTIONTYPE_OPEN, 0, Environment.UserName, DateTime.Now, ""); } else { //Existing issue if (!issue.IsIDNull()) { this._id = issue.ID; } if (!issue.IsTypeIDNull()) { this._typeid = issue.TypeID; } if (!issue.IsSubjectNull()) { this._subject = issue.Subject.Trim(); } if (!issue.IsContactIDNull()) { this._contactid = issue.ContactID; } if (!issue.IsCompanyIDNull()) { this._companyid = issue.CompanyID; } if (!issue.IsRegionNumberNull()) { this._regionnumber = issue.RegionNumber.Trim(); } if (!issue.IsDistrictNumberNull()) { this._districtnumber = issue.DistrictNumber.Trim(); } if (!issue.IsAgentNumberNull()) { this._agentnumber = issue.AgentNumber.Trim(); } if (!issue.IsStoreNumberNull()) { this._storenumber = issue.StoreNumber; } if (!issue.IsOFD1FromDateNull()) { this._ofd1datefrom = issue.OFD1FromDate; } if (!issue.IsOFD1ToDateNull()) { this._ofd1dateto = issue.OFD1ToDate; } if (!issue.IsPROIDNull()) { this._proid = issue.PROID; } if (!issue.IsZoneNull()) { this._zone = issue.Zone; } if (actions != null) { this.mActions.Merge(actions); } if (attachments != null) { this.mAttachments.Merge(attachments); } } } catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new Issue instance", ex); } }
public Issue(IssueDS.IssueTableRow issue) { //Constructor try { if (issue != null) { if (!issue.IsIDNull()) { this._id = issue.ID; } if (!issue.IsTypeIDNull()) { this._typeid = issue.TypeID; } if (!issue.IsTypeNull()) { this._type = issue.Type; } if (!issue.IsSubjectNull()) { this._subject = issue.Subject.Trim(); } if (!issue.IsContactIDNull()) { this._contactid = issue.ContactID; } if (!issue.IsContactNameNull()) { this._contactname = issue.ContactName; } if (!issue.IsCompanyIDNull()) { this._companyid = issue.CompanyID; } if (!issue.IsCompanyNameNull()) { this._companyname = issue.CompanyName; } if (!issue.IsRegionNumberNull()) { this._regionnumber = issue.RegionNumber.Trim(); } if (!issue.IsDistrictNumberNull()) { this._districtnumber = issue.DistrictNumber.Trim(); } if (!issue.IsAgentNumberNull()) { this._agentnumber = issue.AgentNumber.Trim(); } if (!issue.IsStoreNumberNull()) { this._storenumber = issue.StoreNumber; } if (!issue.IsOFD1FromDateNull()) { this._ofd1datefrom = issue.OFD1FromDate; } if (!issue.IsOFD1ToDateNull()) { this._ofd1dateto = issue.OFD1ToDate; } if (!issue.IsPROIDNull()) { this._proid = issue.PROID; } if (!issue.IsFirstActionIDNull()) { this._firstactionid = issue.FirstActionID; } if (!issue.IsFirstActionDescriptionNull()) { this._firstactiondescription = issue.FirstActionDescription; } if (!issue.IsFirstActionUserIDNull()) { this._firstactionuserid = issue.FirstActionUserID; } if (!issue.IsFirstActionCreatedNull()) { this._firstactioncreated = issue.FirstActionCreated; } if (!issue.IsLastActionIDNull()) { this._lastactionid = issue.LastActionID; } if (!issue.IsLastActionDescriptionNull()) { this._lastactiondescription = issue.LastActionDescription; } if (!issue.IsLastActionUserIDNull()) { this._lastactionuserid = issue.LastActionUserID; } if (!issue.IsLastActionCreatedNull()) { this._lastactioncreated = issue.LastActionCreated; } if (!issue.IsZoneNull()) { this._zone = issue.Zone; } if (!issue.IsCoordinatorNull()) { this._coordinator = issue.Coordinator; } } } catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new Issue instance", ex); } }