public void transfer(Users_DB user, int beneficiary, int amt) { string q1 = String.Format("update account set balance =balance - {0} where userid ={1}", amt, user.id); string q2 = String.Format("update account set balance =balance + {0} where userid ={1}", amt, beneficiary); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(q1); bl.NonQuery(q2); }
public void deleteTransactions(Users_DB user) { String query = String.Format("delete from transactions where userid={0}", user.id); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(query); }
public void AddTransaction(Transaction_DB transc) { String query = String.Format("insert into transactions(date_and_time,description, credit, debit,balance,userid) values('{0}','{1}','{2}','{3}','{4}',{5})", transc.date, transc.desc, transc.credit, transc.debit, transc.balance, transc.userid); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(query); }
public void DeleteUser(Users_DB user) { String query = String.Format("delete from users where id={0}", user.id); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(query); }
public void ChangePassword(Users_DB user) { String queruy = String.Format("update [users] set [password]='{0}' where [id]={1}", user.password, user.id); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(queruy); }
public void AddAccount(Users_DB user) { String query = String.Format("insert into [users]([fname],[lname],[email],[phone],[aadhar],[username],[password]) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", user.fname, user.lname, user.email, user.phone, user.aadhar, user.username, user.password); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(query); }
public void insertBalanceForNew(Users_DB user, int bal) { String query = String.Format("insert into account(userid,balance) values ({0},{1})", user.id, bal); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(query); }
public void updatebalance(Users_DB user, int amt, String mode) { if (mode == "add") { String query = String.Format("update account set balance=balance + {0} where userid={1}", amt, user.id); Console.Write(query); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(query); } if (mode == "withdraw") { String query = String.Format("update account set balance=balance - {0} where userid={1}", amt, user.id); BuisnessLogic bl = new BuisnessLogic(); bl.NonQuery(query); } }