• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Models.PortugalVillasContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BootstrapVillas.Models.PortugalVillasContext的典型用法代码示例。如果您正苦于以下问题:C# PortugalVillasContext类的具体用法?C# PortugalVillasContext怎么用?C# PortugalVillasContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PortugalVillasContext类属于BootstrapVillas.Models命名空间,在下文中一共展示了PortugalVillasContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Property

        public Property()
        {
            this.Bookings = new List<Booking>();
            this.Comments = new List<Comment>();
            this.Packages = new List<Package>();
            this.PropertyEntities = new List<PropertyEntity>();
            this.PropertyPricingSeasonalInstances = new List<PropertyPricingSeasonalInstance>();
            this.PropertySecurityItems = new List<PropertySecurityItem>();
            this.PropertyStaffTaskAssignments = new List<PropertyStaffTaskAssignment>();

            //set up datasets
            using (var _db = new PortugalVillasContext())
            {
                var pricesForThisProp = _db.PropertyPricingSeasonalInstances.Where(x => x.PropertyID == this.PropertyID).ToList();
                if (pricesForThisProp.Count() > 0)
                { this.PropertyPricingSeasonalInstances = _db.PropertyPricingSeasonalInstances.Where(x => x.PropertyID == this.PropertyID).ToList(); }
            }
            

            switch (this.Active)
            {
                case true:
                    CreatePriceRange();
                    break;
            }
        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:26,代码来源:PropertyPartial.cs


示例2: ReturnAllBookingsAndTransactions

        private static List<BookingAndRelatedTransactions> ReturnAllBookingsAndTransactions(long AccountID, PortugalVillasContext db)
        {
            var owner = db.PropertyOwnerAccounts.Where(x => x.AccountID == AccountID).First();
            var props = db.Properties.Where(x => x.PropertyOwnerID == owner.PropertyOwnerID).ToList();

            var bookings = new List<Booking>();

            foreach (var property in props)
            {
                bookings.AddRange(db.Bookings.Where(booking => booking.PropertyID == property.PropertyID).Include(x=>x.Property).ToList());
            }

    
            var transactions = db.AccountTransactions.Where(x => x.AccountID == AccountID).Where(x=>x.Voided != true);

            List<BookingAndRelatedTransactions> bookingAndTrans = new List<BookingAndRelatedTransactions>();

            foreach (var booking in bookings)
            {
                bookingAndTrans.Add(new BookingAndRelatedTransactions
                {
                    booking = booking,
                    transactions = transactions.Where(x=>x.BookingID == booking.BookingID).ToList()
                });
            }




            return bookingAndTrans;
        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:31,代码来源:PropertyOwnerAccount.cs


示例3: CreateAccountsForOwnersWithoutAccount

        public static int CreateAccountsForOwnersWithoutAccount(PortugalVillasContext db)
        {
            //get all ownersIDs
            var owners = db.PropertyOwners.ToList();
            //checks they all have an account is accounts
            var accounts = db.PropertyOwnerAccounts.ToList();

            List<PropertyOwnerAccount> accountsToCreate = new List<PropertyOwnerAccount>();

            foreach (var propertyOwner in owners)
            {
                var account = accounts.Where(x => x.PropertyOwnerID == propertyOwner.PropertyOwnerID).FirstOrDefault();
                if (account == null)
                {
                    db.PropertyOwnerAccounts.Add(new PropertyOwnerAccount
                    {
                        AccountBalance = 0.00M,
                        PropertyOwnerID = propertyOwner.PropertyOwnerID
                    });


                }
            }

            

            return db.SaveChanges();

        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:29,代码来源:PropertyOwnerAccount.cs


示例4: GetRandomTopRatedComments

        public static List<Comment> GetRandomTopRatedComments()
        {
            try
            {
                PortugalVillasContext _db = new PortugalVillasContext();

                List<Comment> theCommentsList = new List<Comment>();

                return theCommentsList = _db.Comments.Where(x => x.StarRating > 2)
               .Where(x => x.Approved == true).Take(10)
               .ToList();

                
            }
            catch (Exception ex)
            {
                
                throw ex;
            }



            throw new Exception();

        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:25,代码来源:CommentPartial.cs


示例5: GetBookingExtraAttributesByBookingExtraID

        public static List<BookingExtraAttribute> GetBookingExtraAttributesByBookingExtraID(long? bookingExtraID)
        {
            List<BookingExtraAttribute> theListOfAttributes = new List<BookingExtraAttribute>();
            PortugalVillasContext _db = new PortugalVillasContext();

            return theListOfAttributes = _db.BookingExtraAttributes.Where(x => x.BookingExtraID == bookingExtraID).ToList();
        }
开发者ID:nadavdrewe,项目名称:portugalvillas,代码行数:7,代码来源:BookingExtraPartial.cs


示例6: GetCustomerBankDetailFromCustomer

        /// <summary>
        /// Gets 
        /// </summary>
        public static CustomerBankDetail GetCustomerBankDetailFromCustomer(Customer aCustomer)
        {
            PortugalVillasContext db = new PortugalVillasContext();
            CustomerBankDetail theBankDetailsToReturn = db.CustomerBankDetails.Where(x => x.CustomerID == aCustomer.CustomerID).FirstOrDefault();
            return theBankDetailsToReturn;

        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:10,代码来源:CustomerBankDetail.cs


示例7: CreateDocumentAndSaveToLocation

        //
        // GET: /DocumentMangementService/

    

        public ActionResult CreateDocumentAndSaveToLocation()
        {
            var db = new PortugalVillasContext();
            var parentContainer = new BookingParentContainer();

            //dependenceies
            var dc = new DocumentGenerationController();
            var customer = db.Customers.Find(1);
            var booking = db.Bookings.Find(4);
            var type = PRCDocument.PRCDocumentType.UK_WineTasting;

            //create a document with all parsed variables
            var document = dc.CreateDocumentToFileSystem(customer, type, booking);

      /*      db.Documents.Add(new Document
            {
                CustomerID = customer.CustomerID,
                DocumentBLOB = document,
                EventID = 2
                
            });

            db.SaveChanges();*/

            //save it to the DB or the FileSystem
            return RedirectToAction("Dashboard", "Admin");
        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:32,代码来源:DocumentMangementServiceController.cs


示例8: GetBookingExtraTypes

        //get all the booking extra types
        public static List<BookingExtraType> GetBookingExtraTypes()
        {
            List<BookingExtraType> theList = new List<BookingExtraType>();
            PortugalVillasContext _db = new PortugalVillasContext();

            return theList = _db.BookingExtraTypes.ToList();
        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:8,代码来源:BookingExtraPartial.cs


示例9: GetBookingByID

        //get individual booking by ID -- NEED TO TEST FOR EMPTY RESULT
        public static Booking GetBookingByID(int bookingID)
        {
            PortugalVillasContext _db = new PortugalVillasContext();

            var aBooking = _db.Bookings.Include(x => x.Property).FirstOrDefault(x => x.BookingID == bookingID);

            return aBooking;
        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:9,代码来源:BookingPartial.cs


示例10: GetAllProperties

        /////////////////////////////
        //// STATIC METHODS
        /////////////////////////////
        //INT or STRING methods to get a list of properties- all return List<Property>
        //////////////////////////////////////////////////////////
        ////These methods pull back Properties based on given criteria
        //////////////////////////////////////////////////////////
        public static List<Property> GetAllProperties()
        {
            PortugalVillasContext _db = new PortugalVillasContext();

               var allProperties = _db.Properties.ToList();

               return allProperties;
        }
开发者ID:nadavdrewe,项目名称:portugalvillas,代码行数:15,代码来源:PropertyPartial.cs


示例11: GetAllCommentSectionsForComment

        public static List<CommentSection> GetAllCommentSectionsForComment(Comment aComment)
        {
            PortugalVillasContext _db = new PortugalVillasContext();
            List<CommentSection> theCommentSections = new List<CommentSection>();

            theCommentSections = _db.CommentSections.Where(x => x.CommentID == aComment.CommentID).ToList();

            return theCommentSections;
        }
开发者ID:nadavdrewe,项目名称:portugalvillas,代码行数:9,代码来源:CommentSectionPartial.cs


示例12: GetBookingExtras

        //get all the booking extras - return list
        public static List<BookingExtra> GetBookingExtras()
        {
            List<BookingExtra> theList = new List<BookingExtra>();
            PortugalVillasContext _db = new PortugalVillasContext();

            return theList = _db.BookingExtras
                .Where(x => x.TopLevelItem == true)
                .ToList();
        }
开发者ID:nadavdrewe,项目名称:portugalvillas,代码行数:10,代码来源:BookingExtraPartial.cs


示例13: GetMaxBooking

    protected DateTime? GetMaxBooking()
    {
        PortugalVillasContext _db = new PortugalVillasContext();
        DateTime? maxBooking = _db.Bookings
            .Max(x => x.StartDate);
 
  
        return maxBooking;
    }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:9,代码来源:BookingCalendar.cs


示例14: GetTitles

        //////////TITLES//////////////////
        //////////////////////////////////
        //GET the title
        public static List<Title> GetTitles()
        {
            using(PortugalVillasContext _db = new PortugalVillasContext()){

             List<Title> TitleList = _db.Titles.ToList();

             return TitleList;
            }
        }
开发者ID:nadavdrewe,项目名称:portugalvillas,代码行数:12,代码来源:GeneralHelperMethods.cs


示例15: GetSingleCustomer

        public static Customer GetSingleCustomer(long? CustomerID)
        {
            PortugalVillasContext _db = new PortugalVillasContext();

            var aCustomer = (_db.Customers
                                     .Where(x => x.CustomerID == CustomerID).First());

            return (Customer) aCustomer;
        }
开发者ID:nadavdrewe,项目名称:portugalvillas,代码行数:9,代码来源:CustomerPartial.cs


示例16: GetBookingExtrasFromBookingExtraSelection

        public static List<BookingExtra> GetBookingExtrasFromBookingExtraSelection(BookingExtraSelection aBookingExtraSelection)
        {
            List<BookingExtra> aBookingExtra = new List<BookingExtra>();

            PortugalVillasContext _db = new PortugalVillasContext();

            aBookingExtra = _db.BookingExtras.Where(x => x.BookingExtraID == aBookingExtraSelection.BookingExtraID).ToList();

            return aBookingExtra;
        }
开发者ID:nadavdrewe,项目名称:portugalvillas,代码行数:10,代码来源:BookingExtraSelectionPartial.cs


示例17: ReturnPDFDocument

        //
        // GET: /Document/

        public FileContentResult ReturnPDFDocument(long id)
        {
            using (var db = new PortugalVillasContext())
            {
                var doc = db.Documents.First(c => c.DocumentID == id); //.DocumentTable.First(p => p.DocumentUID == id);
                byte[] data = doc.DocumentBLOB;
                return File(data, "application/pdf", doc.DocumentName);
            }

        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:13,代码来源:DocumentController.cs


示例18: GetPRCInformation

        public static PRCInformation GetPRCInformation()
        {
            using (var db = new PortugalVillasContext())
            {
                return db.PRCInformations.FirstOrDefault();
            }
            


        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:10,代码来源:PRCInformationPartial.cs


示例19: GetCommentReplies

        public static List<CommentReply> GetCommentReplies()
        {
            PortugalVillasContext _db = new PortugalVillasContext();

            List<CommentReply> theCommentReplies = new List<CommentReply>();

            theCommentReplies = _db.CommentReplies.Where(x => x.Approved == true).ToList();
            
            return theCommentReplies;
        }
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:10,代码来源:CommentReply.cs


示例20: GetBookingExtraIDByPRCReference

        public static long GetBookingExtraIDByPRCReference(string prcRef)
        {
            PortugalVillasContext _db = new PortugalVillasContext();

            long theID = _db.BookingExtras
                .Where(x => x.LegacyReference == prcRef.Trim())
                .Select(x => x.BookingExtraID).First();

            return theID;
        }
开发者ID:nadavdrewe,项目名称:portugalvillas,代码行数:10,代码来源:BookingExtraPartial.cs



注:本文中的BootstrapVillas.Models.PortugalVillasContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Box2CS.Vec2类代码示例发布时间:2022-05-24
下一篇:
C# Data.SqlFilter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap