public dynamic logoutUser(int UserId) { ResultClassCommon result = new ResultClassCommon(); using (LystenEntities db = new LystenEntities()) { int companyid = 0; var obj = db.User_Master.Where(x => x.Id == UserId).FirstOrDefault(); if (obj != null) { obj.IsLogin = false; obj.DeviceToken = null; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); result.Code = (int)HttpStatusCode.OK; result.Msg = ap.Success; } else { result.Code = (int)HttpStatusCode.NonAuthoritativeInformation; result.Msg = ap.GlobalError; } } return(result); }
// POST api/<controller> public async Task <IHttpActionResult> Logout(int UserId) { ResultClassCommon result = new ResultClassCommon(); result = ApiCommon.logoutUser(UserId); return(Ok(result)); }
private ApiUserServices US; //= new ApiUserServices(); public ApiCommonServices() { objresult = new ResultClass(); objresultCommon = new ResultClassCommon(); objresultToken = new ResultClassToken(); es = new EmailServices(); ap = new ApiMessageFormat(); US = new ApiUserServices(); }
// POST api/<controller> public async Task <IHttpActionResult> ForgotPassword(string Email) { ResultClassCommon result = new ResultClassCommon(); try { result = ApiCommon.GetforgotPassword(Email.Trim()); if (result.Code == 200) { var obj = await ApiCommon.SendEmail(Email.Trim()); } return(Ok(result)); } catch (Exception ex) { return(Ok(ApiEx.FireException(result, ex))); } }
public dynamic FireException(ResultClassCommon result, Exception ex) { result.Code = (int)HttpStatusCode.InternalServerError; result.Msg = ex.Message; return(result); }