public ActionResult AddComment(BinhLuan Data) { Data.NgayBinhLuan = DateTime.Now; Data.TrangThai = 1; try { db.BinhLuans.Add(Data); db.SaveChanges(); messenger.IsSuccess = true; messenger.Message = "Cảm ơn bạn đã nhận xét sản phẩm.Nhận xét của bạn sẽ được phê duyệt sớm nhất có thể.Thank you!!!"; return(Content(JsonConvert.SerializeObject(new { messenger, }))); } catch (Exception) { messenger.IsSuccess = false; messenger.Message = "Nhận xét không thành công.Mời bạn nhận xét lại!!!"; return(Content(JsonConvert.SerializeObject(new { messenger, }))); } }
public HttpResponseMessage Delete(HttpRequestMessage request, int id) { BinhLuan modelBinhLuan = null; try { modelBinhLuan = _binhLuanService.Delete(id); _binhLuanService.SaveChange(); if (modelBinhLuan != null) { if (modelBinhLuan.IdBaiViet != null) { var baiViet = _baiVietService.GetById((int)modelBinhLuan.IdBaiViet); baiViet.SoCmt--; _baiVietService.SaveChange(); } Message = "Xóa binh luan thành công"; } else { throw new DbEntityValidationException("Xóa binh luan không thành công"); } } catch (DbEntityValidationException ex) { LogException(ex); } return(GetResponseMessage(IsSuccess, Message, 1, modelBinhLuan)); }
public ActionResult XoaBinhLuan_ajax(string matin, string macha) { try { int iLuotComment = 1; int iMaTin = int.Parse(matin); int iMaCha = int.Parse(macha); BinhLuan xoaBL = db.BinhLuans.SingleOrDefault(n => n.Id == iMaCha); IEnumerable <BinhLuan> lstxoaBL = db.BinhLuans.Where(n => n.MaBinhLuanCha == iMaCha); if (lstxoaBL.Count() > 0) { iLuotComment += lstxoaBL.Count(); db.BinhLuans.RemoveRange(lstxoaBL); } TinTuc tin = db.TinTucs.SingleOrDefault(n => n.MaTinTuc == iMaTin); tin.LuotBinhLuan -= iLuotComment; db.BinhLuans.Remove(xoaBL); db.SaveChanges(); } catch { return(Content("0")); } return(Content("1")); }
public async Task <ActionResult <BinhLuan> > PostBinhLuan(BinhLuan binhLuan) { _context.BinhLuans.Add(binhLuan); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBinhLuan", new { id = binhLuan.IDBL }, binhLuan)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,HoTen,Email,SoDienThoai,NoiDung")] BinhLuan binhLuan) { if (id != binhLuan.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(binhLuan); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BinhLuanExists(binhLuan.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(binhLuan)); }
public ActionResult Edit(int id, BinhLuan binhluans) { binhluans = (from s in data.BinhLuans where s.MaBL == id select s).FirstOrDefault(); TryUpdateModel(binhluans); data.SubmitChanges(); return(RedirectToAction("Index")); }
public HttpResponseMessage Create(HttpRequestMessage request, BinhLuan binhLuan) { BinhLuan modelBinhLuan = null; try { binhLuan.NgayBinhLuan = DateTime.Now; binhLuan.TrangThai = true; binhLuan.SoLike = 0; modelBinhLuan = _binhLuanService.Add(binhLuan); _binhLuanService.SaveChange(); if (modelBinhLuan != null) { if (binhLuan.IdBaiViet != null) { var baiViet = _baiVietService.GetById((int)binhLuan.IdBaiViet); baiViet.SoCmt++; _baiVietService.SaveChange(); } Message = "Tạo mới bình luận thành công"; } else { throw new DbEntityValidationException("tạo mới bình luận không thành công"); } } catch (DbEntityValidationException ex) { LogException(ex); } return(GetResponseMessage(IsSuccess, Message, 1, modelBinhLuan)); }
public async Task <ServiceRespone> PostBinhLuan(BinhLuan binhLuan) { ServiceRespone res = new ServiceRespone(); binhLuan.ThoiGian = DateTime.Now; _context.BinhLuans.Add(binhLuan); res.Success = true; res.Message = "Thành Công!"; try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (BinhLuanExists(binhLuan.TaiKhoan)) { res.Message = "Bình luận tiếp"; } else { res.Message = "Có lỗi!"; res.Success = false; throw; } } return(res); }
public JsonResult AddComment(int macv, string noidung) { bool status = true; UserSession user = SessionHelper.GetSession(); BinhLuan b = new BinhLuan(); b.MaCV = macv; b.MaNV = user.id; b.BinhLuan1 = noidung; b.created_at = DateTime.Now; string ten = db.NhanViens.Find(b.MaNV).HoTen; try { db.BinhLuans.Add(b); CongViec c = db.CongViecs.Find(macv); db.SaveLog(SessionHelper.GetSession().id, "Đã thêm bình luận cho công việc: " + c.MaCV + "_" + c.TieuDe, "Công việc"); db.SaveChanges(); } catch (Exception e) { status = false; } return(Json(new { noidung = noidung, macv = macv, nhavien = user.id, ten = ten, status = status })); }
public async Task <IActionResult> Edit(int id, [Bind("IDBL,IDTK,IDBV,IDCH,NgayTao,NoiDung,TrangThai")] BinhLuan binhLuan) { if (id != binhLuan.IDBL) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(binhLuan); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BinhLuanExists(binhLuan.IDBL)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IDTK"] = new SelectList(_context.TaiKhoans, "IDTK", "IDTK", binhLuan.IDTK); return(View(binhLuan)); }
public void DangBinhLuan(BinhLuan binhLuan) { if (binhLuan == null) { throw new ArgumentNullException("binhLuan", "Bình luận rỗng"); } var thanhVien = ThanhVienStore.Get(binhLuan.ThanhVienId); if (thanhVien == null) { throw new Exception("Thành viên không tồn tại"); } if (string.IsNullOrWhiteSpace(binhLuan.NoiDung)) { throw new Exception("Bình luận phải có nội dung"); } binhLuan.ThoiGian = DateTime.Now; try { BinhLuanStore.Create(binhLuan); BinhLuanStore.SaveChanges(); } catch (Exception ex) { throw new Exception("Chúng tôi đang gặp vấn đề khó về kỹ thuật khi đăng tin", ex); } }
public async Task <IActionResult> Edit(int id, [Bind("BinhLuanID,HangHoaID,NoiDung,NguoiDungID,NgayBl")] BinhLuan binhLuan) { if (id != binhLuan.BinhLuanID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(binhLuan); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BinhLuanExists(binhLuan.BinhLuanID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["HangHoaID"] = new SelectList(_context.HangHoas, "HanghoaID", "HanghoaID", binhLuan.HangHoaID); ViewData["NguoiDungID"] = new SelectList(_context.NguoiDungs, "NguoiDungID", "NguoiDungID", binhLuan.NguoiDungID); return(View(binhLuan)); }
public ActionResult BinhLuans(BinhLuan bl) { ThanhVien tv = (ThanhVien)Session["ThanhVien"]; CongTacVien ctv = (CongTacVien)Session["CTV"]; if (tv != null) { int idTV = tv.id; bl.NgayDangBL = DateTime.Now; bl.id_TV = idTV; db.BinhLuans.Add(bl); db.SaveChanges(); return(RedirectToAction("Details", "Home", new { @id = bl.id_TT })); } if (ctv != null) { int idCTV = ctv.id; bl.NgayDangBL = DateTime.Now; bl.id_CTV = idCTV; db.BinhLuans.Add(bl); db.SaveChanges(); return(RedirectToAction("Details", "Home", new { @id = bl.id_TT })); } return(RedirectToAction("Details", "Home", new { @id = bl.id_TT })); }
public async Task <IActionResult> PutBinhLuan(int id, BinhLuan binhLuan) { if (id != binhLuan.IDBL) { return(BadRequest()); } _context.Entry(binhLuan).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BinhLuanExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult> BinhLuan1(BinhLuan binhLuan) { if (ModelState.IsValid) { var ngayht = DateTime.Now.ToLocalTime(); binhLuan.ThoiGian = ngayht; _context.Add(binhLuan); await _context.SaveChangesAsync(); string rs = "<div class='review-item clearfix'>" + "<div class='review-item-submitted'>" + "<strong>" + binhLuan.HoTen + "</strong>" + "<em>" + ngayht + "</em>" + "</div>" + "<div class='review-item-content'>" + "<p> " + binhLuan.NoiDung + "</p>" + "</div>" + "</div>"; return(Content(rs, "text/plain")); } return(View("ChiTiet", binhLuan)); }
private EmailModel GetParent(BinhLuan Comment) { var par = db.BinhLuans.Find(Comment.Parent); string sub = "Bình luận sản phẩm " + par.SanPham.TenSP + " của bạn đã được phản hồi"; string bo = ""; if (!string.IsNullOrEmpty(par.MaKH)) { bo += "Xin chào " + par.AspNetUser.UserName + ",\n"; bo += "Bình luận sản phẩm " + par.SanPham.TenSP + " đã được phản hồi.\n"; bo += "Bình luận của bạn: \"" + par.NoiDung + "\"\n"; bo += "Phản hồi của chúng tôi: \"" + Comment.NoiDung + "\"\n"; bo += "Xin cảm ơn."; EmailModel email = new EmailModel(par.AspNetUser.Email, sub, bo); return(email); } bo += "Xin chào " + par.HoTen + ",\n"; bo += "Bình luận sản phẩm " + par.SanPham.TenSP + " đã được phản hồi.\n"; bo += "Bình luận của bạn: \"" + par.NoiDung + "\"\n"; bo += "Phản hồi của chúng tôi: \"" + Comment.NoiDung + "\"\n"; bo += "Xin cảm ơn."; EmailModel mail = new EmailModel(par.Email, sub, bo); return(mail); }
public JsonResult DangBinhLuan(int banTinId, int thanhVienId, string binhLuan) { try { var bantin = _banTinService.Get(banTinId); if (bantin == null) { throw new Exception("Ban tin khong ton tai"); } var bl = new BinhLuan { BanTinId = banTinId, ThanhVienId = thanhVienId, NoiDung = binhLuan, }; _binhLuanService.DangBinhLuan(bl); return(Json(new { success = true, binhLuanId = bl.BinhLuanId }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { // //TODO: Cần lưu lại lỗi throw new Exception(ex.Message); } }
public IActionResult Comment(int id) { if (HttpContext.Session.GetString("TaiKhoan") == null) { return(RedirectToAction("Login", "DocGia")); } string text = Request.Form["comment"]; if (text == "") { return(RedirectToAction("Details", "sach", new { id = id })); } // code thêm bình luận vào table bảng ở dưới BinhLuan binhLuan = new BinhLuan() { IDDocGia = (int)HttpContext.Session.GetInt32("IDDocGia"), IDSach = id, TenDocGia = (string)HttpContext.Session.GetString("TaiKhoan"), NoiDung = text, ThoiGian = DateTime.Now }; context.BinhLuans.Add(binhLuan); context.SaveChanges(); return(RedirectToAction("Details", "sach", new { id = id })); }
public PartialViewResult BinhLuan(FormCollection f) { BinhLuan binhluan = new BinhLuan(); int masach = (int)Session["MaSach"]; binhluan.NoiDung = f["binhluan"].ToString(); binhluan.MaSach = masach; binhluan.ThoiGian = DateTime.Now; if (Session["TaiKhoan"] != null) { binhluan.TenDangNhap = Session["TaiKhoan"].ToString(); } else { binhluan.TenDangNhap = "GUEST"; } if (ModelState.IsValid) { db.BinhLuans.Add(binhluan); db.SaveChanges(); } List <BinhLuan> lsBinhLuan = LayBinhLuan_TheoSach(masach); return(PartialView("BinhLuan_Partial", lsBinhLuan)); }
public ActionResult AddRepl(int masp, int parent) { var bl = new BinhLuan(); bl.SanPhamId = masp; bl.Parent = parent; return(View("RepComment", bl)); }
public ActionResult AddRepl(string masp, int parent) { BinhLuan bl = new BinhLuan(); bl.MaSP = masp; bl.Parent = parent; return(View("RepComment", bl)); }
public IEnumerable <BinhLuan> Get() { BinhLuanDAO blO = new BinhLuanDAO(); BinhLuan[] bl = new BinhLuan[blO.getDsBinhLuan().Count]; bl = blO.getDsBinhLuan().ToArray(); return(bl); }
private void QuanLyMenu_Load(object sender, EventArgs e) { textBox1.Text = Phim.totalView(); textBox2.Text = Phim.numberphim(); textBox4.Text = BinhLuan.totalComment(); textBox5.Text = Account.totalAccount(); textBox6.Text = TinTuc.totalNew(); }
public ActionResult DeleteConfirmed(int id) { BinhLuan binhLuan = db.BinhLuans.Find(id); db.BinhLuans.Remove(binhLuan); db.SaveChanges(); return(RedirectToAction("Index")); }
// POST: api/BinhLuanAPI public void Post([FromBody] BinhLuan bl) { bl.MaTaiKhoan = User.Identity.GetUserId(); bl.TinhTrang = 0; bl.ThoiGian = DateTime.Now; bl.TenTaiKhoan = User.Identity.Name; BinhLuanBUS.ThemBinhLuan(bl); }
public ActionResult Comment(IFormCollection collection) { var code = Convert.ToInt16(collection["code"]); var idBaiHoc = Convert.ToInt16(collection["idBaiHoc"]); if (code == 1) { var list = (from binhLuan in csdl.BinhLuans where binhLuan.BaiHocId == idBaiHoc orderby binhLuan.Order descending select new { id = binhLuan.BinhLuanId }).Take(10).ToList(); return(Json(list)); } if (code == 2) { var idBinhLuan = Convert.ToInt16(collection["idBinhLuan"]); var result = (from binhLuan in csdl.BinhLuans where binhLuan.BinhLuanId == idBinhLuan select new { tacGia = binhLuan.TacGia, noiDung = binhLuan.NoiDung, hinh = binhLuan.Hinh, }).First(); return(Json(result)); } if (code == 3) { int newOrder = 1; if (csdl.BinhLuans.Any()) { newOrder = (from binhLuan in csdl.BinhLuans orderby binhLuan.Order descending select binhLuan.Order).First() + 1; } BinhLuan newBinhLuan = new BinhLuan() { TacGia = collection["tacGia"], NoiDung = collection["noiDung"], BaiHocId = idBaiHoc, Hinh = collection["hinh"], Order = newOrder }; csdl.BinhLuans.Add(newBinhLuan); csdl.SaveChanges(); return(Json(newBinhLuan.BinhLuanId)); } return(null); }
public ActionResult Create(BinhLuan bl) { bl.MaTaiKhoan = User.Identity.GetUserId(); bl.TinhTrang = 0; bl.Ngay = DateTime.Now; bl.TenTaiKhoan = User.Identity.Name; BinhLuanBUS.ThemBT(bl); return(RedirectToAction("Details", "Shop", new { id = bl.MaSanPham })); }
public ActionResult Create(int id) { SanPham sanphams = data.SanPhams.SingleOrDefault(n => n.MaSP == id); // Giữ lại MaSP cho binhluans => HttpPost var binhluans = new BinhLuan(); binhluans.MaSP = sanphams.MaSP; return(View(binhluans)); }
public void ThemBinhLuan(BinhLuan bl) { string sql = "insert into BinhLuan values('" + bl.MaBinhLuan + "',N'" + bl.NoiDung + "','" + bl.Ngay + "','" + bl.MaTin + "','" + bl.MaNguoiDung + "')"; db = new DBACCESS(); db.open(); db.ExcuteQuery(sql); db.close(); }
public void SuaBinhLuan(BinhLuan bl) { string sql = "update BinhLuan set NoiDung=N'" + bl.NoiDung + "',Ngay='" + bl.Ngay + "',MaTin='" + bl.MaTin + "',MaNguoiDung='" + bl.MaNguoiDung + "' where MaBinhLuan='" + bl.MaBinhLuan + "'"; db = new DBACCESS(); db.open(); db.ExcuteQuery(sql); db.close(); }
protected void btnGui_Click(object sender, EventArgs e) { BinhLuan bl = new BinhLuan(); ThanhVien tv = (ThanhVien)Session["thanhvien"]; bl.id_BV = Convert.ToInt32(Request.QueryString["id"]); bl.id_TV = tv.id; bl.noiDung = txtNoidung.Text; bl.ngayGui = Convert.ToDateTime(DateTime.Now.ToString()); data.ThemBinhLuan(bl); Response.Redirect("Post.aspx?id="+bl.id_BV+"#binhluan"); }
protected void Page_Load(object sender, EventArgs e) { var id = Request["ID"]; var idNull = string.IsNullOrEmpty(id); var item = new BinhLuan() { RowId = Guid.NewGuid() }; using (var con = DAL.con()) { if (!idNull) { item = BinhLuanDal.SelectById(Convert.ToInt64(id)); } } Add.Item = item; }
public void ThemBinhLuan(BinhLuan bl) { string sql = "INSERT INTO tblBinhLuan(id_TV, id_BV, noiDung,ngayGui,trangThai) VALUES(@id_TV, @id_BV, @noiDung,@ngayGui,1)"; con.Open(); SqlCommand cmd = new SqlCommand(sql, con); cmd.Parameters.AddWithValue("@id_TV", bl.id_TV); cmd.Parameters.AddWithValue("@id_BV", bl.id_BV); cmd.Parameters.AddWithValue("@ngayGui", bl.ngayGui); cmd.Parameters.Add("@noiDung", SqlDbType.NText); cmd.Parameters["@noiDung"].Value = bl.noiDung; cmd.ExecuteNonQuery(); con.Close(); }
public JsonResult PostComment(BinhLuan bl) { return Json(service.PostComment(bl), JsonRequestBehavior.AllowGet); }
protected void Page_Load(object sender, EventArgs e) { var Id = Request["ID"]; var Url = Request["Url"]; var login = Security.IsAuthenticated(); var email = Request["email"]; var name = Request["name"]; var VideoUrl = Request["VideoUrl"]; var Ten = Request["Ten"]; var Anh = Request["Anh"]; var Txt = Request["Txt"]; var Tags = Request["Tags"]; var NoiDung = Request["NoiDung"]; var FromDate = Request["FromDate"]; //if (HttpContext.Current.Request.HttpMethod.ToUpper() != "POST") //{ // rendertext("Method is not allowed"); //} switch (subAct) { case "login": #region Login if(!string.IsNullOrEmpty(email)) { var u = MemberDal.SelectByUser(email); if(u.ID==0) { u = MemberDal.Insert(new Member() { Username = email ,Email = email ,Ten = name ,NgayTao = DateTime.Now , NgayCapNhat = DateTime.Now }); } Security.Login(email, "true"); } break; #endregion case "more": #region more using (var con = DAL.con()) { var List = CapNhatDal.Newest(con, "10", Security.Username, FromDate); Newest1.List = List; Newest1.Visible = true; } break; #endregion case "logout": #region logout this system Security.LogOut(); break; #endregion case "removePost": #region removePost if (Security.IsAuthenticated()) { if (!string.IsNullOrEmpty(Id)) { var item = CapNhatDal.SelectById(new Guid(Id)); if (item.Username == Security.Username) { CapNhatDal.DeleteById(item.ID); } } } break; #endregion case "wrappUrl": #region wrappUrl: Đọc url if (!string.IsNullOrEmpty(Url)) { youTubeVideo vd = Lib.YouTubeCode(Url); rendertext(string.Format("({0})", JavaScriptConvert.SerializeObject(vd))); } break; #endregion case "savePost": #region Add or Save Post if(Security.IsAuthenticated()) { CapNhat Item; if (string.IsNullOrEmpty(Id)) { Item=new CapNhat { ID = Guid.NewGuid(), NgayTao = DateTime.Now, Username = Security.Username, NgayViet = DateTime.Now }; } else { Item = CapNhatDal.SelectById(new Guid(Id)); } Item.Tags = Tags; Item.NoiDung = NoiDung; Item.Ten = Ten; Item.Anh = Anh; Item.Loai = 3;// Video Item.VideoUrl = VideoUrl; Item = string.IsNullOrEmpty(Id) ? CapNhatDal.Insert(Item) : CapNhatDal.Update(Item); rendertext(Item.ID.ToString()); } break; #endregion case "addComment": #region Add comment to post if (Security.IsAuthenticated()) { var Item = new BinhLuan(); if (!string.IsNullOrEmpty(Id)) { Item.P_RowId = new Guid(Id); } if (!string.IsNullOrEmpty(Txt)) { Txt = Giga.Common.Lib._string.getHTML(Txt); } Item.ID = Guid.NewGuid(); Item.NoiDung = Txt; Item.Username = Security.Username; Item.NgayTao = DateTime.Now; Item.Url = Url; Item = BinhLuanDal.Insert(Item); rendertext(Item.ID.ToString()); } break; #endregion default: break; } }
public static int ThemBinhLuan(BinhLuan bl) { string query = String.Format("INSERT INTO BinhLuan(MaND, NoiDung, NgayBL, MaSP) VALUES (" + bl.MaND + ", N'" + bl.NoiDung + "', '" + bl.NgayBL + "', '" + bl.MaSP + "')"); try { conn.Open(); command.CommandText = query; return command.ExecuteNonQuery(); } catch (Exception ex) { } finally { conn.Close(); } return 0; }
public static List<BinhLuan> LayDanhSachBinhLuanTheoMaSP(String masp) { List<BinhLuan> list = new List<BinhLuan>(); string query = String.Format("SELECT BL.MaBL, ND.HoTen, BL.NoiDung, BL.NgayBL, BL.MaSP, BL.DanhGiaSanPham FROM BinhLuan as BL, NguoiDung as ND WHERE BL.MaND = ND.MaND and BL.MaSP = '" + masp + "' and BL.STT = 1 ORDER BY NgayBL DESC"); try { conn.Open(); command.CommandText = query; SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { Int32 mabinhluan = reader.GetInt32(0); String hoten = reader.GetString(1); String noidung = reader.GetString(2); String ngaybl = reader.GetString(3); String masp1 = reader.GetString(4); Int32 danhgia = reader.GetInt32(5); BinhLuan sp = new BinhLuan(mabinhluan, hoten, noidung, ngaybl, masp1, danhgia); list.Add(sp); } } catch (Exception ex) { } finally { conn.Close(); } return list; }
protected void Page_Load(object sender, EventArgs e) { var Txt = Request["Txt"]; var ID = Request["ID"]; var Url = Request["Url"]; var FromDate = Request["FromDate"]; var bcyMail = new BcyMail(); switch (subAct) { case "add": #region add if(Security.IsAuthenticated()) { Item=new BinhLuan(); if(!string.IsNullOrEmpty(ID)) { Item.P_RowId = new Guid(ID); } if (!string.IsNullOrEmpty(Txt)) { Txt = Giga.Common.Lib._string.getHTML(Txt); } Item.ID = Guid.NewGuid(); Item.NoiDung = Txt; Item.Username = Security.Username; Item.NgayTao = DateTime.Now; Item.Url = Url; Item = BinhLuanDal.Insert(Item); bcyMail.BinhLuan(Item.ID); rendertext(Item.ID.ToString()); } break; #endregion case "xoa": #region add if (Security.IsAuthenticated()) { if (!string.IsNullOrEmpty(ID)) { BinhLuanDal.DeleteById(new Guid(ID)); } } break; #endregion default: break; } switch (act) { case "list": #region get list if (!string.IsNullOrEmpty(ID)) { rpt.DataSource = BinhLuanDal.ByPid(DAL.con(), ID, FromDate, "20", Security.Username); rpt.DataBind(); } break; #endregion case "view": #region get view if (!string.IsNullOrEmpty(ID)) { Item = BinhLuanDal.SelectById(new Guid(ID)); BinhLuan_PureTemplates2.Item = Item; BinhLuan_PureTemplates2.Visible = true; } break; #endregion default: break; } }