Skip to content

Instantly share code, notes, and snippets.

View cerkit's full-sized avatar

cerkit cerkit

View GitHub Profile
using PortableClient.WebApi.Dal.Interfaces;
using RecordKeeper.Portable.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace PortableClient.WebApi.Dal.Services
{
public class AlbumFormatService : IEntityService<AlbumFormat>
{
private static readonly string API_PATH = "AlbumFormat";
AlbumFormatService _service;
public frmMain()
{
InitializeComponent();
_service = new AlbumFormatService();
}
private async void cmdGetFormats_Click(object sender, EventArgs e)
{
lbFormats.DataSource = (await _service.Get()).ToList();
lbFormats.DisplayMember = "Description";
}
@cerkit
cerkit / web.config
Created August 11, 2014 14:42
Web.config example of turning off url rewrites in a subdirectory
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear/>
</rules>
</rewrite>
</system.webServer>
</configuration>
@cerkit
cerkit / append_on_condition.vb
Created August 15, 2014 13:13
VB.NET Appending text based on a condition - the old way...
If chkRailCar.Checked = True Then C1 = C1 & "Y" Else C1 = C1 & "N"
@cerkit
cerkit / append_on_condition_using_iif.vb
Created August 15, 2014 13:16
Append on condition using IIf
C1 &= IIf(chkRailCar.Checked, "Y", "N")
@cerkit
cerkit / boolean_property_old_way.vb
Created August 15, 2014 13:20
Set boolean property with If, Then, Else (old way)
If Mid(C1, 40, 1) = "Y" Then
C1GridView1.Columns.ColumnByName("Age Allocated").Visible = True
Else
C1GridView1.Columns.ColumnByName("Age Allocated").Visible = False
End If
@cerkit
cerkit / boolean_property_eval.vb
Created August 15, 2014 13:23
Set boolean property using evaluation of boolean expression
C1GridView1.Columns.ColumnByName("Age Allocated").Visible = Mid(C1, 40, 1) = "Y"
@cerkit
cerkit / enum_example.vb
Created August 15, 2014 13:33
VB.NET Enum Example
Public Enum trafficLightEnum
Red
Yellow
Green
End Enum
@cerkit
cerkit / vb_using_an_enum.vb
Last active August 29, 2015 14:05
Using an Enum
Dim lightState as trafficLightEnum
lightState = trafficLightEnum.Yellow
If lightState = trafficLightEnum.Red Then
Vehicle.Stop()
Else If lightState = trafficLightEnum.Green Then
Vehicle.Go()
Else If lightState = trafficLightEnum.Yellow Then
Vehicle.FloorIt()
End If