protected override void DataPortal_Insert() { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider<IOrganizationDataFactory>(); var data = new OrganizationData(); using (this.BypassPropertyChecks) { this.ModifiedBy = ((IBusinessIdentity)Csla.ApplicationContext.User.Identity).UserId; this.ModifiedDate = DateTime.Now; this.CreatedBy = this.ModifiedBy; this.CreatedDate = this.ModifiedDate; this.Insert(data); data = dalFactory.Insert(data); this.OrganizationId = data.OrganizationId; } // this.FieldManager.UpdateChildren(data); } }
internal static Organization FetchOrganization(OrganizationData data) { var result = new Organization(); result.Fetch(data); result.MarkOld(); return result; }
private void Child_Fetch(OrganizationData data) { this.OrganizationId = data.OrganizationId; this.Name = data.Name; this.Description = data.Description; this.IsActive = data.IsActive; this.IsArchived = data.IsArchived; this.ModifiedBy = data.ModifiedBy; this.ModifiedByName = data.ModifiedByUser.Name; this.ModifiedDate = data.ModifiedDate; this.CreatedBy = data.CreatedBy; this.CreatedByName = data.CreatedByUser.Name; this.CreatedDate = data.CreatedDate; }
protected void Update(OrganizationData data) { data.OrganizationId = this.OrganizationId; data.Name = this.Name; data.Description = this.Description; data.IsActive = this.IsActive; data.IsArchived = this.IsArchived; data.ModifiedBy = this.ModifiedBy; data.ModifiedDate = this.ModifiedDate; data.CreatedBy = this.CreatedBy; data.CreatedDate = this.CreatedDate; }
protected void Insert(OrganizationData data) { this.Update(data); }