public OrderReviewPage(string address) { InitializeComponent(); NavigationPage.SetHasBackButton(this, false); firstLbl.WidthRequest = (App.ScreenWidth / 2) + 50; secondLbl.WidthRequest = (App.ScreenWidth / 2) - 50; if (!string.IsNullOrEmpty(address)) { //addressFrame.IsVisible = true; // addressLbl.Text = address; secondLbl.BackgroundColor = Color.FromHex("#B8074E"); secondLbl.TextColor = Color.White; secondLbl.IsEnabled = true; } BindingContext = new OrderReviewViewModel(); //language if (App.lang == "ar-AE") { this.FlowDirection = FlowDirection.RightToLeft; } else { this.FlowDirection = FlowDirection.LeftToRight; } }
public ActionResult OrderReview(OrderReviewViewModel model) { if (model.pubId > 0) { for (int i = 0; i < model.Rewiever.Count(); i++) { if (model.Rewiever[i] == true) { Review review = new Review(); ReviewStateHistory rsh = new ReviewStateHistory(); DataContext cont = new DataContext(); IUserService userService = new UserService(cont); IReviewService reviewService = new ReviewService(cont); User targetUser = userService.GetOwinUser(model.ValidUsers[i].Id); var state = reviewService.GetState("Przydzielony"); review.User = targetUser; DateTime date = DateTime.UtcNow; review.Creation_date = date; review.PublicationId = model.pubId; review.CurrentState = state; targetUser.Reviews.Add(review); reviewService.CreateReview(review, rsh, state); return(RedirectToAction("Index")); } } } return(Redirect("PublicationList")); }
public ActionResult OrderReview(int publicationId = -1) { var viewModel = new OrderReviewViewModel(); UserService service = new UserService(); List <User> _validUsers = service.GetUsersInRole("Reviewer").ToList(); if (_validUsers != null) { viewModel.ValidUsers = _validUsers; viewModel.ValidUsersCount = _validUsers.Count(); viewModel.Message = ""; viewModel.Rewiever = new bool[viewModel.ValidUsersCount]; } else { viewModel.Message = Resources.AdminPanel.ResourceManager.GetString("no_reviewers"); } viewModel.pubId = publicationId; return(View(viewModel)); }
public OrderReviewViewModel GetOrderReview(string orderId) { var orderFromDb = this.context.Orders.FirstOrDefault(x => x.Id == orderId); OrderServiceModel orderServiceModel = AutoMapper.Mapper.Map <OrderServiceModel>(orderFromDb); OrderReviewViewModel orderReviewViewModel = AutoMapper.Mapper.Map <OrderReviewViewModel>(orderServiceModel); var orderTyres = this.context.OrderTyres.Where(x => x.OrderId == orderId).ToHashSet(); var orderWheelRims = this.context.OrderWheelRims.Where(x => x.OrderId == orderId).ToHashSet(); var orderMotorOils = this.context.OrderMotorOils.Where(x => x.OrderId == orderId).ToHashSet(); orderReviewViewModel.Tyres = orderTyres; orderReviewViewModel.WheelRims = orderWheelRims; orderReviewViewModel.MotorOils = orderMotorOils; return(orderReviewViewModel); }
public OrderReviewView(IRestAPI api, ISettings settings, Order order) { InitializeComponent(); viewModel = new OrderReviewViewModel(this, api, settings, order); }