コード例 #1
0
		protected void btnSubmit_Click(object sender, EventArgs e)
		{
			if (!string.IsNullOrEmpty(tbText.Text) && tbText.Text.Trim() != "") {

				var c = new Comment() {ModelID = ModelID, UnitID = UnitID, UserID = Global.LoggedUserID.Value, Time = DateTime.UtcNow, Text = tbText.Text};
				Global.Db.Comments.InsertOnSubmit(c);
				Global.Db.SubmitChanges();

				var evType = EventType.UnitCommented;
				if (ModelID != null) evType = EventType.ModelCommented;
				Global.AddEvent(evType, c.CommentID, UnitID, ModelID, c.Text);
				Global.Db.SubmitChanges();


				tbText.Text = "";
				Repeater1.DataBind();
			}
		}
コード例 #2
0
 partial void DeleteComment(Comment instance);
コード例 #3
0
 partial void UpdateComment(Comment instance);
コード例 #4
0
 partial void InsertComment(Comment instance);
コード例 #5
0
		private void detach_Comments(Comment entity)
		{
			this.SendPropertyChanging();
			entity.Model = null;
		}
コード例 #6
0
		private void attach_Comments(Comment entity)
		{
			this.SendPropertyChanging();
			entity.Model = this;
		}