예제 #1
0
        public List<LOAIBAIVIET> TimKiemLoaiBaiVietTheoChuyenMuc(int MaChuyenMuc)
        {
            List<LOAIBAIVIET> list = new List<LOAIBAIVIET>();
            using (LinQDataContext db = new LinQDataContext(global::DAOAuction.Properties.Settings.Default.webdoantruongConnectionString))
            {
                ISingleResult<LOAIBAIVIET_TimKiemTheoChuyenMucResult> lp = db.LOAIBAIVIET_TimKiemTheoChuyenMuc(MaChuyenMuc);
                foreach (LOAIBAIVIET_TimKiemTheoChuyenMucResult 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;
        }