Class AdvertiserController
The Advertiser Controller is a controller that allows data to be retrieved and updated within the Ayuda Platform.
Namespace: Ayuda.BMS.Splash.Areas.Pi.Controllers
Remarks
This web service can be accessed using an address similar to the following: https://[AYUDA DEPLOYMENT URL]/Juice/Pi/Advertiser
Methods
AddAddress(Guid, AddressModel)
Adds an address to the advertiser.
Declaration
public JsonResult AddAddress(Guid advertiserID, AddressModel address)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | advertiserID | ID of the advertiser to add an address to. |
| AddressModel | address | Address model to add to the advertiser |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult | The ID associated with the newly created address |
AddPerson(Guid, PersonModel)
Adds a person to the advertiser.
Declaration
public JsonResult AddPerson(Guid advertiserID, PersonModel person)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | advertiserID | ID of the advertiser. |
| PersonModel | person | Model of the person. |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult | The ID associated with the person. |
Create(AdvertiserModel)
Creates a new advertiser using the specified parameters.
Declaration
public JsonResult Create(AdvertiserModel model)
Parameters
| Type | Name | Description |
|---|---|---|
| AdvertiserModel | model | Model of the advertiser to be created. |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult | The ID associated with the new advertiser if successfully created. |
Delete(Guid)
Deletes the advertiser as specified by the id.
Declaration
public JsonResult Delete(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | id | ID of the advertiser to be deleted. |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult |
|
DeleteAddress(Guid)
Deletes the address as specified by the id.
Declaration
public JsonResult DeleteAddress(Guid addressID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | addressID | ID of the address to be deleted. |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult |
|
DeletePerson(Guid)
Deletes the person as specified by the id.
Declaration
public JsonResult DeletePerson(Guid personID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | personID | ID of the person to be deleted. |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult |
|
GetByCode(String)
Gets the Advertiser by Code.
Declaration
public JsonResult GetByCode(string code)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | code | Code of the Advertiser |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult | The Advertiser if found. |
GetById(Guid)
Gets the Advertiser by Id.
Declaration
public JsonResult GetById(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | id | Guid of the Advertiser |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult | The Advertiser if found. |
ListAddresses(Guid)
Lists all addresses associated with the advertier as specified by the advertiserID
Declaration
public JsonResult ListAddresses(Guid advertiserID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | advertiserID | ID of the advertiser. |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult | A list of all the addresses associated with advertiser. |
ListPersons(Guid)
Lists all people associated with the advertiser as specified by the advertiserID
Declaration
public JsonResult ListPersons(Guid advertiserID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | advertiserID | ID of the advertiser. |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult | A list of all the people associated with the advertiser. |
OnActionExecuting(ActionExecutingContext)
Declaration
protected override void OnActionExecuting(ActionExecutingContext filterContext)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Web.Mvc.ActionExecutingContext | filterContext |
Overrides
Update(Guid, String, String, Nullable<Guid>, Nullable<Guid>, String, String, String, String, Nullable<Int32>, Nullable<Double>, String, Nullable<Boolean>, Nullable<Guid>)
Updates the Advertiser with the specified parameters.
Declaration
public JsonResult Update(Guid id, string code, string name, Guid? officeID, Guid? clientTypeID, string phoneNumber, string phoneNumber2, string faxNumber, string websiteURL, int? numberOfEmployees, double? annualRevenueInMillions, string rating, bool? isLive, Guid? advertiserCategoryID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | id | ID of the advertiser to be updated. |
| System.String | code | Code of the advertiser to be updated. |
| System.String | name | Name of the advertiser to be updated. |
| System.Nullable<System.Guid> | officeID | Office ID of the advertiser to be updated. |
| System.Nullable<System.Guid> | clientTypeID | Client Type ID the advertiser to be updated. |
| System.String | phoneNumber | Phone number 1 of the advertiser to be updated. |
| System.String | phoneNumber2 | Phone number 2 of the advertiser to be updated. |
| System.String | faxNumber | Fax number of the advertiser to be updated. |
| System.String | websiteURL | Website URL of the advertiser to be updated. |
| System.Nullable<System.Int32> | numberOfEmployees | Number of employees of the advertiser to be updated. |
| System.Nullable<System.Double> | annualRevenueInMillions | Annual revenue, in millions, of the advertiser to be updated. |
| System.String | rating | Rating of the advertiser to be updated. |
| System.Nullable<System.Boolean> | isLive | Whether the advertiser is live or not. |
| System.Nullable<System.Guid> | advertiserCategoryID | Advertiser category ID of the advertiser to be updated. |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult |
|
UpdateAddress(Guid, Nullable<Guid>, Nullable<Boolean>, String, String, String, String, Nullable<Guid>, Nullable<Guid>)
Updates an address.
Declaration
public JsonResult UpdateAddress(Guid addressID, Guid? addressTypeID, bool? isPrimary, string address1, string address2, string city, string postalCode, Guid? countryID, Guid? stateID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | addressID | ID of the address to update. |
| System.Nullable<System.Guid> | addressTypeID | Type of the address. |
| System.Nullable<System.Boolean> | isPrimary | Whether the address is the primary address of the advertiser. |
| System.String | address1 | Address line 1. |
| System.String | address2 | Address line 2. |
| System.String | city | City. |
| System.String | postalCode | Postal code |
| System.Nullable<System.Guid> | countryID | Country. |
| System.Nullable<System.Guid> | stateID | State |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult |
|
UpdatePerson(Guid, String, String, String, Nullable<DateTime>, String, String, String, String, String, String, String, String, String, String, Nullable<Boolean>, Nullable<Boolean>, Nullable<Guid>, Nullable<Guid>)
Updates the person with the specified parameters.
Declaration
public JsonResult UpdatePerson(Guid personID, string firstName, string middleName, string lastName, DateTime? birthDate, string email, string workPhoneNumber, string workFaxNumber, string mobilePhoneNumber, string title, string department, string companyName, string website, string assistantName, string assistantPhoneNumber, bool? isLive, bool? isLead, Guid? contantTypeID, Guid? popPersonAccessTypeID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | personID | |
| System.String | firstName | |
| System.String | middleName | |
| System.String | lastName | |
| System.Nullable<System.DateTime> | birthDate | |
| System.String | ||
| System.String | workPhoneNumber | |
| System.String | workFaxNumber | |
| System.String | mobilePhoneNumber | |
| System.String | title | |
| System.String | department | |
| System.String | companyName | |
| System.String | website | |
| System.String | assistantName | |
| System.String | assistantPhoneNumber | |
| System.Nullable<System.Boolean> | isLive | |
| System.Nullable<System.Boolean> | isLead | |
| System.Nullable<System.Guid> | contantTypeID | |
| System.Nullable<System.Guid> | popPersonAccessTypeID |
Returns
| Type | Description |
|---|---|
| System.Web.Mvc.JsonResult |
|