Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ATMarkDTO"/> class.
 /// </summary>
 /// <param name="picture">
 /// The picture.
 /// </param>
 public ATMarkDTO(ATPicture picture) : this(picture.Mark)
 {
     this.positionX = picture.PositionX;
     this.positionY = picture.PositionY;
     this.width     = picture.Width;
     this.height    = picture.Height;
     this.labelText = picture.LabelText;
     //this.imageData = picture.Image;
     this.image          = picture.Path;
     this.labelTextColor = picture.LabelTextColor;
     this.fontSize       = picture.LabelFontSize;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Converts <see cref="ATMarkDTO"/> to requested entity type
        /// </summary>
        /// <param name="mark">the mark</param>
        /// <param name="existing">existing item</param>
        /// <returns>corresponding entity</returns>
        public ATPicture ToPicture(ATMarkDTO mark, ATPicture existing)
        {
            var o = existing ?? new ATPicture();

            o.Mark           = this.ToMark(mark, null != existing ? existing.Mark : null);
            o.PositionX      = mark.positionX;
            o.PositionY      = mark.positionY;
            o.Height         = mark.height;
            o.Width          = mark.width;
            o.LabelFontSize  = mark.fontSize;
            o.LabelText      = mark.labelText;
            o.LabelTextColor = mark.labelTextColor;
            o.Image          = mark.imageData;
            o.Path           = mark.image;
            return(o);
        }
Ejemplo n.º 3
0
        public IEnumerable <ATMark> GetMarks(Guid fileId)
        {
            ATMark               mark                 = null;
            ATShape              note                 = null;
            ATDrawing            atDrawing            = null;
            ATHighlightStrikeOut atHighlightStrikeOut = null;
            ATTextItem           textItem             = null;
            ATRotation           rotationItem         = null;
            ATPicture            pictureItem          = null;
            ATFormula            formulaItem          = null;
            ATAnnotation         annotationItem       = null;

            // Query to load the companies
            //     var marks = this.Repository.Session.QueryOver(() => mark).Where(x => x.File.Id == fileId).Fetch(x => x.File).Eager.Future<ATMark>();



            var mrs = this.Repository.Session.QueryOver <ATMark>()
                      .Left.JoinAlias(p => p.Annotations, () => annotationItem)
                      .Left.JoinAlias(p => p.Shapes, () => note)
                      .Left.JoinAlias(p => p.Drawings, () => atDrawing)
                      .Left.JoinAlias(p => p.HighlightStrikeOuts, () => atHighlightStrikeOut)
                      .Left.JoinAlias(p => p.TextItems, () => textItem)
                      .Left.JoinAlias(p => p.Rotations, () => rotationItem)
                      .Left.JoinAlias(p => p.Pictures, () => pictureItem)
                      .Left.JoinAlias(p => p.Formulas, () => formulaItem)
                      .Where(p => p.File.Id == fileId)
                      .Fetch(p => p.File).Eager.Future <ATMark>();

            //  .List();

            //// Query to load the Notes
            //var notes = this.Repository.Session.QueryOver(() => note)
            //    .JoinAlias(p => p.Mark, () => mark)
            //    .Future<ATShape>();

            //// Query to load the Drawings
            //var drawings = this.Repository.Session.QueryOver(() => atDrawing)
            //    .JoinAlias(p => p.Mark, () => mark)
            //    .Future<ATDrawing>();

            //// Query to load the Highlights
            //var highlights = this.Repository.Session.QueryOver(() => atHighlightStrikeOut)
            //    .JoinAlias(p => p.Mark, () => mark)
            //    .Future<ATHighlightStrikeOut>();

            //// Query to load the TextItems
            //var textItems = this.Repository.Session.QueryOver(() => textItem)
            //    .JoinAlias(p => p.Mark, () => mark)
            //    .Future<ATTextItem>();

            //// Query to load the Rotations
            //var rotationItems = this.Repository.Session.QueryOver(() => rotationItem)
            //    .JoinAlias(p => p.Mark, () => mark)
            //    .Future<ATRotation>();

            //// Query to load the Pictures
            //var pictureItems = this.Repository.Session.QueryOver(() => pictureItem)
            //    .JoinAlias(p => p.Mark, () => mark)
            //    .Future<ATPicture>();

            //// Query to load the Formulas
            //var formulaItems = this.Repository.Session.QueryOver(() => formulaItem)
            //    .JoinAlias(p => p.Mark, () => mark)
            //    .Future<ATFormula>();

            //// Query to load the Annotations
            //var annotationItems = this.Repository.Session.QueryOver(() => annotationItem)
            //    .JoinAlias(p => p.Mark, () => mark)
            //    .Future<ATAnnotation>();

            return(mrs.OrderBy(x => x.DateChanged).ToList());
        }