//возможно, сделать отсюда проверку логина и пароля, и только тогда считывание информации. public Card(string _cardnum) { cardnum = _cardnum; Connection connect = new Connection(); connect.Open(); Dictionary<string, string> userinfo = CardRW.ReadByCNum(cardnum,connect._connect); connect.Close(); //распарсить все из userinfo }
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(); }
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(); } }
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(); } }
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(); }
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(); }