Example #1
0
 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);
 }
Example #2
0
        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);
        }
Example #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;
     }
 }
Example #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;
     }
 }
Example #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;
     }
 }
Example #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;
                }
            }
        }
Example #7
0
 public Blog()
 {
     blog = null;
 }
Example #8
0
 public Blog(string username, string blogname)
 {
     blog = DataAccess.BlogCRUD.Get(username, blogname);
 }
Example #9
0
 public Blog(long id)
 {
     blog = DataAccess.BlogCRUD.Get(id);
 }
Example #10
0
 public Blog()
 {
     blog = null;
 }
Example #11
0
 public Blog(string username, string blogname)
 {
     blog = DataAccess.BlogCRUD.Get(username, blogname);
 }
Example #12
0
 public Blog(long id)
 {
     blog = DataAccess.BlogCRUD.Get(id);
 }
Example #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;
     }
 }