Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        // POST api/<controller>
        public async Task <IHttpActionResult> Logout(int UserId)
        {
            ResultClassCommon result = new ResultClassCommon();


            result = ApiCommon.logoutUser(UserId);
            return(Ok(result));
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        // 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)));
            }
        }
Ejemplo n.º 5
0
 public dynamic FireException(ResultClassCommon result, Exception ex)
 {
     result.Code = (int)HttpStatusCode.InternalServerError;
     result.Msg  = ex.Message;
     return(result);
 }