Advertisement
Advertisement

 

bollettino

namespace PSC
{
public class Bollettini
{
public bool getCode(string strCode)
{
bool rtn = true;

if (strCode.Length != 50)
{
return false;
}

int first = Convert.ToInt16(strCode.Substring(0, 2));
Bollettino = strCode.Substring(2, first);

int second = Convert.ToInt16(strCode.Substring(first + 2, 2));
Contocorrente = strCode.Substring(first + 4, second);

int third = Convert.ToInt16(strCode.Substring(first + second + 4, 2));
string tmp = strCode.Substring(first + second + 6, third);
Importo = Convert.ToDecimal(tmp) / 100;

int fouth = Convert.ToInt16(strCode.Substring(first + second + third + 6, 1));
Codice = strCode.Substring(first + second + third + 7, fouth);

if (Codice != "896")
{
rtn = false;
}

return rtn;
}
}
}

Advertisement
Advertisement

By Enrico

My greatest passion is technology. I am interested in multiple fields and I have a lot of experience in software design and development. I started professional development when I was 6 years. Today I am a strong full-stack .NET developer (C#, Xamarin, Azure)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.