Esempio n. 1
0
 public WebboardItemProxy(Data.Models.Course c, string defaultImageUrl)
 {
     this.Id               = c.Id;
     this.ImageUrl         = c.ImageUrl;
     this.Name             = c.Name_EN;
     this.ShortDescription = c.ShortDescription;
     this.CreateBy         = c.ApplicationUser.FirstName_EN + " " + c.ApplicationUser.LastName_EN;
     this.Type             = WebboardType.course;
     this.CategoryId       = c.CategoryId;
     this.CreatorImageUrl  = string.IsNullOrEmpty(c.ApplicationUser.ImageUrl) ? defaultImageUrl : c.ApplicationUser.ImageUrl;
     this.NumberOfView     = 0;
     this.CreatedDate      = c.CreatedDate;
     AttachFiles           = new List <AttachFilesProxy>();
     MoreDetail            = new MoreDetailProxy();
 }
Esempio n. 2
0
 public WebboardItemProxy(Forum f, string defaultImageUrl)
 {
     this.Id               = f.Id;
     this.ImageUrl         = f.ImageUrl;
     this.Name             = f.Name;
     this.ShortDescription = f.ShortDescription;
     this.FullDescription  = f.FullDescription;
     this.CreateBy         = f.ApplicationUser.FirstName_EN + " " + f.ApplicationUser.LastName_EN;
     this.Type             = WebboardType.forum;
     this.CategoryId       = f.CategoryId;
     this.CreatorImageUrl  = string.IsNullOrEmpty(f.ApplicationUser.ImageUrl) ? defaultImageUrl : f.ApplicationUser.ImageUrl;
     this.NumberOfComments = f.Comments.Count();
     this.UserId           = f.ApplicationUser.Id;
     this.CreatedDate      = f.CreatedDate;
     AttachFiles           = new List <AttachFilesProxy>();
     MoreDetail            = new MoreDetailProxy();
 }
Esempio n. 3
0
 public WebboardItemProxy(Research r, string defaultImageUrl)
 {
     this.Id               = r.Id;
     this.ImageUrl         = r.ImageUrl;
     this.Name             = r.Name_EN;
     this.ShortDescription = r.ShortDescription;
     this.CreateBy         = r.ApplicationUser.FirstName_EN + " " + r.ApplicationUser.LastName_EN;
     this.Type             = WebboardType.research;
     this.CategoryId       = r.CategoryId;
     this.CreatorImageUrl  = string.IsNullOrEmpty(r.ApplicationUser.ImageUrl) ? defaultImageUrl : r.ApplicationUser.ImageUrl;
     this.NumberOfView     = 0;
     this.UserId           = r.ApplicationUser.Id;
     this.CreatedDate      = r.CreatedDate;
     AttachFiles           = new List <AttachFilesProxy>();
     if (r.AttachFiles.Count() > 0)
     {
         foreach (var f in r.AttachFiles)
         {
             this.AttachFiles.Add(new AttachFilesProxy(f));
         }
     }
     MoreDetail = new MoreDetailProxy(r);
 }
Esempio n. 4
0
 public WebboardItemProxy()
 {
     AttachFiles = new List <AttachFilesProxy>();
     MoreDetail  = new MoreDetailProxy();
 }