protected void rptPricebf_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandArgument.Equals("btnCom")) { TextBox txtCom = e.Item.FindControl("txtCom") as TextBox; Label labOid = e.Item.FindControl("LabOid") as Label; Label labCid = e.Item.FindControl("labCid") as Label; Label labMid = e.Item.FindControl("labMid") as Label; if (txtCom == null || txtCom.Text == null || labOid == null || labMid == null) { return; } int oid = int.Parse(labOid.Text); int cid = int.Parse(labCid.Text); Model.Tao.Comment commodel = new Model.Tao.Comment(); commodel.OrderID = oid; commodel.CourseID = cid; commodel.ModuleID = int.Parse(labMid.Text); commodel.UserID = CurrentUser.UserID; commodel.Comments = txtCom.Text; commodel.CommentDate = DateTime.Now; commodel.Status = 1; BLL.Tao.Comment combll = new BLL.Tao.Comment(); if (combll.Add(commodel) > 0) { BindDatabf(); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (Session["UserInfo"] != null) { if (!string.IsNullOrEmpty(this.txtComment.Text.Trim())) { Maticsoft.Accounts.Bus.User user = (Maticsoft.Accounts.Bus.User)Session["UserInfo"]; Model.Tao.Comment commentModel = new Model.Tao.Comment(); commentModel.CourseID = (int)this.CourseID; commentModel.UserID = user.UserID; commentModel.CommentDate = DateTime.Now; if (!string.IsNullOrEmpty(HiddenField1.Value)) { commentModel.ParentID = int.Parse(HiddenField1.Value); } commentModel.Comments = this.txtComment.Text.Trim(); BLL.Tao.Comment commentBll = new BLL.Tao.Comment(); if (commentBll.Add(commentModel) > 0) { BindData(); } } else { this.lblComment.Visible = true; } } else { Common.CommonCode.GoLoginPage(); } }
private void IndexCommen(HttpContext context) { int RowCount = 0; int PageCount = 0; JsonObject json = new JsonObject(); BLL.Tao.Comment bll = new BLL.Tao.Comment(); Model.Tao.PageModel page = new Model.Tao.PageModel(); page.PageIndex = 1; page.PageSize = 10; List<Maticsoft.Model.Tao.Comment> list = bll.GetCommentList(out RowCount, out PageCount, page, -1); if (list.Count > 0) { json.Put(TAO_KEY_STATUS, TAO_STATUS_SUCCESS); json.Put("ROWCOUNT", RowCount); json.Put("PAGECOUNT", PageCount); } else { json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED); } context.Response.Write(json.ToString()); }
private void BindData() { BLL.Tao.Comment commentBll = new BLL.Tao.Comment(); int iPageIndex = this.comment_AspNetPager.CurrentPageIndex; int iPageSize = this.comment_AspNetPager.PageSize; int iTotal = commentBll.GetCommentCount(5); DataTable dt = commentBll.GetCourseMoule(5, iPageIndex, iPageSize); this.comment_AspNetPager.RecordCount = iTotal; this.DataList_CommentList.DataSource = dt; this.DataList_CommentList.DataBind(); }