public IActionResult Profile(string id)
        {
            EquipmentAssignment pUser = lIAssignmentInterface.getEquipmentAssignment(id);


            List <SelectListItem> myList = new List <SelectListItem>()
            {
                new SelectListItem {
                    Value = "1", Text = "Ankle Unit"
                },
                new SelectListItem {
                    Value = "2", Text = "Knee Unit"
                },
                new SelectListItem {
                    Value = "3", Text = "Elbow Unit"
                },
                new SelectListItem {
                    Value = "4", Text = "Shoulder Unit"
                },
            };

            ViewBag.equipment = myList;

            List <User> _userPatientlist = lIUserRepository.getUserListByType(1);

            var ObjList = _userPatientlist.Select(r => new SelectListItem
            {
                Value = r.UserId.ToString(),
                Text  = r.Name
            });

            ViewBag.Patient = new SelectList(ObjList, "Value", "Text");
            ViewBag.Patient = ObjList;

            List <User> _userTherapistlist = lIUserRepository.getUserListByType(2);

            var ObjTherapistList = _userTherapistlist.Select(r => new SelectListItem
            {
                Value = r.UserId.ToString(),
                Text  = r.Name
            });

            ViewBag.Therapists = new SelectList(ObjList, "Value", "Text");
            ViewBag.Therapists = ObjTherapistList;
            EquipmentView pequipment = UserExtension.EquipmentToEquipmentAssignmentExtension(pUser);

            return(View(pequipment));
        }
        public JsonResult Post([FromBody] EquipmentAPi pEquipmentAssignment)
        {
            ErrorResponse       error = new ErrorResponse();
            EquipmentAssignment lEquipmentAssignment;
            var    response = new Dictionary <string, object>();
            string result   = string.Empty;

            try
            {
                logger.LogDebug("EquipmentAssignment Post Start");
                if (!String.IsNullOrEmpty(pEquipmentAssignment.AssignmentId))
                {
                    lEquipmentAssignment = lIEquipmentAssignmentRepository.getEquipmentAssignment(pEquipmentAssignment.AssignmentId);

                    if (lEquipmentAssignment == null)
                    {
                        lEquipmentAssignment = new EquipmentAssignment();
                        lEquipmentAssignment.AssignmentId  = pEquipmentAssignment.AssignmentId;
                        lEquipmentAssignment.InstallerId   = pEquipmentAssignment.InstallerId;
                        lEquipmentAssignment.PatientId     = pEquipmentAssignment.PatientId;
                        lEquipmentAssignment.DateInstalled = pEquipmentAssignment.DateInstalled;
                        lEquipmentAssignment.DateRemoved   = pEquipmentAssignment.DateRemoved;
                        lEquipmentAssignment.Limb          = pEquipmentAssignment.Limb;
                        lEquipmentAssignment.Side          = pEquipmentAssignment.Side;
                        lEquipmentAssignment.ExcerciseEnum = pEquipmentAssignment.ExcerciseEnum;
                        lEquipmentAssignment.ChairId       = pEquipmentAssignment.ChairId;
                        lEquipmentAssignment.Boom1Id       = pEquipmentAssignment.Boom1Id;
                        lEquipmentAssignment.Boom2Id       = pEquipmentAssignment.Boom2Id;
                        lEquipmentAssignment.Boom3Id       = pEquipmentAssignment.Boom3Id;

                        lEquipmentAssignment.CreatedDate = DateTime.UtcNow;

                        result = lIEquipmentAssignmentRepository.InsertEquipmentAssignment(lEquipmentAssignment);
                    }
                    else
                    {
                        lEquipmentAssignment.AssignmentId  = pEquipmentAssignment.AssignmentId;
                        lEquipmentAssignment.InstallerId   = pEquipmentAssignment.InstallerId;
                        lEquipmentAssignment.PatientId     = pEquipmentAssignment.PatientId;
                        lEquipmentAssignment.DateInstalled = pEquipmentAssignment.DateInstalled;
                        lEquipmentAssignment.DateRemoved   = pEquipmentAssignment.DateRemoved;
                        lEquipmentAssignment.Limb          = pEquipmentAssignment.Limb;
                        lEquipmentAssignment.Side          = pEquipmentAssignment.Side;
                        lEquipmentAssignment.ExcerciseEnum = pEquipmentAssignment.ExcerciseEnum;
                        lEquipmentAssignment.ChairId       = pEquipmentAssignment.ChairId;
                        lEquipmentAssignment.Boom1Id       = pEquipmentAssignment.Boom1Id;
                        lEquipmentAssignment.Boom2Id       = pEquipmentAssignment.Boom2Id;
                        lEquipmentAssignment.Boom3Id       = pEquipmentAssignment.Boom3Id;
                        lEquipmentAssignment.UpdatedDate   = DateTime.UtcNow;
                        result = lIEquipmentAssignmentRepository.UpdateEquipmentAssignment(lEquipmentAssignment);
                    }
                }
                if (result == "success")
                {
                    return(Json(new { Status = (int)HttpStatusCode.OK, result = "Equipment inserted successfully", TimeZone = DateTime.UtcNow.ToString("s") }));
                }
                else
                {
                    return(Json(new { Status = (int)HttpStatusCode.InternalServerError, result = "Equipment not inserted", TimeZone = DateTime.UtcNow.ToString("s") }));
                }
            }
            catch (Exception ex)
            {
                logger.LogDebug("Assignment Post Error: " + ex);
                error.ErrorCode    = HttpStatusCode.InternalServerError;
                error.ErrorMessage = ex.ToString();
                response.Add("ErrorResponse", error);
                return(Json(new { Status = (int)HttpStatusCode.InternalServerError, result = "Equipment not inserted", TimeZone = DateTime.UtcNow.ToString("s") }));
            }
        }