Little Story Of An Idiot Service Provider

Service Provider sad we have no API or another solution support. Sure they have not any documentation for that idiot story.

They sad we have one idiot Web Form with idiot CSS and Javascripts includes.

And also they sad you must parse that form on the fly when you render your own form with your style.

You just need extract our Javascripts and rules and apply on your form.

And they sad we are Senior..?...

And yes here is Turkey.

That's my try. Not finish yet.

We will see what's will be happen.

First Chapter (Download form and analyze)

Idiot story tools:

Wget : http://opensourcepack.blogspot.com.tr/p/wget-and-curl.html

Usage:

C:\wget-1.16.3_curl-7.41.0_win32_win64>wget --page-requisites https://xxx.idiotserviceurl.com/web/idiotdocument.xhtml --no-check-certificate

Second Chapter (Download and parse Idiot Form) 

string html;
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
using (var client = new WebClient())
{
  client.Encoding = Encoding.UTF8;

  html = client.DownloadString("https://idiotformurl");
}
var resultSb = new StringBuilder();

var firstJsBlockStart = html.IndexOf("");

ViewBag.ParsedJS = resultSb;

How to change default systemdate from ymd to dmy

-- Set date format to day/month/year.
SET DATEFORMAT dmy;
GO
DECLARE @datevar datetime2 = '31/12/2008 09:01:01.1234567';
SELECT @datevar;
GO
-- Result: 2008-12-31 09:01:01.123
SET DATEFORMAT dmy;
GO
DECLARE @datevar datetime2 = '12/31/2008 09:01:01.1234567';
SELECT @datevar;
GO
-- Result: Msg 241: Conversion failed when converting date and/or time -- from character string.
GO

http://stackoverflow.com/questions/6054794/how-to-change-default-systemdate-from-ymd-to-dmy

Reset Identity Seed after deleting records in SQL Server

DBCC CHECKIDENT ('YourTableName', RESEED, 1)
Go
Also maybe you need shrink your table
ALTER INDEX PK_yourIndexName ON YourTableName REBUILD
Also maybe you need duplicate your records on table
DECLARE @intFlag INT
SET @intFlag = 1
WHILE (@intFlag <=21)
BEGIN
INSERT INTO yourTableName SELECT TOP 1
field1,
field2,
field3,
...
FROM yourTableName
SET @intFlag = @intFlag + 1
END

How to increment DateTime field in MS-SQL

DECLARE @intFlag INT
SET @intFlag = 1
WHILE (@intFlag <=21)
BEGIN
UPDATE tblMedia SET mediaDate = DATEADD(day,@intFlag,GetDate()) WHERE order = @intFlag
SET @intFlag = @intFlag + 1
END


Dummy Images

Sometimes you need to use dummy images. 

http://dummyimage.com/

Sample dummy image;

http://dummyimage.com/225x200&text=1

I used in MS-SQL like that;

DECLARE @intFlag INT

SET @intFlag = 1
WHILE (@intFlag <=21)
BEGIN
UPDATE tblMedia SET bigImage = 'http://dummyimage.com/500x500&text=' + CONVERT(varchar(10), @intFlag) WHERE order = @intFlag
SET @intFlag = @intFlag + 1
END