Inheritance: System.Data.Objects.DataClasses.EntityObject
 /// <summary>
 /// Create a new Status object.
 /// </summary>
 /// <param name="statusId">Initial value of the StatusId property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 /// <param name="isActive">Initial value of the IsActive property.</param>
 /// <param name="isArchived">Initial value of the IsArchived property.</param>
 /// <param name="isCompleted">Initial value of the IsCompleted property.</param>
 /// <param name="isStarted">Initial value of the IsStarted property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="ordinal">Initial value of the Ordinal property.</param>
 /// <param name="projectId">Initial value of the ProjectId property.</param>
 /// <param name="createdBy">Initial value of the CreatedBy property.</param>
 /// <param name="createdDate">Initial value of the CreatedDate property.</param>
 /// <param name="modifiedBy">Initial value of the ModifiedBy property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static Status CreateStatus(global::System.Int32 statusId, global::System.String description, global::System.Boolean isActive, global::System.Boolean isArchived, global::System.Boolean isCompleted, global::System.Boolean isStarted, global::System.String name, global::System.Int32 ordinal, global::System.Int32 projectId, global::System.Int32 createdBy, global::System.DateTime createdDate, global::System.Int32 modifiedBy, global::System.DateTime modifiedDate)
 {
     Status status = new Status();
     status.StatusId = statusId;
     status.Description = description;
     status.IsActive = isActive;
     status.IsArchived = isArchived;
     status.IsCompleted = isCompleted;
     status.IsStarted = isStarted;
     status.Name = name;
     status.Ordinal = ordinal;
     status.ProjectId = projectId;
     status.CreatedBy = createdBy;
     status.CreatedDate = createdDate;
     status.ModifiedBy = modifiedBy;
     status.ModifiedDate = modifiedDate;
     return status;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Statuses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStatuses(Status status)
 {
     base.AddObject("Statuses", status);
 }
        public StatusData Insert(StatusData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                           .GetManager(Database.ApplicationConnection, false))
            {
                var status = new Status();

                Csla.Data.DataMapper.Map(data, status);

                ctx.ObjectContext.AddToStatuses(status);

                ctx.ObjectContext.SaveChanges();

                data.StatusId = status.StatusId;

                return data;
            }
        }
        private void Fetch(Status status, StatusData statusData)
        {
            DataMapper.Map(status, statusData);

            statusData.Project = new ProjectData();
            DataMapper.Map(status.Project, statusData.Project);

            statusData.CreatedByUser = new UserData();
            DataMapper.Map(status.CreatedByUser, statusData.CreatedByUser);

            statusData.ModifiedByUser = new UserData();
            DataMapper.Map(status.ModifiedByUser, statusData.ModifiedByUser);
        }
        public StatusData Update(StatusData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var status =
                    new Status
                    {
                        StatusId = data.StatusId
                    };

                ctx.ObjectContext.Statuses.Attach(status);

                Csla.Data.DataMapper.Map(data, status);

                ctx.ObjectContext.SaveChanges();

                return data;
            }
        }
Exemple #6
0
 internal static void Map(StatusData source, Status destination)
 {
     destination.StatusId = source.StatusId;
     destination.Description = source.Description;
     destination.IsActive = source.IsActive;
     destination.IsArchived = source.IsArchived;
     destination.IsCompleted = source.IsCompleted;
     destination.IsStarted = source.IsStarted;
     destination.Name = source.Name;
     destination.Ordinal = source.Ordinal;
     destination.ProjectId = source.ProjectId;
     destination.CreatedBy = source.CreatedBy;
     destination.CreatedDate = source.CreatedDate;
     destination.ModifiedBy = source.ModifiedBy;
     destination.ModifiedDate = source.ModifiedDate;
 }