Example #1
0
 //возможно, сделать отсюда проверку логина и пароля, и только тогда считывание информации.
 public Card(string _cardnum)
 {
     cardnum = _cardnum;
     Connection connect = new Connection();
     connect.Open();
     Dictionary<string, string> userinfo = CardRW.ReadByCNum(cardnum,connect._connect);
     connect.Close();
     //распарсить все из userinfo
 }
Example #2
0
 public void SetExchangeRate()
 {
     //GetCursOnDate(DateTime.Today());
     ExchangeRates rates = new ExchangeRates();
     Connection connect = new Connection();
     connect.Open();
     foreach (var k in rates.rates)
     {
         Exchange.SetExchangeRates(k.ISO4217from, k.ISO4217to, k.rate, connect._connect);
     }
     connect.Close();
 }
Example #3
0
 public string Admin(string _login, string _password)
 {
     Connection connect = new Connection();
     connect.Open();
     try
     {
         Dictionary<string, string> admininfo = Loginization.AdminLoginization(_login, connect._connect);
         if (_password == admininfo["password"])
         {
             return admininfo["status"];
         }
         return null;
     }
     finally
     {
         connect.Close();
     }
 }
Example #4
0
 public bool User(string _login, string _password)
 {
     Connection connect = new Connection();
     connect.Open();
     try
     {
         Dictionary<string, string> userinfo = Loginization.UserLoginization(_login, connect._connect);
         DateTime dtexp = DateTime.Parse(userinfo["lgndateexp"]);
         if ((_password == userinfo["password"]) && ((DateTime.Today.CompareTo(dtexp)) == 0))
         {
             return true;
         }
         return false;
     }
     finally
     {
         connect.Close();
     }
 }
Example #5
0
 private string CreateUniqueCardNumber()
 {
     Connection connect = new Connection();
     connect.Open();
     string lastnum = CardRW.GetLastCardNumber(connect._connect);
     int num =int.Parse(lastnum.Substring(9, 15));
     num = num + 1;
     connect.Close();
     return num.ToString();
 }
Example #6
0
 public void SaveCard()
 {
     Dictionary<string, string> cardinfo = new Dictionary<string, string>();
     cardinfo.Add("cnum", cardnum);
     cardinfo.Add("cdateexp", dateexp.ToString());
     cardinfo.Add("lname",lastname);
     cardinfo.Add("fname",firstname);
     cardinfo.Add("settleacc",settleacc);
     cardinfo.Add("pID","");
     cardinfo.Add("pasdateissue","12-02-2030");
     cardinfo.Add("scrtcode","013");
     cardinfo.Add("balancelimit", balancelimit.ToString());
     Connection connect = new Connection();
     connect.Open();
     CardRW.CreateCard(cardinfo, connect._connect);
     connect.Close();
 }