Skip to content

Instantly share code, notes, and snippets.

Avatar

Safwath Priyanka stpriyanka

View GitHub Profile
@stpriyanka
stpriyanka / BusinessLogic.cs
Last active Mar 30, 2017
Map data from CompanyDTO to CompanyDM using Automapper
View BusinessLogic.cs
public class BusinessLogic
{
public CompanyDTO CompanyDto { get; set; }
public CompanyDM CompanyDm { get; set; }
public BusinessLogic(CompanyDTO dto, CompanyDM dm)
{
CompanyDto = dto;
CompanyDm = dm;
}
@stpriyanka
stpriyanka / BusinessLogic.cs
Last active Mar 30, 2017
Manual map data between viewmodel and entity
View BusinessLogic.cs
public class BusinessLogic
{
public CompanyDTO CompanyDto { get; set; }
public CompanyDM CompanyDm { get; set; }
public BusinessLogic(CompanyDTO dto, CompanyDM dm)
{
CompanyDto = dto;
CompanyDm = dm;
}
@stpriyanka
stpriyanka / CompanyDM.cs
Last active Mar 30, 2017
Data needs to map between DTO and DM classes
View CompanyDM.cs
public class CompanyDM
{
public int ID { get; set; }
public string CompanyName { get; set; }
public string ContactPersonName { get; set; }
public string ContactPersonEmail { get; set; }
@stpriyanka
stpriyanka / Utility.cs
Created Mar 2, 2017
Send billogram to it's customer's contact's email
View Utility.cs
public class Utility
{
...........
public string BillogramId = "PAsE6WY";
...........
public async Task SendBillogram()
{
await _billogramUtility.SendBillogram(BillogramId);
@stpriyanka
stpriyanka / Utility.cs
Created Mar 2, 2017
Get list of unattested billograms
View Utility.cs
public class Utility
{
............
public string billogramState ="unattested";
public async Task<List<BillogramStructure>> GetBillogramsByState()
{
List<BillogramStructure> billograms = _billogramUtility.GetBillogramsByState(billogramState).Result;
return billograms;
@stpriyanka
stpriyanka / Utility.cs
Last active Mar 2, 2017
Create a Billogram object
View Utility.cs
public asyn Task<BillogramStructure> CreateBillogram()
{
BillogramHelper billogramHelper = new BillogramHelper()
{
CustomerStructure = new CustomerStructure()
{
CustomerNo = CustomerNo
},
Subscriptions = new BillogramItems()
{
@stpriyanka
stpriyanka / Utility.cs
Created Mar 2, 2017
Create a customer
View Utility.cs
public void CreateCustomer()
{
var model = new CustomerStructure()
{
CustomerNo = 2,
CustomerName = "Some name",
CustomerCompanyType = "individual",
CustomerOrganizationNo = "",
CustomerVatNo = "",
@stpriyanka
stpriyanka / Utility.cs
Created Mar 2, 2017
Instantiate BillogramUtility.cs class for sandbox environment
View Utility.cs
public class Utility
{
private string _clientSecretUser;
private string _clientSecretKey;
private string _baseUrl;
private BillogramUtility _billogramUtility;
.............
public void Initialize()
@stpriyanka
stpriyanka / App.Config
Last active Mar 2, 2017
Configure Billogram using Sandbox environment
View App.Config
<appSettings>
<add key="Billogram.AuthUser" value="5588-000000" />
<add key="Billogram.AuthKey" value="7000552121211a8cfa16fe67693" />
<add key="Billogram.BaseUrl" value="https://sandbox.billogram.com/api/v2/" />
</appSettings>
@stpriyanka
stpriyanka / Final Output
Created Feb 22, 2017
This is a rendered data content template.
View Final Output
<!DOCTYPE html>
<html>
<body>
<h1>
This is a rendered template example.
</h1>
<div>
This example is ridiculous.
</div>
</body>