public HttpResponseMessage GetMSEBCusDetails(HttpRequestMessage req, MSEBUserDetailsReq mSEBUserDetailsReq) { if (mSEBUserDetailsReq != null && mSEBUserDetailsReq.BuCode > 1 && !string.IsNullOrEmpty(mSEBUserDetailsReq.ConsumerNo) && !string.IsNullOrEmpty(mSEBUserDetailsReq.Key) && !string.IsNullOrEmpty(mSEBUserDetailsReq.UserId)) { User user = new User() { Password = mSEBUserDetailsReq.Key, UserId = mSEBUserDetailsReq.UserId }; Validation.UserCheck(user); if (Validation._IsSuccess) { BL_Operator op = new BL_Operator(); MSEBUserDetailsReqReturn mSEBUserDetailsReqReturn = op.GetMSEBUserStatus(mSEBUserDetailsReq); if (op._IsSuccess) { return(req.CreateResponse <MSEBUserDetailsReqReturn>(HttpStatusCode.OK, mSEBUserDetailsReqReturn)); } else { return(req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError")); } } return(req.CreateErrorResponse(HttpStatusCode.Unauthorized, "Unauthorized")); } return(req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request")); }
public MSEBUserDetailsReqReturn GetMSEBUserStatus(MSEBUserDetailsReq mSEBUserDetailsReq) { MSEBUserDetailsReqReturn mSEBUserDetailsReqReturn = null; MSEBapiReq _msebapiReq = new MSEBapiReq { BuNumber = mSEBUserDetailsReq.BuCode, ConsumerNo = mSEBUserDetailsReq.ConsumerNo }; try { string json = this.PostWebApi(_msebapiReq); if (!json.Contains("error")) { mSEBUserDetailsReqReturn = JsonConvert.DeserializeObject <MSEBUserDetailsReqReturn>(json); } this._IsSuccess = true; } catch (Exception ex) { Logger.WriteLog(LogLevelL4N.ERROR, "GetMSEBUserStatus Exception : " + ex.Message); this._IsSuccess = false; } return(mSEBUserDetailsReqReturn); }