Ejemplo n.º 1
0
 internal static ResponseEnvelopeWithDataResult <List <BaseDataModel> > GetDataModels()
 {
     return(new ResponseEnvelopeWithDataResult <List <BaseDataModel> >()
     {
         DataResult = ScaleModelProjectTypeManager.GetEntities().ConvertToDataModels().ConvertAll(x => (BaseDataModel)x)
     });
 }
Ejemplo n.º 2
0
 internal static ResponseEnvelopeWithDataResult <BaseDataModel> GetLatestDataModel()
 {
     return(new ResponseEnvelopeWithDataResult <BaseDataModel>()
     {
         DataResult = ScaleModelProjectTypeManager.GetEntities().OrderByDescending(x => x.DateCreated).FirstOrDefault().ConvertToDataModel()
     });
 }
Ejemplo n.º 3
0
 internal static ResponseEnvelopeWithDataResult <BaseDataModel> GetDataModelByGuid(Guid id)
 {
     return(new ResponseEnvelopeWithDataResult <BaseDataModel>()
     {
         DataResult = ScaleModelProjectTypeManager.GetEntityFromGuid(id).ConvertToDataModel()
     });
 }
Ejemplo n.º 4
0
        internal static ResponseEnvelope CreateEntity(ScaleModelProjectTypeDataModel model)
        {
            ScaleModelProjectType entity = model.ConvertToEntity();

            entity.DateCreated      = DateTime.Now;
            entity.DateLastModified = DateTime.Now;
            return(ScaleModelProjectTypeManager.Create(entity));
        }
Ejemplo n.º 5
0
        internal static ResponseEnvelope DeleteEntity(ScaleModelProjectTypeDataModel model)
        {
            if (model == null)
            {
                return(new ResponseEnvelope(new Exception("Parameter 'model' is empty")));
            }
            ScaleModelProjectType entity = ScaleModelProjectTypeManager.GetEntityFromGuid(model.Id);

            return(ScaleModelProjectTypeManager.Delete(entity));
        }
Ejemplo n.º 6
0
        internal static ResponseEnvelope UpdateEntity(ScaleModelProjectTypeDataModel model)
        {
            if (model == null)
            {
                return(new ResponseEnvelope(new Exception("Parameter 'model' is empty")));
            }
            ScaleModelProjectType entity = ScaleModelProjectTypeManager.GetEntityFromGuid(model.Id);

            entity.UpdateFromModel(model);
            entity.DateLastModified = DateTime.Now;
            return(ScaleModelProjectTypeManager.Update());
        }