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));
        }
Example #3
0
 public static List <UserType> UserTypeID(int id)
 {
     return(UserTypeService.UserTypeID(id));
 }
Example #4
0
 public static int UserTypeUpdate(UserType s)
 {
     return(UserTypeService.UserTypeUpdate(s));
 }
Example #5
0
 public static int UserTypeDelete(int id)
 {
     return(UserTypeService.UserTypeDelete(id));
 }
Example #6
0
 public static int UserTypeInsert(UserType s)
 {
     return(UserTypeService.UserTypeInsert(s));
 }
Example #7
0
 public static int UserTypezong()
 {
     return(UserTypeService.UserTypezong());
 }
Example #8
0
 public static List <UserType> UserTypeALL(int index, int rows)
 {
     return(UserTypeService.UserTypeALL(index, rows));
 }
Example #9
0
 public static List <UserType> UserTypeDrop()
 {
     return(UserTypeService.StoreHouseDetailDrop());
 }