public static void GetDataWithName(String _Name) { try { var main = new UserDataBaseTableAdapters.UserDBTableAdapter(); currData = main.GetDataByName(_Name); } catch (Exception e) { Console.Write(e.Message); } }
public static void AddData(String _Name, double _Amu) { try { var main = new UserDataBaseTableAdapters.UserDBTableAdapter(); main.InsertQuery(_Name, _Amu, DateTime.Now); ReadDataFromDataBase(); } catch (Exception e) { Console.Write(e.Message); } }
public static Double GetSumWithUser(String _Name) { try { var main = new UserDataBaseTableAdapters.UserDBTableAdapter(); var Total = main.GetSumWithUser(_Name); return(Total.Value); } catch (Exception e) { Console.Write(e.Message); } return(0.0); }
public static void ReadDataFromDataBase() { try { var main = new UserDataBaseTableAdapters.UserDBTableAdapter(); mainData = main.GetData(); var nameMain = new UserNameDBTableAdapters.UserNameTableAdapter(); nameData = nameMain.GetData(); } catch (Exception e) { Console.Write(e.Message); } }
public static Int32 GetTotalRecords() { try { var main = new UserDataBaseTableAdapters.UserDBTableAdapter(); var Total = main.GetNoOfRecords(); return(Total.Value); } catch (Exception e) { Console.Write(e.Message); } return(0); }
public static void DeleteUser(String _Name) { try { var main = new UserDataBaseTableAdapters.UserDBTableAdapter(); var nameMain = new UserNameDBTableAdapters.UserNameTableAdapter(); main.DeleteAllDataWithName(_Name); nameMain.DeleteUserWithName(_Name); ReadDataFromDataBase(); } catch (Exception e) { Console.Write(e.Message); } }