Exemplo n.º 1
0
        //from dal to dto

        public static PanelDTO convertDalToDTO(PanelAd p)
        {
            return(new PanelDTO()
            {
                BoardId = p.BoardId,
                AdId = p.AdId,
                PanelDate = p.PanelDate,
                PanelLineStart = p.PanelLineStart,
                PanelLineEnd = p.PanelLineEnd,
                PanelColumnStart = p.PanelColumnStart,
                PanelColumnEnd = p.PanelColumnEnd
            });
        }
Exemplo n.º 2
0
        //פונקציה שממירה את המטריצה לסוג של הדל
        //add the new panel to sql
        public void PanelToDal(int AdId, int begin, int AdHeight, int AdWidth)
        {
            PanelAd p = new PanelAd()
            {
                AdId             = AdId,
                BoardId          = this.boardId,
                PanelColumnEnd   = begin % 10 + AdWidth - 1,
                PanelColumnStart = begin % 10,
                PanelDate        = this.date,
                PanelLineEnd     = begin / 10 + AdHeight - 1,
                PanelLineStart   = begin / 10
            };

            db.PanelAds.Add(p);
            db.SaveChanges();
            //for (int i = 0; i < x; i++)
            //{
            //    for (int j = 0; j < y; j++)
            //    {
            //    }
            //}
        }