本文整理汇总了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"));
}
示例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");
}
示例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");
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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});
}
示例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();
}
}
示例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");
}
示例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";
}