/// <summary>
 /// Insert User
 /// </summary>
 /// <param name="userInfo">UserInfo object</param>
 /// <returns>Number of rows are effected</returns>
 public static int Insert(tblUser userInfo)
 {
     // Encode password & username
     userInfo.Password = Common.Encode(userInfo.Password);
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     db.AddTotblUsers(userInfo);
     int re = db.SaveChanges();
     db.Connection.Close();
     return re;
 }