public HttpResponseMessage GetMasterData(BaseViewModel model) { try { ITransproService service = new TransproService(); if (this.ModelState.IsValid) { var checkboxvalue = service.GetMasterData(model); if (checkboxvalue != null) { return(Request.CreateResponse(HttpStatusCode.OK, checkboxvalue)); } else { string message = "Error in getting Data"; return(Request.CreateErrorResponse(HttpStatusCode.Forbidden, message)); } } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.InnerException.Message)); } }
public HttpResponseMessage GetMessageDetails(long msgId) { try { ITransproService service = new TransproService(); var data = service.getDetailsbymsgId(msgId); return(Request.CreateResponse(HttpStatusCode.OK, data));; } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message)); } }
public HttpResponseMessage WithDrawTranslatorMembership(StaffModel model) { try { ITransproService _service = new TransproService(); var result = _service.WithDrawTranslatorMembership(model); return(Request.CreateResponse(HttpStatusCode.OK, result)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message)); } }
public HttpResponseMessage GetTranslatorProfile(TranslatorFilterModel filter) { try { ITransproService _service = new TransproService(); var result = _service.GetTranslatorProfile(filter); return(Request.CreateResponse(HttpStatusCode.OK, result)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message)); } }
public HttpResponseMessage getImageById(string translatorId, string cultureId) { try { if (this.ModelState.IsValid) { ITransproService _service = new TransproService(); var result = _service.GetImageById(translatorId, cultureId); if (result == null) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, "Error in getting Images.")); } return(Request.CreateResponse(HttpStatusCode.OK, result)); } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public HttpResponseMessage CheckExistingTranlator(string emailId, string culture) { try { if (this.ModelState.IsValid) { ITransproService _service = new TransproService(); var result = _service.CheckExistingTranslator(emailId, culture); if (!result) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, "Error in getting records.")); } return(Request.CreateResponse(HttpStatusCode.OK, result)); } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }