예제 #1
0
파일: Blog.cs 프로젝트: ThomasCOLLIN/dotNET
 public static void CreateBlog(string user, long styleId, long themeId, string name, string desc)
 {
     long uid = DataAccess.UserCRUD.GetUserByLogin(user).Id;
     DataAccess.T_Blog blog = new DataAccess.T_Blog()
     {
         UserId = uid,
         CreationDate = DateTime.Now,
         Description = desc,
         Name = name,
         StyleId = styleId,
         ThemeId = themeId
     };
     DataAccess.BlogCRUD.Create(blog);
 }
예제 #2
0
파일: Blog.cs 프로젝트: ThomasCOLLIN/dotNET
        public static void CreateBlog(string user, long styleId, long themeId, string name, string desc)
        {
            long uid = DataAccess.UserCRUD.GetUserByLogin(user).Id;

            DataAccess.T_Blog blog = new DataAccess.T_Blog()
            {
                UserId       = uid,
                CreationDate = DateTime.Now,
                Description  = desc,
                Name         = name,
                StyleId      = styleId,
                ThemeId      = themeId
            };
            DataAccess.BlogCRUD.Create(blog);
        }
예제 #3
0
 public static void Create(T_Blog blog)
 {
     try
     {
         using (Entities bdd = new Entities())
         {
             bdd.T_Blog.Add(blog);
             bdd.SaveChanges();
         }
     }
     catch (Exception e)
     {
         Trace.WriteLine(e.Message);
         throw;
     }
 }
예제 #4
0
 public static void Create(T_Blog blog)
 {
     try
     {
         using (Entities bdd = new Entities())
         {
             bdd.T_Blog.Add(blog);
             bdd.SaveChanges();
         }
     }
     catch (Exception e)
     {
         Trace.WriteLine(e.Message);
         throw;
     }
 }
예제 #5
0
 public static void Update(long blogId, T_Blog blg)
 {
     try
     {
         using (Entities bdd = new Entities())
         {
             T_Blog blog = Get(blogId);
             blog = blg;
             bdd.SaveChanges();
         }
     }
     catch (Exception e)
     {
         Trace.WriteLine(e.Message);
         throw;
     }
 }
예제 #6
0
        public static List <T_Article> GetBlogContent(string userName, string blogName)
        {
            using (Entities bdd = new Entities())
            {
                try
                {
                    T_User user = bdd.T_User.Where(usr => usr.Login == userName).FirstOrDefault();
                    T_Blog blog = bdd.T_Blog.Include("T_Article").Where(blg => blg.Name == blogName && blg.UserId == user.Id).FirstOrDefault();

                    return(new List <T_Article>(blog.T_Article));
                }
                catch (Exception e)
                {
                    Trace.WriteLine(e.Message);
                    throw;
                }
            }
        }
예제 #7
0
파일: Blog.cs 프로젝트: ThomasCOLLIN/dotNET
 public Blog()
 {
     blog = null;
 }
예제 #8
0
파일: Blog.cs 프로젝트: ThomasCOLLIN/dotNET
 public Blog(string username, string blogname)
 {
     blog = DataAccess.BlogCRUD.Get(username, blogname);
 }
예제 #9
0
파일: Blog.cs 프로젝트: ThomasCOLLIN/dotNET
 public Blog(long id)
 {
     blog = DataAccess.BlogCRUD.Get(id);
 }
예제 #10
0
파일: Blog.cs 프로젝트: ThomasCOLLIN/dotNET
 public Blog()
 {
     blog = null;
 }
예제 #11
0
파일: Blog.cs 프로젝트: ThomasCOLLIN/dotNET
 public Blog(string username, string blogname)
 {
     blog = DataAccess.BlogCRUD.Get(username, blogname);
 }
예제 #12
0
파일: Blog.cs 프로젝트: ThomasCOLLIN/dotNET
 public Blog(long id)
 {
     blog = DataAccess.BlogCRUD.Get(id);
 }
예제 #13
0
 public static void Update(long blogId, T_Blog blg)
 {
     try
     {
         using (Entities bdd = new Entities())
         {
             T_Blog blog = Get(blogId);
             blog = blg;
             bdd.SaveChanges();
         }
     }
     catch (Exception e)
     {
         Trace.WriteLine(e.Message);
         throw;
     }
 }