Esempio n. 1
0
        //update or insert new review
        public HttpResponseMessage Post(ReviewDTO review)
        {
            if (ModelState.IsValid) {
                if (review.Id >= 0) {
                    _service.EditReview(review);
                }
                else {
                    _service.AddReview(review);
                    return Request.CreateResponse(HttpStatusCode.OK, review);
                }

            }
            return Request.CreateErrorResponse(HttpStatusCode.BadRequest, this.ModelState);
        }
Esempio n. 2
0
        public IList <ReviewDTO> GetReviews(int movieId)
        {
            var reviews = new List <ReviewDTO>();

            using (var db = new MovieReviewContext())
            {
                var reviewsSearch = db.Review.Where(r => r.MovieId == movieId).OrderBy(r => r.Date);

                foreach (Review review in reviewsSearch)
                {
                    var reviewDTO = new ReviewDTO();

                    reviewDTO.Comment  = review.Comment;
                    reviewDTO.Score    = review.Score;
                    reviewDTO.UserName = db.User.Where(u => u.UserId == review.UserId).FirstOrDefault().UserName;
                    reviewDTO.Date     = review.Date;
                    reviewDTO.ReviewId = review.ReviewId;

                    reviews.Add(reviewDTO);
                }

                return(reviews);
            }
        }
Esempio n. 3
0
        public IReviewDTO GetReviewById(int reviewId)
        {
            var    reviewDTO = new ReviewDTO();
            string query     = "SELECT * FROM reviews WHERE reviews.id = " + reviewId + "";

            using var connection = MySqlFactory.CreateConnection();
            connection.Open();
            var command = MySqlFactory.CreateCommand(query, connection);

            var reader = command.ExecuteReader();

            while (reader.Read())
            {
                reviewDTO.Id            = reader.GetInt32("id");
                reviewDTO.Title         = reader.GetString("title");
                reviewDTO.Text          = reader.GetString("text");
                reviewDTO.Rating        = reader.GetInt16("rating");
                reviewDTO.WriterId      = reader.GetInt32("writerId");
                reviewDTO.UsedServiceId = reader.GetInt32("usedServiceId");
                reviewDTO.DateOfPost    = reader.GetDateTime("dateOfPost");
            }

            return(reviewDTO);
        }
        public static QueryResponseDTO <bool> AlterReviewReplay(ReviewDTO dto)
        {
            QueryResponseDTO <bool> response = new QueryResponseDTO <bool>();

            response.ResultEntity = false;

            var dataCommand = DataCommandManager.GetDataCommand("AlterReviewReplay");
            var updateRows  = dataCommand.ExecuteNonQuery(dto);

            if (updateRows > 0)
            {
                response.ResultEntity = true;
                response.Code         = ResponseStaticModel.Code.OK;
                response.Message      = ResponseStaticModel.Message.OK;
            }
            else
            {
                response.ResultEntity = false;
                response.Code         = ResponseStaticModel.Code.FAILED;
                response.Message      = ResponseStaticModel.Message.FAILED;
            }

            return(response);
        }
Esempio n. 5
0
        public IActionResult GetReview(int reviewId)
        {
            if (!_iReviewRepository.ReviewExists(reviewId))
            {
                return(NotFound());
            }

            var review = _iReviewRepository.GetReview(reviewId);

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var reviewDto = new ReviewDTO()
            {
                Id         = review.Id,
                Headline   = review.Headline,
                Rating     = review.Rating,
                ReviewText = review.ReviewText
            };

            return(Ok(reviewDto));
        }
Esempio n. 6
0
        private ReviewDTO ReviewToDTO(Review review)
        {
            var work = _unitOfWork.BookRepository
                       .Query
                       .Include(b => b.Work)
                       .Where(b => b.Id == review.BookId)
                       .Select(b => b.Work.Name)
                       .FirstOrDefault();

            var reviewDto = new ReviewDTO
            {
                Id            = review.Id,
                BookId        = review.BookId,
                Description   = review.Description,
                Avatar        = review.Sender.Avatar,
                FromAccountId = review.Sender.Id,
                To            = review.To,
                ToAccountId   = review.ToAccountId,
                Date          = review.Date,
                Grade         = review.Grade,
                WorkName      = review.WorkName ?? work
            };

            switch (review.Sender.Role.Id)
            {
            case 2:
            case 3:
                var customer = _unitOfWork.CustomerRepository.Query
                               .Include(p => p.Person)
                               .Include(p => p.Person.Account)
                               .Single(p => p.Person.Account.Id == review.Sender.Id);
                reviewDto.From          = $"{customer.Person.Name} {customer.Person.Surname}";
                reviewDto.FromProfileId = customer.Id;
                break;

            case 4:
                var company = _unitOfWork.CompanyRepository.Query
                              .Include(p => p.Account)
                              .Single(p => p.Account.Id == review.Sender.Id);
                reviewDto.From = company.Name;
                break;

            case 5:
                var adminPerson = _unitOfWork.PersonRepository.Query
                                  .Include(p => p.Account)
                                  .FirstOrDefault(x => x.Account.Id == review.Sender.Id);

                if (adminPerson == null)
                {
                    var adminCompany = _unitOfWork.CompanyRepository.Query
                                       .Include(p => p.Account)
                                       .Single(p => p.Account.Id == review.Sender.Id);
                }

                reviewDto.From = $"{adminPerson.Name} {adminPerson.Surname}";
                break;

            default:
                return(null);
            }

            return(reviewDto);
        }
Esempio n. 7
0
 public void AddReview(ReviewDTO reviewDTO)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
 //methods from Review Service
 public ReviewDTO addReview(ReviewDTO model)
 {
     return(_reviewService.addReview(model));
 }
        public async Task CreateAsync_ShouldUndeleteRecordReviewCommentsIfExist()
        {
            //Arrange
            var options = InMemory.GetOptions("CreateAsync_ShouldUndeleteRecordReviewCommentsIfExist");

            using (var context = new BOContext(options))
            {
                var review = new Review
                {
                    Description = "Great",
                    Beer        = new Beer()
                    {
                        Name = "Carlsberg"
                    },
                    User = new User()
                    {
                        IDOld = 1, Name = "SuperMan"
                    },
                    IsDeleted = true,
                    DeletedOn = DateTime.UtcNow,
                    Comments  = new List <Comment>()
                    {
                        new Comment()
                        {
                            Description = "Some description",
                            User        = new User()
                            {
                                IDOld = 2, Name = "Batman"
                            },
                            IsDeleted = true,
                            DeletedOn = DateTime.UtcNow
                        }
                    }
                };
                context.Reviews.Add(review);
                await context.SaveChangesAsync();
            }

            using (var context = new BOContext(options))
            {
                var reviewDTO = new ReviewDTO
                {
                    Description = "Great",
                    Beer        = new BeerDTO()
                    {
                        Name = "Carlsberg"
                    },
                    User = new UserDTO()
                    {
                        Name = "SuperMan"
                    }
                };
                //Act
                var sut = new ReviewsService(context);
                await sut.CreateAsync(reviewDTO);

                var dbresult = await context.Reviews.FindAsync(1);

                var dbCommentResult = await context.Comments.FindAsync(1);

                //Assert
                Assert.AreEqual(dbresult.Description, "Great");
                Assert.AreEqual(dbresult.DeletedOn, null);
                Assert.AreEqual(dbresult.IsDeleted, false);
                Assert.AreEqual(dbCommentResult.Description, "Some description");
                Assert.AreEqual(dbCommentResult.DeletedOn, null);
                Assert.AreEqual(dbCommentResult.IsDeleted, false);
            }
        }
Esempio n. 10
0
        public void Insert(ReviewDTO review)
        {
            var revtoAdd = ReviewDTO.ToReview(review);

            ReviewRepository.Insert(revtoAdd);
        }
Esempio n. 11
0
 public void PostReview(ReviewDTO r)
 {
     r.Timestamp        = DateTime.Now;
     r.CustomerUsername = uDb.GetUserInfo(User.Identity.Name).FullName;
     rDb.AddReview(r);
 }
        public async Task <IActionResult> AddVersion(PaperVersionsAddViewModel model)
        {
            if (model == null)
            {
                StatusMessage = "Error. Something went wrong.";
                return(View());
            }
            if (model.File == null || model.File.Length == 0)
            {
                StatusMessage = "Error. File is missing or broken.";
                return(View(model));
            }

            var user = await _userManager.GetUserAsync(HttpContext.User);

            var paper = _paperRepository.GetPaper(model.PaperId);

            if (paper == null)
            {
                StatusMessage = "Error. Paper do not exists.";
                return(RedirectToAction("MyPapers", "Papers"));
            }

            if (paper.Status != 1)
            {
                StatusMessage = "Error. You cannot add new version.";
                return(RedirectToAction("MyPapers", "Papers"));
            }
            var participancy = _participanciesRepository.GetParticipancy(paper.ParticipancyId);

            if (paper.Participancy.User.Id != user.Id)
            {
                StatusMessage = "Error. You cannot add version of this paper.";
                return(RedirectToAction("MyPapers", "Papers"));
            }

            if (!model.File.FileName.EndsWith(".doc") && !model.File.FileName.EndsWith(".docx") && !model.File.FileName.EndsWith(".pdf") && !model.File.FileName.EndsWith(".odt"))
            {
                StatusMessage = "Error. File has forbidden extension.(Only .doc .docx .pdf .odt allowed)";
                return(RedirectToAction("Add", new { id = model.PaperId }));
            }
            if (ModelState.IsValid)
            {
                string newFileName = Guid.NewGuid().ToString() + model.File.FileName.Substring(model.File.FileName.Length - 4);
                var    path        = Path.Combine(
                    Directory.GetCurrentDirectory(), "wwwroot\\Papers",
                    newFileName);

                using (var stream = new FileStream(path, FileMode.Create))
                {
                    await model.File.CopyToAsync(stream);
                }
                var paperVersion = new PaperVersionDTO
                {
                    PaperId          = model.PaperId,
                    OriginalFileName = model.File.FileName.Split('\\').Last(),
                    FileName         = newFileName,
                    Status           = 0
                };
                var newVersionId = _paperVersionRepository.AddPaperVersion(paperVersion);
                paper = _paperRepository.GetPaper(paper.Id);

                var differentJustCreatedVersion = paper.PaperVersions.FirstOrDefault(v => v.Status == 0 && v.Id != newVersionId);
                var versionWithMinorChanges     = paper.PaperVersions.FirstOrDefault(v => v.Status == 4);
                var pastVersionsWithReviews     = paper.PaperVersions.Where(v => (v.Status == 4 || v.Status == 5) && v.Reviews.Count() >= 2).OrderByDescending(v => v.CreationDate);
                if (differentJustCreatedVersion != null)
                {
                    _paperVersionRepository.SetStatusVersionRejected(differentJustCreatedVersion.Id);
                }
                else if (versionWithMinorChanges != null)
                {
                    _paperVersionRepository.SetStatusVersionAccepted(newVersionId);
                    _paperRepository.SetStatuAccepted(paper.Id);
                }
                if (pastVersionsWithReviews.Count() >= 1)
                {
                    var lastReviews = pastVersionsWithReviews.First().Reviews.Where(r => r.Recommendation != 5 && r.Recommendation != 1);
                    foreach (var critic in lastReviews)
                    {
                        var review = new ReviewDTO
                        {
                            CriticId       = critic.CriticId,
                            PaperVersionId = newVersionId,
                            Deadline       = DateTime.Now.AddMonths(1)
                        };
                        _reviewRepository.CreateReview(review);
                    }
                    _paperVersionRepository.SetStatusWaitingForReview(newVersionId);
                }

                StatusMessage = "Version has beed added.";
                return(RedirectToAction("MyPaper", "Papers", new { id = model.PaperId }));
            }
            StatusMessage = "Error. Entered data is not valid.";
            return(RedirectToAction("MyPapers", "Papers"));
        }
 public void Save([FromBody] ReviewDTO review)
 {
     _management.AddorUpdateReview(review);
 }
        public async Task <bool> CreateReview(ReviewDTO reviewDTO)
        {
            HttpResponseMessage response = await _apiUrl.PostJsonAsync(reviewDTO);

            return(response.IsSuccessStatusCode);
        }
 public void UpdateReview([FromBody] ReviewDTO review, Guid id)
 {
     review.Id = id;
     _management.AddorUpdateReview(review);
 }
        public async Task FailReview_If_BeerDoesNotExist()
        {
            var options      = TestUtils.GetOptions(nameof(FailReview_If_BeerDoesNotExist));
            var mockDateTime = new Mock <IDateTimeProvider>();

            var country = new Country
            {
                Name = "Romania"
            };
            var brewery = new Brewery
            {
                Name      = "Ariana",
                CountryId = 1
            };
            var style = new Style
            {
                Name = "Pale"
            };

            var beer = new Beer
            {
                Name      = "Zagorka",
                CountryId = 1,
                BreweryId = 1,
                StyleId   = 1,
                Abv       = 3
            };

            var user = new User
            {
                UserName = "******",
                Country  = "Bulgaristan"
            };

            var review = new ReviewDTO
            {
                UserId = 1,
                BeerId = 2,
                Text   = "text",
                Title  = "title"
            };

            using (var arrangeContext = new BeeroverflowContext(options))
            {
                await arrangeContext.Countries.AddAsync(country);

                await arrangeContext.Breweries.AddAsync(brewery);

                await arrangeContext.Styles.AddAsync(style);

                await arrangeContext.Beers.AddAsync(beer);

                await arrangeContext.Users.AddAsync(user);

                await arrangeContext.SaveChangesAsync();
            }

            using (var assertContext = new BeeroverflowContext(options))
            {
                var sut = new BeerService(assertContext, mockDateTime.Object);

                await Assert.ThrowsExceptionAsync <ArgumentNullException>(() => sut.ReviewAsync(review));
            }
        }
        public async Task ReviewBeer_When_ParamsAreValid()
        {
            var options      = TestUtils.GetOptions(nameof(ReviewBeer_When_ParamsAreValid));
            var mockDateTime = new Mock <IDateTimeProvider>();

            var country = new Country
            {
                Name = "Romania"
            };
            var brewery = new Brewery
            {
                Name      = "Ariana",
                CountryId = 1
            };
            var style = new Style
            {
                Name = "Pale"
            };

            var beer = new Beer
            {
                Name      = "Zagorka",
                CountryId = 1,
                BreweryId = 1,
                StyleId   = 1,
                Abv       = 3
            };

            var user = new User
            {
                UserName = "******",
                Country  = "Bulgaristan"
            };

            var review = new ReviewDTO
            {
                UserId = 1,
                BeerId = 1,
                Text   = "text",
                Title  = "title"
            };

            using (var arrangeContext = new BeeroverflowContext(options))
            {
                await arrangeContext.Countries.AddAsync(country);

                await arrangeContext.Breweries.AddAsync(brewery);

                await arrangeContext.Styles.AddAsync(style);

                await arrangeContext.Beers.AddAsync(beer);

                await arrangeContext.Users.AddAsync(user);

                await arrangeContext.SaveChangesAsync();
            }

            using (var assertContext = new BeeroverflowContext(options))
            {
                var sut    = new BeerService(assertContext, mockDateTime.Object);
                var result = await sut.ReviewAsync(review);

                var check = await assertContext.Reviews.Where(x => x.BeerId == 1).ToListAsync();

                Assert.AreEqual("text", check[0].Text);
                Assert.AreEqual("title", check[0].Title);
                Assert.AreEqual(1, check.Count());
            }
        }
 public Task AddReview(ReviewDTO newReview)
 {
     throw new NotImplementedException();
 }
 public void Save(ReviewDTO review, Guid id)
 {
     _reviewManagement.AddOrUpdate(review);
 }
        public async Task <ActionResult <ReviewDTO> > PostReview(ReviewDTO review)
        {
            await _reviewRepository.Create(review);

            return(CreatedAtAction("GetReview", new { id = review.ID }, review));
        }
Esempio n. 21
0
        public async Task <ActionResult <ReviewDTO> > PostReview(ReviewDTO review)
        {
            var theNewReview = await this._service.CreateAsync(review);

            return(CreatedAtAction("GetReview", theNewReview));
        }
Esempio n. 22
0
 public void  Post([FromBody] ReviewDTO reviewdto, int id)
 {
     _service.PostReview(reviewdto, User.Identity.Name, id);
 }
Esempio n. 23
0
 public Task <string> UpdateReviewAsync(ReviewDTO dto)
 {
     return(base.TryExecuteAsync(@"UPDATE Review SET Title = @Title, Content = @Content WHERE ID = @ID", dto));
 }
        public async Task CreateAsync_ShouldUndeleteReviewRecordIfExist()
        {
            //Arrange
            var options = InMemory.GetOptions("CreateAsync_ShouldUndeleteReviewRecordIfExist");

            using (var context = new BOContext(options))
            {
                var country = new Country()
                {
                    Name      = "Bulgaria",
                    Breweries = new List <Brewery>()
                    {
                        new Brewery()
                        {
                            Name  = "Brewery",
                            Beers = new List <Beer>()
                            {
                                new Beer()
                                {
                                    ABV     = 4.5f,
                                    Rating  = 2,
                                    Name    = "Carlsberg",
                                    Country = new Country()
                                    {
                                        Name = "Germany"
                                    },
                                    Style = new BeerStyle()
                                    {
                                        Name = "Ale"
                                    }
                                }
                            }
                        }
                    }
                };
                context.Countries.Add(country);
                await context.SaveChangesAsync();

                var user = new User()
                {
                    IDOld = 1, Name = "SuperMan"
                };
                context.Users.Add(user);
                await context.SaveChangesAsync();

                var review = new Review
                {
                    Description = "Great",
                    Beer        = await context.Beers.FirstOrDefaultAsync(b => b.Name == "Carlsberg"),
                    User        = await context.Users.FirstOrDefaultAsync(b => b.Name == "SuperMan"),
                    IsDeleted   = true,
                    DeletedOn   = DateTime.UtcNow
                };
                context.Reviews.Add(review);
                await context.SaveChangesAsync();
            }

            using (var context = new BOContext(options))
            {
                var reviewDTO = new ReviewDTO
                {
                    Description = "Great",
                    Beer        = new BeerDTO()
                    {
                        Name = "Carlsberg"
                    },
                    User = new UserDTO()
                    {
                        Name = "SuperMan"
                    }
                };
                //Act
                var sut = new ReviewsService(context);
                await sut.CreateAsync(reviewDTO);

                var dbresult = await context.Reviews.FindAsync(1);

                //Assert
                Assert.AreEqual(dbresult.Description, "Great");
                Assert.AreEqual(dbresult.DeletedOn, null);
                Assert.AreEqual(dbresult.IsDeleted, false);
            }
        }
Esempio n. 25
0
 public Task <string> UpdateReviewStatusAsync(ReviewDTO dto)
 {
     return(base.TryExecuteAsync(@"UPDATE Review SET Status = @Status WHERE ID = @ID", new { ID = dto.ID, Status = (int)dto.Status }));
 }
        public async Task CreateAsync_ShouldReturnModifiedReviewDTOAsync()
        {
            //Arrange
            var options = InMemory.GetOptions("CreateAsync_ShouldReturnModifiedReviewDTOAsync");

            using (var context = new BOContext(options))
            {
                var country = new Country()
                {
                    Name      = "Bulgaria",
                    Breweries = new List <Brewery>()
                    {
                        new Brewery()
                        {
                            Name  = "Brewery",
                            Beers = new List <Beer>()
                            {
                                new Beer()
                                {
                                    ABV     = 4.5f,
                                    Rating  = 2,
                                    Name    = "Carlsberg",
                                    Country = new Country()
                                    {
                                        Name = "Germany"
                                    },
                                    Style = new BeerStyle()
                                    {
                                        Name = "Ale"
                                    }
                                }
                            }
                        }
                    }
                };
                context.Countries.Add(country);
                await context.SaveChangesAsync();

                var user = new User()
                {
                    IDOld = 1, Name = "SuperMan"
                };
                context.Users.Add(user);
                await context.SaveChangesAsync();
            }

            using (var context = new BOContext(options))
            {
                var reviewDTO = new ReviewDTO
                {
                    Description = "Great",
                    Beer        = new BeerDTO()
                    {
                        Name = "Carlsberg"
                    },
                    User = new UserDTO()
                    {
                        Name = "SuperMan"
                    }
                };
                //Act
                var sut    = new ReviewsService(context);
                var result = await sut.CreateAsync(reviewDTO);

                var dbresult = await context.Reviews.FindAsync(1);

                //Assert
                Assert.AreEqual(result.ID, dbresult.ID);
                Assert.AreEqual(result.Description, dbresult.Description);
            }
        }
Esempio n. 27
0
        public async Task <IHttpActionResult> Put(ReviewDTO review)
        {
            await _reviewService.Update(ReviewDTO.MapToBusContract(review));

            return(Ok());
        }
Esempio n. 28
0
        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            if (opinions != null && opinions.Count() > 0 && !string.IsNullOrEmpty(txtSelectReview.Text))
            {
                sentences.Add(new sentence
                {
                    id       = sentenceId,
                    Text     = txtSelectReview.Text.Trim(),
                    Opinions = opinions
                });
                opinions.Clear();
            }

            using (IWebsiteCrawler digikala = new DigikalaHelper())
            {
                if (sentences != null && sentences.Count() > 0)
                {
                    if (review.sentences == null)
                    {
                        review.sentences = new List <sentence>();
                    }
                    review.sentences.AddRange(sentences);
                    sentences.Clear();
                }
                if (review != null && review.sentences != null && review.sentences.Count() > 0)
                {
                    review.CreateDate = DateTime.Now;
                    //review._id = ObjectId.GenerateNewId(DateTime.Now);
                    review.rid = digikalaProduct.DKP;
                    AddReviewToDBParam param = new AddReviewToDBParam
                    {
                        review = review,
                        id     = digikalaProduct._id,
                        tagger = user.Username
                    };
                    AddReviewToDBResponse resultAddReview = new AddReviewToDBResponse()
                    {
                        Success = false
                    };
                    //bool resultAddReview = digikala.AddReviewToDB(param); // ☺ Api
                    using (var Api = new WebAppApiCall())
                    {
                        resultAddReview = Api.GetFromApi <AddReviewToDBResponse>("AddReviewtodb", param);
                    }
                    if (resultAddReview.Success)
                    {
                        sentences.Clear();
                        sentenceIdReset();
                        review = new ReviewDTO();
                    }
                    else
                    {
                        MessageBox.Show("ثبت با مشکل روبرو شده است دوباره سعی کنید.", "Warning");
                        return;
                    }
                }
                GetFirstProductByCategoryParam getProductParam = new GetFirstProductByCategoryParam
                {
                    category = user.Category,
                    title    = user.Title,
                    Brand    = user.Brand,
                    tagger   = user.Username
                };
                // ☺ Api
                using (var Api = new WebAppApiCall())
                {
                    digikalaProduct = Api.GetFromApi <DigikalaProductDTO>("GetFirstProductByCategory", getProductParam);
                }
                //digikalaProduct = digikala.GetFirstProductByCategory<DigikalaProductDTO>(getProductParam).Result;
                commentCurrentIndex = -1;
                commentCount        = digikalaProduct.Comments.Count();
                nextReview();
                txtProductId.Text = digikalaProduct.DKP.ToString();
                txtTitle.Text     = digikalaProduct.Title;
                txtEnTitle.Text   = digikalaProduct.TitleEN;
                review.ProductID  = digikalaProduct.DKP;
            }
        }
Esempio n. 29
0
        public HomeWindow(string email)
        {
            WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            InitializeComponent();

            app = Application.Current as App;
            InitializeComponent();

            PecepiesList.ItemsSource = app.PrescriptionController.GetAll();

            this.DataContext = this;
            HideTextBoxes();
            HidePlaceHolders();
            HideResource();

            saveEdit.Visibility   = Visibility.Collapsed;
            cancleEdit.Visibility = Visibility.Collapsed;

            // Doctor
            AddressDTO tempAddress = new AddressDTO()
            {
                City = "Novi Sad", Country = "Serbia", Number = "25", PostCode = "21000", Street = "Laze Kostica"
            };

            //LoggedInDoctor = new DoctorDTO() { FirstName = "Predrag", LastName = "Kon", DateOfBirth = new DateTime(1998, 8, 25), Email = "*****@*****.**", Gender = "Muski", Jmbg = "0234567890111", TelephoneNumber = "06551232123", Address = tempAddress, MedicalRole= "Specijalista" };
            LoggedInDoctor = app.DoctorController.GetByEmail(email);

            AllDoctors    = (List <DoctorDTO>)app.DoctorController.GetAll();
            DoctorsFilter = AllDoctors;
            ListOfFiltratedDoctors.ItemsSource = DoctorsFilter;


            Email = email;

            LoggedInPatient = new PatientDTO()
            {
                Id = 1, FirstName = "Uros", LastName = "Milovanovic", DateOfBirth = new DateTime(1998, 8, 25), Email = "*****@*****.**", Gender = "Muski", InsurenceNumber = "1234567", Jmbg = "1234567890", TelephoneNumber = "06551232123", Address = tempAddress
            };

            // Current Medical Appointment
            currentMedicalAppointment = new MedicalAppointmentDTO(DateTime.Now, DateTime.Now, new RoomDTO(RoomType.hospitalRoom, "ward", "1"), MedicalAppointmentType.examination, new GuestDTO(), new List <DoctorDTO>());

            //ALl medical appoitments

            allMedicalAppointmentDTO = (List <MedicalAppointmentDTO>)app.MedicalAppointmentController.GetAllByDoctorID(LoggedInDoctor.Id);// GetAll();
            // allMedicalAppointmentDTO = (List<MedicalAppointmentDTO>) app.MedicalAppointmentController GetAll();

            Appoitments = allMedicalAppointmentDTO;

            // LIst of proporsitions

            ListOfPropositions = (List <PropositionDTO>)app.PropositionController.GetAll();

            //Current Appoitments

            /*
             * RoomDTO tempRoom = new RoomDTO() { Floor = "One", Id = 4, Ward = "Check" };
             * Appoitments = new ObservableCollection<Model.MedicalAppointmentDTO>();
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 15, 11, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 15, 12, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 18, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 14, 13, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 15, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 13, 14, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 14, 15, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 14, 1, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 15, 16, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 15, 5, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 10, 17, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 15, 5, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 11, 18, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 15, 18, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 12, 19, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 15, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 13, 10, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 14, 11, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 14, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 15, 11, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 15, 14, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 25, 11, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 25, 12, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 18, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 24, 13, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 15, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 23, 14, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 24, 15, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 14, 1, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 25, 16, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 15, 5, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 20, 17, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 15, 5, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 21, 18, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 15, 18, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 22, 19, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 15, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 23, 10, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 24, 11, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 14, 15, 30, 0), IsScheduled = true });
             * Appoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 25, 11, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 15, 14, 30, 0), IsScheduled = true });
             */


            CurrentAppoitments = new ObservableCollection <MedicalAppointmentDTO>();

            //History
            DoctorDTO tempDoctor = new DoctorDTO()
            {
                FirstName = "Filip Zdelar"
            };
            ReviewDTO tempReview = new ReviewDTO(5, "yes");


            AvailableAppoitments = new ObservableCollection <Model.MedicalAppointmentDTO>();

            ListOfRosourceses = new List <string>();
            TartgetRosource   = "";
            obrisnni          = 0;
            SelectedDate      = new DateTime();
            app          = Application.Current as App;
            Recepies     = new List <string>();
            TypeOfTermin = "";
            Title.Text  += " " + LoggedInDoctor.FirstName + " " + LoggedInDoctor.LastName;

            Medicine_toAdd.Visibility     = Visibility.Hidden;
            NumberTextBox.Visibility      = Visibility.Hidden;
            NumberTextBox_Copy.Visibility = Visibility.Hidden;
            Kol_med.Visibility            = Visibility.Hidden;
            Uc_med.Visibility             = Visibility.Hidden;
            AddMediciniToList.Visibility  = Visibility.Hidden;
        }
Esempio n. 30
0
 public void updateReview(ReviewDTO model)
 {
     throw new NotImplementedException();
 }
 public void SaveReview([FromBody] ReviewDTO review, Guid reviewId)
 {
     _reviewManagement.AddOrUpdate(review);
 }