public IActionResult Profile(EquipmentView pEquipmentAssignment)
        {
            XElement ele = GetAddress(pEquipmentAssignment.Address);

            if (ele != null)
            {
                pEquipmentAssignment.Latitude  = ele.Element("lat").FirstNode.ToString();
                pEquipmentAssignment.Longitude = ele.Element("lng").FirstNode.ToString();
            }
            EquipmentAssignment pequipment = UserExtension.EquipmentViewToEquipment(pEquipmentAssignment);
            string _result = lIAssignmentInterface.UpdateEquipmentAssignment(pequipment);

            return(RedirectToAction("Index"));
        }
        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") }));
            }
        }