コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }