public void SaveCategory(string category)
        {
            STtblCategory objtblCategory = new STtblCategory();

            objtblCategory.caregory_Name = category;
            nj.STtblCategories.Add(objtblCategory);
            nj.SaveChanges();
        }
Beispiel #2
0
        public void SaveResult(Result obj, int Userid)
        {
            STtblResult objtblResult = new STtblResult();

            objtblResult.Result_Date    = DateTime.Now;
            objtblResult.Result_Heading = obj.Result_Heading;
            objtblResult.Result_Text    = obj.Result_Text;
            objtblResult.tblUserId      = Userid;
            dbentity.STtblResults.Add(objtblResult);
            dbentity.SaveChanges();
        }
Beispiel #3
0
        public void SaveResult(string Result_Heading, string Result_Text)
        {
            STtblResult objtblResult = new STtblResult();

            objtblResult.Result_Date    = DateTime.Now;
            objtblResult.Result_Heading = Result_Heading;
            objtblResult.Result_Text    = Result_Text;
            objtblResult.tblUserId      = 1;
            nj.STtblResults.Add(objtblResult);
            nj.SaveChanges();
        }
Beispiel #4
0
        public void AddUser(User obj)
        {
            STtblUser objSt = new STtblUser();

            objSt.Name          = obj.Name;
            objSt.Password      = obj.Password;
            objSt.UserName      = obj.Email;
            objSt.tblUserRoleId = obj.Roleid;
            db.STtblUsers.Add(objSt);
            db.SaveChanges();
        }
Beispiel #5
0
        public int AddComment(string fullname, string Email, string Text, int ids)
        {
            STtblComment objtblComment = new STtblComment();

            objtblComment.Comment_Text  = Text;
            objtblComment.Comment_Date  = DateTime.Now;
            objtblComment.Comment_Email = Email;
            objtblComment.Comment_By    = fullname;
            objtblComment.Blog_Id       = ids;
            objtblComment.Isapproved    = 0;
            dbentity.STtblComments.Add(objtblComment);
            dbentity.SaveChanges();
            int id = objtblComment.Comment_Id;

            return(id);
        }
Beispiel #6
0
 public void saveBlog(string Title, string Text, DateTime publishDate, int Category, string imgPath2, int Userid)
 {
     try
     {
         STtblBlog objBlog = new STtblBlog();
         objBlog.Image          = imgPath2;
         objBlog.Title          = Title;
         objBlog.Text           = Text;
         objBlog.Published_Date = Convert.ToDateTime(publishDate);
         objBlog.Post_Date      = DateTime.Now;
         objBlog.tbluserid      = 1;
         objBlog.tblCategory_Id = Category;
         nj.STtblBlogs.Add(objBlog);
         nj.SaveChanges();
     }
     catch (Exception cc)
     {
         throw cc;
     }
 }