当前位置: 首页>>代码示例>>C#>>正文


C# Comments类代码示例

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


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


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