Пример #1
0
        public JsonResult createencryptpin(string patientloginid, string surgerydate, string PIN)
        {
            try
            {
                string _result = IPatient.CreateEncryptPIN(patientloginid, surgerydate, PIN);
                if (_result == "success")
                {
                    User pUser = lIUserRepository.getUser(patientloginid);
                    if (pUser != null)
                    {
                        pUser.EncryptPasswrod = PIN;
                        lIUserRepository.UpdateUser(pUser);
                    }

                    return(Json(new { Status = (int)HttpStatusCode.OK, result = "success", TimeZone = DateTime.UtcNow.ToString("s") }));
                }
                else if (_result == "fail")
                {
                    return(Json(new { Status = (int)HttpStatusCode.BadRequest, result = "No such patient record", TimeZone = DateTime.UtcNow.ToString("s") }));
                }
                else
                {
                    return(Json(new { Status = (int)HttpStatusCode.InternalServerError, result = "Internal server error", TimeZone = DateTime.UtcNow.ToString("s") }));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { Status = (int)HttpStatusCode.InternalServerError, result = "failed", TimeZone = DateTime.UtcNow.ToString("s") }));
            }
        }