protected override void DoAfterPageLoad() { OperacijaRezultat res = OperationManager.Singleton.izvrsiOperaciju(new OpFullProject() { Kriterijum = new KriterijumFullProject() { IdProject = ProjectId } }); if (res.Status && res.HaveItems) { bool candelete = false; FullProjectDb full = res.DbItems.Cast <FullProjectDb>().ToArray()[0]; this.singleprojectTitle.InnerText = full.Project.Title; full.Project.MainImageLink = ResolveClientUrl(full.Project.MainImageLink); if (Session["idUser"] != null) { if (full.Project.IdUser == (int)Session["idUser"]) { this.PanelAddImage.Visible = true; candelete = true; } } foreach (ImageDb img in full.Images) { img.BigPictureUrl = ResolveClientUrl(img.BigPictureUrl);//.Substring(1) img.SmallPictureUrl = ResolveClientUrl(img.SmallPictureUrl); } this.PanelSingleProject.Controls.Add(ProjectsPresentation.MakeSingleProject(full, candelete)); } }
public static LiteralControl MakeSingleProject(FullProjectDb fullproject, bool canDelete) { LiteralControl lit = new LiteralControl(); lit.Text += @"<div class='col-md-4 col-md-push-8 sticky-parent'>" + "<div class='detail' id='sticky_item'>" + "<div class='animate-box'>" + "<h2>" + fullproject.Project.Title + "</h2>" + "<span>" + fullproject.Project.Tag + "</span>" + "<p>" + fullproject.Project.Description + "</p>" + "</div>" + "</div>" + "</div>"; lit.Text += @"<div class='col-md-7 col-md-pull-4 image-content'>"; lit.Text += @"<div class='image-item animate-box'>" + "<img src='" + fullproject.Project.MainImageLink + "' class='img-responsive' alt='" + fullproject.Project.Tag + "'>" + "</div>"; if (canDelete) { //dodati button da se moze obrisati img foreach (ImageDb img in fullproject.Images) { lit.Text += @"<div class='image-item img-single-small animate-box'>" + "<a href='" + img.BigPictureUrl + "' data-lightbox='singleProject' data-title='" + img.ImageName + "'>" + "<img src='" + img.SmallPictureUrl + "' class='img-responsive' alt='" + img.ImgAlt + "'>" + "</a>" + "<input id='delete' value='Delete' type='button' class='btn btn-primary' onclick='ajax_imgDelete(this, " + img.IdImage + ");'/>" + "</div>"; } } else { foreach (ImageDb img in fullproject.Images) { lit.Text += @"<div class='image-item img-single-small animate-box'>" + "<a href='" + img.BigPictureUrl + "' data-lightbox='singleProject' data-title='" + img.ImageName + "'>" + "<img src='" + img.SmallPictureUrl + "' class='img-responsive' alt='" + img.ImgAlt + "'>" + "</a>" + "</div>"; } } lit.Text += @"</div>"; return(lit); }