Last active
December 18, 2015 14:19
-
-
Save pfalabella/5796348 to your computer and use it in GitHub Desktop.
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
// linqPad snippet | |
void Main() | |
{ | |
CleanRecords(); | |
} | |
public void CleanRecords() | |
{ | |
StringBuilder builder = new StringBuilder(); | |
string delimiter = ""; | |
var res=Enumerable.Range(1, 15); | |
foreach(var r in res) | |
{ | |
builder.Append(delimiter); | |
builder.Append(r.ToString()); | |
delimiter = ","; | |
} | |
UpdateRecords(builder.ToString()); | |
} | |
public void UpdateRecords(string rowIDs) | |
{ | |
Console.WriteLine("UPDATE `cash_data` SET `end_date`='" + GetMeDate() + "', `user`='1' WHERE `id` IN (" + rowIDs + ")"); | |
} | |
private string GetMeDate() | |
{ | |
return DateTime.Now.ToString("yyyy-MM-dd"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment