/// <summary> /// Returns a GroupMember object if it exists in the databse otherwise it returns a null. If the /// email exists in the database as in the GroupMember table in database the method will return a GroupMember /// object otherwise it will return an empty GroupMember object. /// </summary> /// <param >int CampResNo</param> /// <returns>List of GroupMemeber</returns> public GroupMember GetGroupMembers(string coEmail) { GroupMember selectedMember = null; EventAccountDataHelper groupMembergetter = new EventAccountDataHelper(); //selectedMember=groupMembergetter String sql = String.Format("SELECT * FROM GROUPMEMBERS WHERE Co_email='{0}'", coEmail); MySqlCommand command = new MySqlCommand(sql, connection); try { connection.Open(); MySqlDataReader reader = command.ExecuteReader(); int groupId; string coEMail; int campResNo; bool checkIn; while (reader.Read()) { coEMail = Convert.ToString(reader["Co_email"]); campResNo = Convert.ToInt32(reader["CampRes_No"]); checkIn = Convert.ToBoolean(reader["Check_in"]); selectedMember = new GroupMember(coEMail, campResNo); selectedMember.CheckIn = checkIn; } } catch { MessageBox.Show("error while loading from database."); } finally { connection.Close(); } return(selectedMember); }
public ReturnForm() { InitializeComponent(); //turetu is duomenu bazes sukrauti itemus ir issaugoti sarase + dataHelper = new ItemDataHelper(); materials = dataHelper.GetAllMaterials(); eaDataHelper = new EventAccountDataHelper(); phidgetScanner = new PhidgetHandler(); customerRFID = null; invoiceDataHelper = new InvoiceDataHelper(); //Activate and Open RFID + try { phidgetScanner.OpenRFIDReader(); phidgetScanner.myRFIDReader.Tag += new TagEventHandler(ChangeTagOnForm); } catch { MessageBox.Show("No RFID reader detected."); } }
/// <summary> /// Returns a GroupMember object if it exists in the databse otherwise it returns a null. If the /// email exists in the database as in the GroupMember table in database the method will return a GroupMember /// object otherwise it will return an empty GroupMember object. /// </summary> /// <param >int CampResNo</param> /// <returns>List of GroupMemeber</returns> public GroupMember GetGroupMembers(string coEmail) { GroupMember selectedMember = null; EventAccountDataHelper groupMembergetter = new EventAccountDataHelper(); //selectedMember=groupMembergetter String sql = String.Format("SELECT * FROM GROUPMEMBERS WHERE Co_email='{0}'",coEmail); MySqlCommand command = new MySqlCommand(sql, connection); try { connection.Open(); MySqlDataReader reader = command.ExecuteReader(); int groupId; string coEMail; int campResNo; bool checkIn; while (reader.Read()) { coEMail = Convert.ToString(reader["Co_email"]); campResNo = Convert.ToInt32(reader["CampRes_No"]); checkIn = Convert.ToBoolean(reader["Check_in"]); selectedMember = new GroupMember(coEMail, campResNo); selectedMember.CheckIn = checkIn; } } catch { MessageBox.Show("error while loading from database."); } finally { connection.Close(); } return selectedMember; }
private void btnLoadFileAndSave_Click(object sender, EventArgs e) { // this is the loading part that will read the paypal text file. // I used a predefined name for testing. We will just have to indicate the name // of the paypal textfile for the updates. // At the same time it will update the balance of the client read = new PaypalInvoiceReader(userSelectedFilePath); s = read.readfile(); foreach ( string m in s) { richTextBox1.Text += m + "\n"; int index = s.IndexOf(m); if (index > 3) { int[] arrID = new int[s.Count - 4]; decimal[] arrB = new decimal[s.Count - 4]; string[] arrS = m.Split(' '); foreach (string l in arrS) { arrID[index - 4] = Convert.ToInt32(arrS[0]); arrB[index - 4] = Convert.ToDecimal(arrS[1]); } EventAccountDataHelper accountHelper = new EventAccountDataHelper(); accountHelper.UpdateAccountBalanceWithPaypalFIle(arrID[index - 4], arrB[index - 4]); } } }
public EventAccount EventAccountIdGetter(EventAccountDataHelper datHelp, int iD) { accountHolder = datHelp.GetAccount(iD); return accountHolder; }
public EventAccount EventAccountIdGetter(EventAccountDataHelper datHelp, int iD) { accountHolder = datHelp.GetAccount(iD); return(accountHolder); }