public HttpResponseMessage EditSetting(SupplierNotificationSettingRequest model) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } bool isSuccessfull = _SupplierSettingsService.EditSupplierNotifySetting(model); ItemResponse <bool> response = new ItemResponse <bool>(); response.Item = isSuccessfull; return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public HttpResponseMessage SettingInsert(SupplierNotificationSettingRequest model) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } string userId = UserService.GetCurrentUserId(); UserProfileDomain userProfile = _AdminService.ProfileGetByUserId(userId); model.UserId = userId; model.CompanyId = userProfile.CompanyId; SupplierSettingsService InsertSupplierSettings = new SupplierSettingsService(); int settingId = _SupplierSettingsService.SupplierSettingInsert(model); ItemResponse <int> response = new ItemResponse <int>(); response.Item = settingId; return(Request.CreateResponse(HttpStatusCode.OK, response)); }