Posts

Showing posts from 2013

MVC Api Controllers (Get/ Post)

System.Web.Http.ApiController is one of the controller types in Asp MVC Default Routing routes . MapHttpRoute ( name : "DefaultApi" , routeTemplate : "api/{controller}/{id}" , defaults : new { id = RouteParameter . Optional } ); Any request method like Get, Post, Put, etc can be used with action names started with the method name ex: GetEmployees() GetProducts() but it checks the input parameters if we use more than one Get or other method names. When posting  to an action like below public HttpResponseMessage PostApplication(Application_ui param) public class Application_ui{  public string Action{get;set;};  public int No{get;set;} } you should have a class that can be instantiate in parameter and the client side call should match the object properties if you use json again that should be stringified $.post("/api/ApplicationAPI/", JSON.stringify({Action:'add', No:'34'})); Reference http://...

C# Enum with readable string

public enum MerchantType        {             [Description("Master merchant")]             mastermerchant,             [Description("Merchant")]             merchant,             [Description("Terminal")]             terminal,                         error,         } public static string GetDescription ( this Enum value ) { if ( value == null ) { throw new ArgumentNullException ( "value" ); } string description = value . ToString (); FieldIn...

JQuery checkbox checking

Sometimes Jquery.attr('checked','checked') does not work for many cases. Jquery newest attribute manipulator .prop() can be used as follows checking   $(document).ready(function(){     $('#btn').click(function(){        $('#chk').removeProp('checked');        $('#chk').prop('checked','checked');     });  }); http://jsfiddle.net/yxCnK/

Jquery Validate Plugin

Include ~/Scripts/jquery.validate.js id="formCreate" action="/System/Bin" method="post" novalidate="novalidate">                                 @Resource.Input_Bin                 @Resource.Input_Description                                         name="txtBin"   type="text"  />                                                 ...

UML Tool

Image
There's a free tool for UML diagramming and documenting called Visual Paradigm UML. Community edition is more than enough for everyday modeling practices. http://www.visual-paradigm.com/product/vpuml/provides/?edition=ce Download from http://www.visual-paradigm.com/download/vpuml.jsp?edition=ce