Пример #1
0
        public List <PhotosModel> PhotosByParentId()
        {
            List <PhotosModel> Modelitems = new List <PhotosModel>();
            List <Photos>      items      = new PhotosRepository().ShowPhotosByParentId(new Guid("59ef2601-e4e4-423e-8bb7-d5b1d589f028"));

            foreach (Photos item in items)
            {
                PhotosModel modelitem = ClassToModel(item); Modelitems.Add(modelitem);
            }
            return(Modelitems);
        }
Пример #2
0
 internal PhotosModel ClassToModel(Photos item)
 {
     PhotosModel  mitem=new PhotosModel();
       mitem.PhotoId = item.PhotoId;
       mitem.ParentId = item.ParentId;
       mitem.Title = item.Title;
       mitem.SmallDescription = item.SmallDescription;
       mitem.AlternativeText = item.AlternativeText;
       mitem.Photourl ="images/"+item.PhotoId+".jpg";
       return mitem;
 }
Пример #3
0
        internal PhotosModel ClassToModel(Photos item)
        {
            PhotosModel mitem = new PhotosModel();

            mitem.PhotoId          = item.PhotoId;
            mitem.ParentId         = item.ParentId;
            mitem.Title            = item.Title;
            mitem.SmallDescription = item.SmallDescription;
            mitem.AlternativeText  = item.AlternativeText;
            mitem.Photourl         = "images/" + item.PhotoId + ".jpg";
            return(mitem);
        }
Пример #4
0
 //
 // GET: /Photos/
 public ActionResult Index()
 {
     PhotosModel model = new PhotosModel();
     return View(model.PhotosByParentId().ToList());
 }