This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IService{ | |
public Task<MyModel> Get_MyMethod(); | |
} | |
public class Service : IService { | |
public async Task<MyModel> Get_MyMethod(){ | |
// 1. Buat list parameter | |
List<SqlParam> parameters = new List<SqlParam>(); | |
parameters.Add(new SqlParam { ParamType = DataTypeConstant.NUMERIC, ParamValue = partnerKey }); // @ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
{ | |
"Logging": { | |
"LogLevel": { | |
"Default": "Information", | |
"Microsoft": "Warning", | |
"Microsoft.Hosting.Lifetime": "Information" | |
} | |
}, | |
"Application": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string response = ""; | |
// parameter Body, menggunakan format JSON, jika semua nilai adalah string, Anda dapat menggunakan | |
// tipe data Dictionary<string, string>, | |
// tetapi Anda juga dapat menggunakan sebuah class object untuk menampung data request. | |
// Call API using dictionary | |
Dictionary<string, string> request = new Dictionary<string, string>(); | |
request.add("itemKey1","value"); | |
request.add("itemKey2","value"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public BPJSFingerSEPFindOne_Response SEPFINGER_FindOne(string memberNo, DateOnly serviceDate, BPJSSetupEntity bpjsSetup) | |
{ | |
string DateVal = serviceDate.ToString(BaseConfiguration.DateOnly).ToString(); | |
StringBuilder jsonString = new StringBuilder(); | |
BPJSResponse bpjsResponse = new BPJSResponse(); | |
BPJSFingerSEPFindOne_Response resultBpjs = new BPJSFingerSEPFindOne_Response(); | |
LogRequest dbLog = new LogRequest(); | |
dbLog.DeviceInfo = "Background Process"; | |
dbLog.PartnerKey = Int32.Parse(partnerKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Tambahkan event OnHtmlRowPrepared pada Grid | |
protected void gridDaftarPasien_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) | |
{ | |
if (e.RowType != GridViewRowType.Data) | |
return; | |
// Dapatkan nilai dari si kolom | |
string status = e.GetValue("NamaKolom").ToString().ToLower(); | |
// apa yang dilakukan pada grid jika memenuhi suatu kondisi tertentu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IQueryable<object>> GetCountry() | |
{ | |
MSSQLDataAccess helper = new MSSQLDataAccess(_options); | |
List<SqlParam> tParams = new List<SqlParam>(); | |
tParams.Add(new SqlParam { ParamType = DataTypeConstant.STR, ParamValue = "" }); | |
string strSQL = helper.BuildQueryString(TSqlHelper.spName("STOREDPROCEDURE"), tParams); | |
IQueryable<object> result = helper.Read(strSQL); | |
return await Task.FromResult(result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @TableName VARCHAR(50) = 'TXP_Header'; | |
select | |
st.name [Table], | |
sc.name [Column], | |
sep.value [Description] | |
from sys.tables st | |
inner join sys.columns sc on st.object_id = sc.object_id | |
left join sys.extended_properties sep on st.object_id = sep.major_id | |
and sc.column_id = sep.minor_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Updated by @Sean on 23th,December 2022 | |
declare @TableName sysname = 'TXP_DataInfo' -- Replace this with your database table name. | |
declare @Result varchar(max) = 'public class ' + @TableName + ' | |
{' | |
select @Result = @Result + ' | |
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; } | |
' | |
from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE [Schema].[SP_Name] (@Param [DataType(Size)] = DEFAULT_VALUE) | |
AS | |
BEGIN | |
-- Condition With Coalesce | |
WHERE COALESCE(id, NULL) = COALESCE(@paramId, id, NULL) -- EQUALS | |
AND COALESCE(name, '%') LIKE COALESCE('%' + @paramName + '%', name, '%') -- LIKE | |
AND ( -- DATE RANGE | |
CONVERT(VARCHAR(10) , date, 111) >= CONVERT(VARCHAR(10) , @FromDate, 111) AND | |
CONVERT(VARCHAR(10) , date, 111) <= CONVERT(VARCHAR(10) , @ToDate, 111) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE [Schema].[SP_Name] (@Param [DataType(Size)] = DEFAULT_VALUE) | |
AS | |
BEGIN TRY | |
BEGIN TRANSACTION | |
-- Business Logic Here | |
-- Throw Exception Example | |
-- RAISERROR (N'Please delete detail vital sign first !!' , 11, 1); |
NewerOlder