/*
Last Update : 2018-07-04
By : สายเบริ์น/ชอบเลีย
Back ground : insider to AngularJS/Vue/Rect/ESV.../etc... Front End <----> Back end (.NET Framework/.NET Core/etc...)
: write one run any F U C K.
Usage : var objmsrUsersJSM = new msrUsersJSM();
objmsrUsersJSM.firstName = 'Jim';
objmsrUsersJSM.lastName = 'Thai';
var lstmsrUsersJSM = [];
lstmsrUsersJSM.push(objmsrUsersJSM);
objmsrUsersJSM.firstName = 'เลียJim2';
objmsrUsersJSM.lastName = 'เลียThai2';
lstmsrUsersJSM.push(objmsrUsersJSM);
alert(lstmsrUsersJSM.length); //result : 2
*/
function msrUsersJSM() { // <---> (.NET Framework/.NET Core) Public Classs msrUsers()
// Public Property firstName As string = ""
// Public Property lastName As string = ""
// End Class
//C#
//public class msrusers(){
// string firstName {get;, set},
// string lastName [get; , set},
//}
var p = {};
p.firstName = "หอย";
p.lastName = "เหม็น";
return p /*เห็นหมอย*/
//var หอย = {
// หอย:firstName="" ,
// หอย:lastName=""
//}
//return หอย
}
อยากจะเลือกว่า Angular VS Knockout VS Vue VS React VS etc --> Java Script Framework ผมควรจะใช้ตัวไหน?
--- ในสถานะการอย่างไรบ้าง? (ต้นทุนชีวิตของผมมันต่ำแต่ผมอยากจะใช้เหมือนคนทั่วฯไปเขาใช้กันบ้างก็แค่นั้นเองครับ)
Code (C#)
It will translate this c# class -
public class NestModelNestedClass
{
public bool CheckBoxTest { get; set; }
public int IntegerTest { get; set; }
}
public class NestedModel
{
public NestModelNestedClass
NestModelSet { get; set; }
public int IntProperty { get; set; }
public string SimpleProperty { get; set; }
}
Into this JavaScript
//------------------------------------------------
// Begin Auto Generated code ----------------
// For Model Type - NestedMtodel ----------
//------------------------------------------------
var nestedModel = function(){
return {
NestModelSet: {
CheckBoxTest: ko.observable(),
IntegerTest: ko.observable()
},
IntProperty: ko.observable(),
SimpleProperty: ko.observable()
}
}
Date :
2018-07-06 20:47:03
By :
หน้าฮี
No. 10
Guest
แยกสองฝั่ง Front End (HTML/JavaScript)/ Back End (.NET/JAVA) อะไรก็ว่ากันไป อทิเช่น
--- Back End Code (VB.NET)
Public Function LamddaReportXXX() As IHttpActionResult
'Tricks List Of 'anonymous type
Dim xList = {New With {.CountryName = "Morocco", .Value = 0}}.Take(1).ToList()
xList.Add(New With {.CountryName = "India", .Value = 1})
xList.Add(New With {.CountryName = "USA", .Value = 1})
xList.Add(New With {.CountryName = "Spain", .Value = 0})
Return Ok(xList) 'JSON format
End Function
--- Front End
...
...
...
Result : ประมาณนี้
Date :
2018-07-06 20:52:39
By :
หน้าฮี
No. 11
Guest
อันนี้เป็นฝั่ง Front End (Knockout.js) (ลองดูว่าตัวไหนมันดีสำหรับเรา)
------ เพราะว่าตรูไม่เคยใช้แม่งสักกะตัวเดียวเลย
Public Event btnMouseRed_เอ็ด As EventHandler 'ปากแดงแดงจะไว้ใจได้ก๋า
Private Sub btnMouseRed_Click(sender As Object, e As EventArgs) Handles btnMouseRed.Click
RaiseEvent btnMouseRed_เอ็ด(sender, e)
End Sub
ปล. C# มันทำไม่ได้ว่ะเฮ้ย(Win/Web)
Date :
2018-07-09 15:19:03
By :
หน้าฮี
No. 16
Guest
@คุณเป็นคนเก่งครับผมชื่นชมคุญ
Code (VB.NET)
Public Class Form1
Private Sub btnMouseRed_Click(sender As Object, e As EventArgs) Handles btnMouseRed.Click
Dim s = <js>
{"Total":"1500",
"Results":[{"id":"0", "text":"row1"}]
}
</js>
Dim lstData = {New With {.id = "", .text = ""}}.Take(0).ToList()
Enumerable.Range(1, 1500).ToList().ForEach(Sub(i)
lstData.Add(New With {.id = i.ToString("D4"), .text = "row-" & i}) '0000, row-0
End Sub)
Dim resultFinal = New With {.Total = lstData.Count,
.Results = lstData}
If lstData.Count > 0 Then
End If
End Sub
End Class
using OrderCheck;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OrderCheck2015
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
///
// frmMainFilter frmMain = new frmMainFilter();
public static frmMainFilter mainform = new frmMainFilter();
public static frmInvoice frminvoice = new frmInvoice();
public static frmShipReport frmshipReport = new frmShipReport();
[STAThread]
static void Main()
{
// Creating a Global culture specific to our application.
System.Globalization.CultureInfo cultureInfo =
new System.Globalization.CultureInfo("en-US");
// Creating the DateTime Information specific to our application.
System.Globalization.DateTimeFormatInfo dateTimeInfo =
new System.Globalization.DateTimeFormatInfo();
// Defining various date and time formats.
dateTimeInfo.DateSeparator = "/";
dateTimeInfo.LongDatePattern = "dd-MM-yyyy";
dateTimeInfo.ShortDatePattern = "dd-MM-yyyy";
dateTimeInfo.LongTimePattern = "hh:mm:ss tt";
dateTimeInfo.ShortTimePattern = "hh:mm tt";
// Setting application wide date time format.
cultureInfo.DateTimeFormat = dateTimeInfo;
// Assigning our custom Culture to the application.
Application.CurrentCulture = cultureInfo;
System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;
System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo;
Application.EnableVisualStyles();
// Application.SetCompatibleTextRenderingDefault(false);
mainform.Show();
//frmshipReport.Show();
// frminvoice.Show();
System.Windows.Forms.Application.Run();
}
}
}