Пример #1
0
        public void OnPost(int carId)
        {
            this.Vehicle = CarRepsitory.GetVehicle(carId);
            CarId        = carId;

            string[] dateTime = UserRerpository.FindById(this.User.FindFirstValue(ClaimTypes.NameIdentifier))?.BirthDate?.Split('/');
            if (dateTime?.Length == 3)
            {
                Day   = dateTime[0];
                Month = dateTime[1];
                Year  = dateTime[2];
            }



            if (!ModelState.IsValid)
            {
                LoggedUserInfo.Id = this.User.FindFirstValue(ClaimTypes.NameIdentifier);

                LoggedUserInfo.BirthDate = (Day.Length == 2 ? Day : "0" + Day) + "-" +
                                           (Month.Length == 2 ? Month : "0" + Month) + "-" + Year;


                UserRerpository.EditBookingInfo(LoggedUserInfo);
                UserRerpository.Save();
            }
        }