Пример #1
0
        public object Delete(QB_Vendor_Delete request)
        {
            ApiUser         hdUser         = request.ApiUser;
            Instance_Config instanceConfig = new Instance_Config(hdUser);

            CheckQBOnlineIntegration(instanceConfig);
            if (request.is_unlink)
            {
                try
                {
                    QBVendors.UnlinkQuickBooksVendor(hdUser, request.key);
                    return(new HttpResult("", HttpStatusCode.OK));
                }
                catch (Exception ex)
                {
                    throw new HttpError(Utils.ClearString(ex.Message));
                }
            }
            else
            {
                try
                {
                    QBVendors.DeleteQuickBooksVendor(hdUser, instanceConfig, request.key);
                    return(new HttpResult("", HttpStatusCode.OK));
                }
                catch (Exception ex)
                {
                    throw new HttpError(Utils.ClearString(ex.Message));
                }
            }
        }
Пример #2
0
        public object Post(QB_Vendor_Create request)
        {
            ApiUser         hdUser         = request.ApiUser;
            Instance_Config instanceConfig = new Instance_Config(hdUser);

            CheckQBOnlineIntegration(instanceConfig);
            try
            {
                return(QBVendors.CreateVendor(hdUser, instanceConfig, request.user_id));
            }
            catch (Exception ex)
            {
                throw new HttpError(Utils.ClearString(ex.Message));
            }
        }