Ejemplo n.º 1
0
        public async Task <IActionResult> UpdateMeasurements()
        {
            Customer             current      = _context.Customers.Where(c => c.IdentityUserId == User.FindFirstValue(ClaimTypes.NameIdentifier)).SingleOrDefault();
            CustomerMeasurements measurements = _context.CustomerMeasurementss.Where(m => m.IdentityUserId == current.IdentityUserId).SingleOrDefault();

            return(View(measurements));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> CreateCustomerMeasurements(CustomerMeasurements model)
        {
            var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
            CustomerMeasurements temp = new CustomerMeasurements
            {
                StartingWeight = model.StartingWeight,
                CurrentWeight  = model.StartingWeight,
                GoalWeight     = model.GoalWeight,
                Height         = model.Height,
                Arms           = model.Arms,
                Waist          = model.Waist,
                Hips           = model.Hips,
                Neck           = model.Neck,
                Chest          = model.Chest,
                Thigh          = model.Thigh,
                Calves         = model.Calves,
                IdentityUserId = userId,
                uploadDate     = DateTime.Now
            };

            _context.CustomerMeasurementss.Add(temp);
            _context.SaveChanges();

            return(RedirectToAction("index"));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> UpdateMeasurements(CustomerMeasurements newMeasurements)
        {
            CustomerMeasurements NewMeasurement = newMeasurements;

            NewMeasurement.uploadDate     = DateTime.Now;
            NewMeasurement.IdentityUserId = User.FindFirstValue(ClaimTypes.NameIdentifier);
            _context.CustomerMeasurementss.Add(NewMeasurement);
            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }