Sunday, March 26, 2023

Git Commands For check in Files. 3 Steps

 $ git add .  (git add . for all files changes/New)

$ git commit -m "Changes" (in Master branch changes)


$ git push (Finally push)








Tuesday, February 28, 2023

Get Only Firdays in SQL

 SELECT Fridays = DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num)

FROM (SELECT TOP 366 num = ROW_NUMBER() OVER(ORDER BY a.NAME)-1 FROM dbo.syscolumns a, dbo.syscolumns b) n

WHERE DATENAME(weekday, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num)) = 'Friday'





Sunday, January 15, 2023

epoch date convert in javascript

 epoch date is generally in seconds and milliseconds.

sample:   /Date(1665424800000)/


javascript code to convert in readable date:  

var lsad = String(LoanSanctionApproveDate);

        var lsadUnixDate = lsad.slice(6, 19);

        var lsadToInt = parseInt(lsadUnixDate);

        var loanSancAprvDate = new Date(lsadToInt).toLocaleDateString('es-CL');

Sunday, January 1, 2023

Insert INTO Table From Storedprocedure

 Insert into Table From stored procedure execution

  Insert INTo PFStatement_Data

  EXEC GCPF.SP_RPT_GetProvidentStatement '29226', '31 December, 2021', 1  

Sunday, December 4, 2022

Access API with basic Authorization

 C# Code To access API using basic authorization.

using (HttpClient client = new HttpClient())

            {

                string TransactionID = "6334360607";

                string url = $"http://103.11.137.17:8081/BillPayGW/BillInquiryService?shortcode=555&userid=dbbl&password=dbbl&txnid={ TransactionID }";

                Uri baseUri = new Uri(url);


                //This is the key section  UserName Password    

                var plainTextBytes = System.Text.Encoding.UTF8.GetBytes("dbill:dBILL!23");

                 

                string base64EncodedAuthenticationString = System.Convert.ToBase64String(plainTextBytes);

                

                var requestMessage = new HttpRequestMessage(HttpMethod.Get, baseUri);

                requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Basic", base64EncodedAuthenticationString);

                requestMessage.Headers.Add("responseType", "json");

                 

                //make the request

                var task = client.SendAsync(requestMessage);

                var response = task.Result;

                response.EnsureSuccessStatusCode();

                string responseBody = response.Content.ReadAsStringAsync().Result;

            }


Postman setting: 



Screen Record

 Windows Screen Record WindowsKey+ Alt + R Recording Starts.