Skip to content

Instantly share code, notes, and snippets.

View stpriyanka's full-sized avatar

Safwath Priyanka stpriyanka

View GitHub Profile
@stpriyanka
stpriyanka / BusinessLogic.cs
Last active March 30, 2017 14:33
Map data from CompanyDTO to CompanyDM using Automapper
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 March 30, 2017 07:15
Data needs to map between DTO and DM classes
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 / BusinessLogic.cs
Last active March 30, 2017 07:12
Manual map data between viewmodel and entity
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 / App.Config
Last active March 2, 2017 13:27
Configure Billogram using Sandbox environment
<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 / Utility.cs
Created March 2, 2017 10:34
Send billogram to it's customer's contact's email
public class Utility
{
...........
public string BillogramId = "PAsE6WY";
...........
public async Task SendBillogram()
{
await _billogramUtility.SendBillogram(BillogramId);
@stpriyanka
stpriyanka / Utility.cs
Created March 2, 2017 10:19
Get list of unattested billograms
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 March 2, 2017 10:02
Create a Billogram object
public asyn Task<BillogramStructure> CreateBillogram()
{
BillogramHelper billogramHelper = new BillogramHelper()
{
CustomerStructure = new CustomerStructure()
{
CustomerNo = CustomerNo
},
Subscriptions = new BillogramItems()
{
@stpriyanka
stpriyanka / Utility.cs
Created March 2, 2017 09:53
Create a customer
public void CreateCustomer()
{
var model = new CustomerStructure()
{
CustomerNo = 2,
CustomerName = "Some name",
CustomerCompanyType = "individual",
CustomerOrganizationNo = "",
CustomerVatNo = "",
@stpriyanka
stpriyanka / Utility.cs
Created March 2, 2017 09:20
Instantiate BillogramUtility.cs class for sandbox environment
public class Utility
{
private string _clientSecretUser;
private string _clientSecretKey;
private string _baseUrl;
private BillogramUtility _billogramUtility;
.............
public void Initialize()
@stpriyanka
stpriyanka / Final Output
Created February 22, 2017 12:03
This is a rendered data content template.
<!DOCTYPE html>
<html>
<body>
<h1>
This is a rendered template example.
</h1>
<div>
This example is ridiculous.
</div>
</body>