Like operator for integer on LIKE operator equivalent for integer / numeric value Columns in a SQL (or T-SQL) Database.Suren S M on AsyncUtil - C# Helper class to run async methods as sync and vice-versa.Private static string Normalize(string s, bool normalizeDiacritics)įor (int i = 0 i < src.Length i++) s = s.Replace(src, rep) / Trim, Uppercase and optionally remove diacritics to a string. Private static char GetControlChar(string f15)īyte arrCode = (f15.ToUpper()) / the first 15 characters of the fiscal Code (full CF minus the Control Character only) String code = d.Year.ToString().Substring(2) Private static string GetBirthDateByGenderCode(DateTime d, char g) / Retrieves the Birth Date Code (by Gender) ? cons.ToString() + cons.ToString() + cons.ToString() if we have 4 or more consonants we need to pick 1st, 3rd and 4th Private static string GetFirstNameCode(string s) / the 3 FC-relevant letters for the name (es. Private static string GetLastNameCode(string s) / Gets the first 3-letters of the name used to calculate the Fiscal Code. Private static readonly int ControlCodeArray = new įoreach (int i in pos) if (!Char.IsNumber(fcChars)) fcChars = OmocodeChars.IndexOf(fcChars).ToString() ![]() Private static readonly string OmocodeChars = "LMNPQRSTUV" Private static readonly string Consonants = "BCDFGHJKLMNPQRSTVWXYZ" Private static readonly string Vocals = "AEIOU" ![]() Private static readonly string Months = "ABCDEHLMPRST" / A set of generic utils to retrieve, calculate and check the Fiscal Code for an italian citizen. If you think you need these info, feel free to contact us using the Comments section below this post and we'll be pleased to fill that gap. This post contains the ENGLISH version of the source code: the italian version is available here, together with a bunch of additional explanation regarding how the Italian Fiscal Codes actually work, including the algorythms that generates them and how to properly verify them: I won't be translating that part because I don't think it would be of any interest for non-italian readers. Since after many years I continue to use it very much I think it may be useful to share it, in the hope that it will simplify the life of other fellow developers. There's no Italian programmer (or one who has worked in Italy) who has not had to deal at least once with Italian Tax Codes / Fiscal Codes: we literally run into them everytime we need to work on any context involving the management of someone's personal data: registries, flows, management, economic / financial calculation tools.įor this reason, many years ago, I developed a class in ASP.NET C # helper class that allows you to do most of these operations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |