public static void SampleBankAccs() { BankAcc a1 = new BankAcc { AccNumber = 123456789, Balance = 1000000000.00, InterestRate = 6.9, Owners = new List <Customer>(), Transactions = new List <Transaction>() }; }
public void UpdateBankAcc(BankAcc bankacc) { try { _db.Update(bankacc); //return true; } catch (Exception ex) { //throw; } }
public async Task <bool> AddBankAcc(BankAcc bankAcc) { try { await _db.AddAsync(bankAcc); return(true); } catch (Exception ex) { throw; } }
public void ProcessRequest(HttpContext context) { BankAcc ai = new BankAcc(); string userid = context.Session["userid"].ToString(); //string userid = "admin01"; string strtext = "SELECT id,wx_id , acc_num ,acc_bank,acc_kind ,isNow,yhmx,isuse,acc_name FROM con_account where wx_id ='" + userid + "'";// DataSet ds = SqlUtils.MSSQLHelper.Query(strtext); //List<BankAcc> bk = new List<BankAcc> { }; string rtlist = ""; string rt = ""; UTF8Encoding utf8 = new UTF8Encoding(); if (ds.Tables[0].Rows.Count > 0) { rtlist = "{\"list\":["; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ai.id = Convert.ToInt32(ds.Tables[0].Rows[i][0].ToString()); ai.wx_id = ds.Tables[0].Rows[i][1].ToString(); ai.acc_num = ds.Tables[0].Rows[i][2].ToString(); ai.acc_bank = ds.Tables[0].Rows[i][3].ToString(); ai.acc_kind = ds.Tables[0].Rows[i][4].ToString(); ai.isNow = ds.Tables[0].Rows[i][5].ToString(); ai.yhmx = ds.Tables[0].Rows[i][6].ToString(); ai.isuse = ds.Tables[0].Rows[i][7].ToString(); ai.acc_name = ds.Tables[0].Rows[i][8].ToString(); // bk.Add(ai); rt = CrytUtils.Common.ObjectToJson <BankAcc>(ai, utf8); rtlist = rtlist + rt + ","; } rtlist = rtlist.Substring(0, rtlist.LastIndexOf(",")) + "]}"; } context.Response.ContentType = "text/plain"; context.Response.Write(JsonConvert.DeserializeObject(rtlist)); }