Ejemplo n.º 1
0
    private void Awake()
    {
        level    = new WaitForSeconds[3];
        level[0] = new WaitForSeconds(1f);
        level[1] = new WaitForSeconds(0.5f);
        level[2] = new WaitForSeconds(0.2f);

        gameController  = FindObjectOfType <GameController>();
        progressHub     = ProgressHubOBJ.GetComponent <ProgressHub>();
        anim            = GetComponent <Animator>();
        gamecontroller  = FindObjectOfType <GameController>();
        display         = RequestObj.GetComponent <RequestDisplay>();
        stopProgress    = 0;
        progressStatus  = 0;
        isStartProgress = true;
        isWorking       = true;
        isWinner        = false;
        anim.SetBool("isWorking", isWorking);
    }
Ejemplo n.º 2
0
        public RequestDisplay GetRequestDetails(long propertyID)
        {
            RequestDisplay lst       = null;
            var            query     = db.PropertyRequests.Where(x => !x.IsDeleted && x.RequestID == propertyID && x.IsActive);
            var            singleRow = query.FirstOrDefault();

            if (singleRow == null)
            {
                return(null);
            }
            lst = query.Select(x => new RequestDisplay()
            {
                EntryDate        = x.EntryDate,
                FloorTypeTitle   = x.PropertyFloorType.FloorTypeTitle,
                Title            = x.Title,
                LocationName     = x.Location.LocationName,
                OwnerShipTitle   = x.OwnerShipType.OwnerShipTitle,
                PropertyID       = x.RequestID,
                PropPurposeTitle = x.PropertyPurpose.PropPurposeTitle,
                PropTypeTitle    = x.PropertyType.PropTypeTitle,
                AddressDetails   = x.AddressDetails,
                Comments         = x.Comments,
                MinArea          = x.MinArea,
                MaxArea          = x.MaxArea,
                MinPrice         = x.MinPrice,
                MaxPrice         = x.MaxPrice,
                UserID           = x.ByUserID,
                FullName         = db.Users.Where(z => z.UserID == x.ByUserID).Select(z => z.FullName).FirstOrDefault()
            }).FirstOrDefault();
            var userProperties = db.Properties.Where(z => z.IsActive && !z.IsDeleted && z.ByUserID == CurrentUser.UserID).AsQueryable();

            if (singleRow.MaxArea > 0)
            {
                userProperties = userProperties.Where(x => (x.Area >= singleRow.MinArea && x.Area <= singleRow.MaxPrice));
            }
            if (singleRow.MaxPrice > 0)
            {
                userProperties = userProperties.Where(x => (x.Price >= singleRow.MinPrice && x.Price <= singleRow.MaxPrice));
            }
            if (singleRow.OwnerShipTypeID.HasValue)
            {
                userProperties = userProperties.Where(x => x.OwnerShipTypeID == singleRow.OwnerShipTypeID);
            }
            if (singleRow.LocationIDs.HasValue)
            {
                userProperties = userProperties.Where(x => x.LocationID == singleRow.LocationIDs);
            }
            if (singleRow.PropertyFloorTypeID.HasValue)
            {
                userProperties = userProperties.Where(x => x.PropertyFloorTypeID == singleRow.PropertyFloorTypeID);
            }
            if (singleRow.PropertyPurposeID.HasValue)
            {
                userProperties = userProperties.Where(x => x.PropertyPurposeID == singleRow.PropertyPurposeID);
            }

            lst.MatchedProperties = userProperties.OrderByDescending(z => z.EntryDate).Select(z => new PropertyShortDisplay()
            {
                PropertyID = z.PropertyID, AddressDetails = z.AddressDetails, Area = z.Area, EntryDate = z.EntryDate, Title = z.Title, LocationName = z.Location.LocationName, OwnerShipTitle = z.OwnerShipType.OwnerShipTitle, PropPurposeTitle = z.PropertyPurpose.PropPurposeTitle, FloorTypeTitle = z.PropertyFloorType.FloorTypeTitle, PropTypeTitle = z.PropertyType.PropTypeTitle, DefaultImage = db.Files.Where(y => y.IsActive == true && y.IsDeleted != true && y.ParentType == "Properties" && y.ParentID == z.PropertyID).Select(y => y.FileName).FirstOrDefault()
            }).ToList();
            lst.PostComments = db.Comments.Where(x => x.PostID == propertyID && x.PostType == 2).OrderByDescending(x => x.CreatedDate).Select(x => new PostComment()
            {
                CommentID = x.CommentID, CommentMsg = x.CommentMsg, CreatedDate = x.CreatedDate.Value, UserID = x.UserID.Value, UserImg = x.User.ProfileImgPath, UserName = x.User.FullName
            }).ToList();

            return(lst);
        }