• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Comments类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Comments的典型用法代码示例。如果您正苦于以下问题:C# Comments类的具体用法?C# Comments怎么用?C# Comments使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Comments类属于命名空间,在下文中一共展示了Comments类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CommentForumsRead_CorrectInput_ReturnsValidList

        public void CommentForumsRead_CorrectInput_ReturnsValidList()
        {
            var siteList = mocks.DynamicMock<ISiteList>();
            var readerCreator = mocks.DynamicMock<IDnaDataReaderCreator>();
            var reader = mocks.DynamicMock<IDnaDataReader>();
            var site = mocks.DynamicMock<ISite>();
            var cacheManager = mocks.DynamicMock<ICacheManager>();
            var siteName = "h2g2";
            var siteId = 1;

            site.Stub(x => x.ModerationStatus).Return(ModerationStatus.SiteStatus.UnMod);
            site.Stub(x => x.IsEmergencyClosed).Return(false);
            site.Stub(x => x.SiteName).Return(siteName);
            site.Stub(x => x.SiteID).Return(siteId);
            site.Stub(x => x.IsSiteScheduledClosed(DateTime.Now)).Return(false);
            reader.Stub(x => x.HasRows).Return(true);
            reader.Stub(x => x.Read()).Return(true).Repeat.Once();
            reader.Stub(x => x.GetStringNullAsEmpty("sitename")).Return(siteName);
            readerCreator.Stub(x => x.CreateDnaDataReader("commentforumsreadbysitename")).Return(reader);
            siteList.Stub(x => x.GetSite(siteName)).Return(site);
            
            mocks.ReplayAll();

            var comments = new Comments(null, readerCreator, cacheManager, siteList);
            var forums = comments.GetCommentForumListBySite(site);

            Assert.AreEqual(1, forums.CommentForums.Count);
            readerCreator.AssertWasCalled(x => x.CreateDnaDataReader("commentforumsreadbysitename"));
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:29,代码来源:CommentsTest.cs


示例2: ValidateAndGetFilter

        Task<StacManResponse<Comment>> ICommentMethods.GetAll(string site, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Comments.Sort? sort = null, DateTime? mindate = null, DateTime? maxdate = null, int? min = null, int? max = null, Order? order = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateString(site, "site");
            ValidatePaging(page, pagesize);
            ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);

            var ub = new ApiUrlBuilder("/comments", useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);
            ub.AddParameter("fromdate", fromdate);
            ub.AddParameter("todate", todate);
            ub.AddParameter("sort", sort);
            ub.AddParameter("min", mindate);
            ub.AddParameter("max", maxdate);
            ub.AddParameter("min", min);
            ub.AddParameter("max", max);
            ub.AddParameter("order", order);

            return CreateApiTask<Comment>(ub, filterObj, "/comments");
        }
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:25,代码来源:StacManClient.CommentMethods.cs


示例3: ValidateAndGetFilter

        Task<StacManResponse<Comment>> IPostMethods.GetComments(string site, IEnumerable<int> ids, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Comments.Sort? sort = null, DateTime? mindate = null, DateTime? maxdate = null, int? min = null, int? max = null, Order? order = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateString(site, "site");
            ValidateEnumerable(ids, "ids");
            ValidatePaging(page, pagesize);
            ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);

            var ub = new ApiUrlBuilder(String.Format("/posts/{0}/comments", String.Join(";", ids)), useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);
            ub.AddParameter("fromdate", fromdate);
            ub.AddParameter("todate", todate);
            ub.AddParameter("sort", sort);
            ub.AddParameter("min", mindate);
            ub.AddParameter("max", maxdate);
            ub.AddParameter("min", min);
            ub.AddParameter("max", max);
            ub.AddParameter("order", order);

            return CreateApiTask<Comment>(ub, filterObj, "/posts/{ids}/comments");
        }
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:26,代码来源:StacManClient.PostMethods.cs


示例4: RealExTransactionRequest

 protected RealExTransactionRequest(string secret, string merchantId, string account, string orderId, Amount amount, Card card, Comments comments)
     : base(secret, merchantId, account, orderId, comments)
 {
     SignatureProperties = () => new[] { Amount.Value.ToString(), Amount.Currency.CurrencyName(), Card.Number };
     Amount = amount;
     Card = card;
 }
开发者ID:JonCanning,项目名称:RealEx.NET,代码行数:7,代码来源:RealExTransactionRequest.cs


示例5: RealEx3DVerifyRequest

 public RealEx3DVerifyRequest(string secret, string merchantId, string account, string orderId, Amount amount, Card card, string paRes, Comments comments)
     : base(secret, merchantId, account, orderId, amount, card, comments)
 {
     PaRes = paRes;
     Type = "3ds-verifysig";
     IsSecure = true;
 }
开发者ID:JonCanning,项目名称:RealEx.NET,代码行数:7,代码来源:RealEx3DVerifyRequest.cs


示例6: AddComment

        public string AddComment(int postID, string commentTxt)
        {
            Comments comment = new Comments();
            comment.MemberId = Context.Session["memberID"].ToString();
            comment.CommentText = commentTxt;
            comment.PostId = postID;
            messageDAL.InsertComment(comment);

            //Insert notification
            NotificationDAL notificationDAL = new NotificationDAL();

            Post aPost = new Post(postID);

            List<Member> MemberList = new List<Member>();
            MemberList = notificationDAL.GetPostOwner(aPost);
            string friendId = MemberList[0].MemberId;
            Member aFriend = new Member(friendId);

            Member aMember = new Member(Context.Session["memberID"].ToString());

            if (aMember.MemberId != aFriend.MemberId)
            {
                notificationDAL.InsertCommentedOnPostNotification(aMember, aFriend, aPost);
            }
            //Refreshing the Comment count
            Post post = new Post();
            post.PostId = comment.PostId;

            return messageDAL.CountComments(post).ToString();
        }
开发者ID:Ndiya999,项目名称:Bulabula,代码行数:30,代码来源:processComments.asmx.cs


示例7: GetComment

 public void GetComment()
 {
     string connectionString = ConfigurationManager.AppSettings.Get("connString");
     Comments commentObj = new Comments();
     commentObj.CommentId = int.Parse(Request.QueryString["CommentId"].ToString());
     BusinessLayer businessObj = new BusinessLayer ();
     DataSet dsComment = businessObj.getComments(commentObj, connectionString);
     txtComment.Text = dsComment.Tables[0].Rows[0][0].ToString();
 }
开发者ID:san2488,项目名称:medicopedia,代码行数:9,代码来源:EditComment.aspx.cs


示例8: Create

 public string Create(Comments Model)
 {
     //Bll实例化放action里面 为了不让每次都实例化 产生废代码
     CommentsBll bll = new CommentsBll();
     //控制器里直接返回Bll里的返回结果 不写任何逻辑代码
     //保存的企业ID从登录信息里面取 所以必须要在这里赋值 因为登录信息是在BaseController里的
     Model.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
     return bll.AddOrUpdate(Model);
 }
开发者ID:myname88,项目名称:myjobs,代码行数:9,代码来源:CommentsController.cs


示例9: GetComments

 public void GetComments()
 {
     string connectionString = ConfigurationManager.AppSettings.Get("connString");
     Comments commentObj = new Comments();
     commentObj.AdviceId = int.Parse(Session["AdviceId"].ToString());
     BusinessLayer businessLayerObj = new BusinessLayer();
     DataSet dsComment = businessLayerObj.SelectComment(commentObj, connectionString);
     gvShowComments.DataSource = dsComment;
     gvShowComments.DataBind();
 }
开发者ID:san2488,项目名称:medicopedia,代码行数:10,代码来源:DisplayAdvice.ascx.cs


示例10: RealExAuthRequest

 public RealExAuthRequest(string secret, string merchantId, string account, string orderId, Amount amount, Card card, TssInfo tssInfo, bool autoSettle, string custNum, string prodId, string varRef, Comments comments)
     : base(secret, merchantId, account, orderId, amount, card, comments)
 {
     TssInfo = tssInfo;
     CustNum = custNum;
     ProdId = prodId;
     VarRef = varRef;
     Type = "auth";
     AutoSettle = new AutoSettle(autoSettle);
 }
开发者ID:JonCanning,项目名称:RealEx.NET,代码行数:10,代码来源:RealExAuthRequest.cs


示例11: SaveComment

 protected void SaveComment()
 {
     string connectionString = ConfigurationManager.AppSettings.Get("connString");
     Comments comment = new Comments();
     comment.CommentDateTime = DateTime.Now;
     comment.Username = Session["Username"].ToString();
     comment.AdviceId = int.Parse(Session["AdviceId"].ToString());
     comment.CommentsField = txtComment.Text;
     BusinessLayer businessLayerObj = new BusinessLayer();
     businessLayerObj.InsertComment(comment, connectionString);
 }
开发者ID:san2488,项目名称:medicopedia,代码行数:11,代码来源:PostComment.ascx.cs


示例12: AddComment

 public ActionResult AddComment(FormCollection form)
 {
     int id = int.Parse(form["id"].ToString());
     string comment = form["comment"].ToString();
     using (var db = new RazomContext())
     {
         Comments c = new Comments { PlaceID = id, Message = comment };
         db.Comments.Add(c);
         db.SaveChanges();
     }
     return RedirectToAction("Show", new { id=id});
 }
开发者ID:Razom,项目名称:Razom,代码行数:12,代码来源:PlaceController.cs


示例13: btnPost_Click

 protected void btnPost_Click(object sender, EventArgs e)
 {
     objComments = new Comments();
     objComments.CommentID = 0;
     objComments.BugID = intBugID;
     objComments.Name = Server.HtmlEncode(txtName.Text.Trim());
     objComments.Comment = Server.HtmlEncode(txtComments.Text.Trim());
     int i=objComments.postComments();
     if (i == 1)
     {
         fillComments();
     }
 }
开发者ID:dineshkummarc,项目名称:BugBase,代码行数:13,代码来源:ucComments.ascx.cs


示例14: Add_Comment

 public void Add_Comment()
 {
     //Act
      Comments testComment = new Comments("TestComment", "Comment to add for testing", m_ParentTaskID);
      int initalCommentCount = m_ScrumToolDBContext.Comments.Count();
      //Arrange
      m_CommentController.Create(testComment);
      //Assert
      m_ScrumToolDBContext.Comments.Should().NotBeNullOrEmpty()
      		.And.HaveCount(initalCommentCount + 1, "Inital Comment Count + 1");
      m_ScrumToolDBContext.Comments.Last().ShouldBeEquivalentTo(testComment,
      		options => options.Excluding(c => c.ID), "The last comment object in the table should be the testComment");
 }
开发者ID:Foysal94,项目名称:Scrum-Tool,代码行数:13,代码来源:CommentControllerTests.cs


示例15: UpdateComment

 public void UpdateComment()
 {
     string connectionString = ConfigurationManager.AppSettings.Get("connString");
     Comments commentObj = new Comments();
     if (txtComment.Text.Equals(string.Empty) == false)
     {
         commentObj.CommentsField = txtComment.Text;
         commentObj.CommentId = int.Parse(Request.QueryString["CommentId"].ToString());
         BusinessLayer businessObj = new BusinessLayer();
         businessObj.UpdateComment(commentObj, connectionString);
         Response.Redirect("VoteAndCommentInfo.aspx");
     }
     else
         lblError.Text = "Blank Comment Cannot Be Submitted";
 }
开发者ID:san2488,项目名称:medicopedia,代码行数:15,代码来源:EditComment.aspx.cs


示例16: fillComments

 private void fillComments()
 {
     SqlDataReader dr = null;
     objComments = new Comments();
     objComments.BugID = intBugID;
     dr=(SqlDataReader)objComments.getallComments();
     if (dr.HasRows)
     {
         dlShowComments.DataSource = dr;
         dlShowComments.DataBind();
     }
     else
     {
         lblError.Text = "No Comments Found";
     }
 }
开发者ID:dineshkummarc,项目名称:BugBase,代码行数:16,代码来源:ucComments.ascx.cs


示例17: addcomment

    protected void addcomment(object sender, ImageClickEventArgs e)
    {
        Security.UserInfo usr = new Security.UserInfo();
        string username = Session["USERNAME"].ToString();
        Security.UserInfo usrs = usr.getUserProfileFromEmail(username);

        Comments com = new Comments();
        string brandid = Request.QueryString["id"];
        com.BrandID =""+ brandid+"";
        com.Comment = txtdiscption.InnerText;
        com.UserID = usrs.UserID;
        com.Deleted = false;
        com.Date = System.DateTime.Now;
        com.PostAsAnonymous = false;
        com.BrandCommentID = 0;
        com.CreateComment(com);
    }
开发者ID:ziad007,项目名称:URI3,代码行数:17,代码来源:Branddetail.aspx.cs


示例18: info

    public void info()
    {
        string t = Request.QueryString["id"];
           Brand brand = new Brand();
           int brandid = int.Parse(t);
           brand = brand.getBrandDetails(brandid.ToString());

           brandlogo.Src = "Images/" + brand.Logo;
           brandlogo.Width = 100;
           brandlogo.Height = 80;
           description.InnerText = brand.BrandDescription;
           name.Text = brand.BrandName;
           website.HRef = "http://" + brand.Website;
           website.InnerText = brand.Website;

           Comments comments = new Comments();
           List<Comments> topcomments = comments.TopThreeComments(5);

           Table tblComments = new Table();

           tblComments.Width = Unit.Percentage(100);
           tblComments.Height = Unit.Percentage(100);
           TableRow tblrowcom = new TableRow();
           TableCell tblcellcom = new TableCell();

           for (int j = 0; j < topcomments.Count; j++)
           {
               tblcellcom.Text = topcomments[j].Comment;
               tblrowcom.Cells.Add(tblcellcom);
               tblComments.Controls.Add(tblrowcom);
               tblcellcom = new TableCell();
               tblrowcom = new TableRow();

               tblcellcom.Text = topcomments[j].Date.ToString();
               tblrowcom.Cells.Add(tblcellcom);
               tblComments.Controls.Add(tblrowcom);
               tblcellcom = new TableCell();
               tblrowcom = new TableRow();

           }
           phbrand.Controls.Add(tblComments);
    }
开发者ID:ziad007,项目名称:URI3,代码行数:42,代码来源:Branddetail.aspx.cs


示例19: associations_can_be_added_directly_to_gemini

        void associations_can_be_added_directly_to_gemini()
        {
            before = () =>
            {
                comments = new Comments();

                seed = new Seed();

                seed.PurgeDb();

                seed.CreateTable("Blogs", new dynamic[] 
                {
                    new { Id = "int", Identity = true, PrimaryKey = true },
                    new { Title = "nvarchar(255)" },
                    new { Body = "nvarchar(max)" }
                }).ExecuteNonQuery();

                seed.CreateTable("Comments", new dynamic[] 
                {
                    new { Id = "int", Identity = true, PrimaryKey = true },
                    new { BlogId = "int", ForeignKey = "Blogs(Id)" },
                    new { Text = "nvarchar(1000)" }
                }).ExecuteNonQuery();

                blogId = new { Title = "Some Blog", Body = "Lorem Ipsum" }.InsertInto("Blogs");

                commentId = new { BlogId = blogId, Text = "Comment 1" }.InsertInto("Comments");
            };

            it["change tracking methods exist when changes is mixed in"] = () =>
            {
                act = () => comment = comments.Single(commentId);

                it["returns blog associated with comment"] = () =>
                {
                    (comment.Blog().Id as object).should_be(blogId as object);
                };
            };
        }
开发者ID:eugman,项目名称:Oak,代码行数:39,代码来源:core_behavior_for_associations.cs


示例20: CommentCreate_AsPreMod_ReturnCorrectError

        public void CommentCreate_AsPreMod_ReturnCorrectError()
        {            
            var siteName = "h2g2";
            var siteId = 1;
            var uid = "uid";
            var text = "test text";
            var siteList = mocks.DynamicMock<ISiteList>();
            var readerCreator = mocks.DynamicMock<IDnaDataReaderCreator>();
            var site = mocks.DynamicMock<ISite>();
            var reader = mocks.DynamicMock<IDnaDataReader>();
            var cacheManager = mocks.DynamicMock<ICacheManager>();
            var callingUser = mocks.DynamicMock<ICallingUser>();
            var commentForum = new CommentForum { Id = uid, SiteName = siteName, ModerationServiceGroup = ModerationStatus.ForumStatus.PreMod };
            var commentInfo = new CommentInfo { text = text };

            callingUser.Stub(x => x.IsSecureRequest).Return(true);

            callingUser.Stub(x => x.UserID).Return(1);
            callingUser.Stub(x => x.IsUserA(UserTypes.SuperUser)).Return(false).Constraints(Is.Anything());

            cacheManager.Stub(x => x.GetData("")).Return(null).Constraints(Is.Anything());

            site.Stub(x => x.SiteID).Return(siteId);
            site.Stub(x => x.IsEmergencyClosed).Return(false);
            site.Stub(x => x.IsSiteScheduledClosed(DateTime.Now)).Return(false);

            reader.Stub(x => x.HasRows).Return(true);
            reader.Stub(x => x.Read()).Return(true).Repeat.Once();

            readerCreator.Stub(x => x.CreateDnaDataReader("commentcreate")).Return(reader);

            siteList.Stub(x => x.GetSite(siteName)).Return(site);
            mocks.ReplayAll();

            var comments = new Comments(null, readerCreator, cacheManager, siteList);
            comments.CallingUser = callingUser;
            var comment = comments.CreateComment(commentForum, commentInfo);

            Assert.IsNotNull(comment);
            readerCreator.AssertWasCalled(x => x.CreateDnaDataReader("commentcreate"));
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:41,代码来源:CommentsTest.cs



注:本文中的Comments类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Commit类代码示例发布时间:2022-05-24
下一篇:
C# CommentType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap