public HttpResponseMessage GetUserTypes(UserTypeModel model) { IUnitOfWork uWork = new UnitOfWork(); IUserTypeRepository repo = new UserTypeRepository(uWork); IUserTypeService userTypeService = new UserTypeService(repo); try { if (this.ModelState.IsValid) { var userTypeList = userTypeService.GetAllUserTypeList(model); if (userTypeList != null) { return(Request.CreateResponse(HttpStatusCode.OK, userTypeList)); } 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 IActionResult Get(int id) { var svc = new UserTypeService(); if (id < 0) { return(BadRequest()); } var result = svc.Get(id); if (result == null) { return(NotFound()); } return(Ok(result)); }
public static List <UserType> UserTypeID(int id) { return(UserTypeService.UserTypeID(id)); }
public static int UserTypeUpdate(UserType s) { return(UserTypeService.UserTypeUpdate(s)); }
public static int UserTypeDelete(int id) { return(UserTypeService.UserTypeDelete(id)); }
public static int UserTypeInsert(UserType s) { return(UserTypeService.UserTypeInsert(s)); }
public static int UserTypezong() { return(UserTypeService.UserTypezong()); }
public static List <UserType> UserTypeALL(int index, int rows) { return(UserTypeService.UserTypeALL(index, rows)); }
public static List <UserType> UserTypeDrop() { return(UserTypeService.StoreHouseDetailDrop()); }