public int LoadBaiViet() { List<BAIVIET_getall_newResult> lt = new List<BAIVIET_getall_newResult>(); BUSBaiViet BUSBaiViet = new BUSBaiViet(); lt = BUSBaiViet.SelectBAIVIETsAll_new(); LOAIBAIVIET ltLoaiBaiViet = new LOAIBAIVIET(); BUSLoaiBaiViet BUSLoaiBaiViet = new BUSLoaiBaiViet(); if (lt.Count > 0) { lt.Sort(SortByDate); this.GridViewBaiViet.DataSource = lt; GridViewBaiViet.DataBind(); PanelDanhSach.Visible = true; PanelMessage.Visible = false; // for (int i = 0; i < lt.Count; i++) // { // GridViewBaiViet.Rows[i].Cells[4].Text = BUSLoaiBaiViet.TimKiem((int)lt[i].MaLoaiBaiViet).TenLoaiBaiViet; // } return lt.Count; } else { PanelDanhSach.Visible = false; PanelMessage.Visible = true; return 0; } }
public List<LOAIBAIVIET> SelectLOAIBAIVIETsAll() { List<LOAIBAIVIET> list = new List<LOAIBAIVIET>(); using (LinQDataContext db = new LinQDataContext(global::DAOAuction.Properties.Settings.Default.webdoantruongConnectionString)) { ISingleResult<LOAIBAIVIET_getallResult> lp = db.LOAIBAIVIET_getall(); foreach (LOAIBAIVIET_getallResult LOAIBAIVIET in lp) { LOAIBAIVIET var1 = new LOAIBAIVIET(); var1.MaLoaiBaiViet = LOAIBAIVIET.MaLoaiBaiViet; var1.TenLoaiBaiViet = LOAIBAIVIET.TenLoaiBaiViet; var1.MaChuyenMuc = LOAIBAIVIET.MaChuyenMuc; list.Add(var1); } try { // Save the changes. db.SubmitChanges(); } // Detect concurrency conflicts. catch (ChangeConflictException) { // Resolve conflicts. db.ChangeConflicts.ResolveAll(RefreshMode.KeepChanges); } } return list; }
public int Them(LOAIBAIVIET lpDTO) { try { LinQDataContext db = new LinQDataContext(global::DAOAuction.Properties.Settings.Default.webdoantruongConnectionString); db.LOAIBAIVIET_add( lpDTO.TenLoaiBaiViet, lpDTO.MaChuyenMuc ); return 1; } catch { return 0; } }
public int CapNhat(LOAIBAIVIET lpDTO) { try { LinQDataContext db = new LinQDataContext(global::DAOAuction.Properties.Settings.Default.webdoantruongConnectionString); db.LOAIBAIVIET_update( lpDTO.MaLoaiBaiViet, lpDTO.TenLoaiBaiViet, lpDTO.MaChuyenMuc ); db.SubmitChanges(); return 1; } catch (Exception ex) { throw (ex); } }
public int Them(LOAIBAIVIET lpDTO) { DAOLoaiBaiViet LOAIBAIVIET = new DAOLoaiBaiViet(); return LOAIBAIVIET.Them(lpDTO); }
public int CapNhat(LOAIBAIVIET lpDTO) { DAOLoaiBaiViet LOAIBAIVIET = new DAOLoaiBaiViet(); return LOAIBAIVIET.CapNhat(lpDTO); }