Class AgencyController
The Agency 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/Agency
Methods
AddAddress(Guid, AddressModel)
Adds an address to the agency.
Declaration
public JsonResult AddAddress(Guid agencyID, AddressModel address)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | agencyID | ID of the agency to add an address to. |
AddressModel | address | Address model to add to the agency |
Returns
Type | Description |
---|---|
System.Web.Mvc.JsonResult | The ID associated with the newly created address |
AddPerson(Guid, PersonModel)
Adds a person to the agency.
Declaration
public JsonResult AddPerson(Guid agencyID, PersonModel person)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | agencyID | ID of the agency. |
PersonModel | person | Model of the person. |
Returns
Type | Description |
---|---|
System.Web.Mvc.JsonResult | The ID associated with the person. |
Create(AgencyModel)
Creates a new agency using the specified parameters.
Declaration
public JsonResult Create(AgencyModel model)
Parameters
Type | Name | Description |
---|---|---|
AgencyModel | model | Model of the agency to be created. |
Returns
Type | Description |
---|---|
System.Web.Mvc.JsonResult | The ID associated with the new agency if successfully created. |
Delete(Guid)
Deletes the agency as specified by the id.
Declaration
public JsonResult Delete(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | ID of the agency 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 Agency by Code.
Declaration
public JsonResult GetByCode(string code)
Parameters
Type | Name | Description |
---|---|---|
System.String | code | Code of the Agency |
Returns
Type | Description |
---|---|
System.Web.Mvc.JsonResult | The Agency if found. |
ListAddresses(Guid)
Lists all addresses associated with the advertier as specified by the agencyID
Declaration
public JsonResult ListAddresses(Guid agencyID)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | agencyID | ID of the agency. |
Returns
Type | Description |
---|---|
System.Web.Mvc.JsonResult | A list of all the addresses associated with agency. |
ListPersons(Guid)
Lists all people associated with the agency as specified by the agencyID
Declaration
public JsonResult ListPersons(Guid agencyID)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | agencyID | ID of the agency. |
Returns
Type | Description |
---|---|
System.Web.Mvc.JsonResult | A list of all the people associated with the agency. |
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>)
Updates the Agency 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)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | ID of the agency to be updated. |
System.String | code | Code of the agency to be updated. |
System.String | name | Name of the agency to be updated. |
System.Nullable<System.Guid> | officeID | Office ID of the agency to be updated. |
System.Nullable<System.Guid> | clientTypeID | Client Type ID the agency to be updated. |
System.String | phoneNumber | Phone number 1 of the agency to be updated. |
System.String | phoneNumber2 | Phone number 2 of the agency to be updated. |
System.String | faxNumber | Fax number of the agency to be updated. |
System.String | websiteURL | Website URL of the agency to be updated. |
System.Nullable<System.Int32> | numberOfEmployees | Number of employees of the agency to be updated. |
System.Nullable<System.Double> | annualRevenueInMillions | Annual revenue, in millions, of the agency to be updated. |
System.String | rating | Rating of the agency to be updated. |
System.Nullable<System.Boolean> | isLive | Whether the agency is live or not. |
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 agency. |
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<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, Guid? contantTypeID)
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.Guid> | contantTypeID |
Returns
Type | Description |
---|---|
System.Web.Mvc.JsonResult |
|