public bool insertMoney(UserMoneyBean money) { string sum = "select Project_ID,sum(Money_Use) from tbl_UseMoney group by Project_ID having Project_ID='" + money.PrjID + "'"; ds = db.GetDataSet(sum); double usemoney = 0; double moneyt = 0; if (ds.Tables[0].Rows.Count > 0) { usemoney = Double.Parse(ds.Tables[0].Rows[0][1].ToString()); } string money_totality = "select Project_RatifyMoney from tbl_ProjectSubmit where Project_ID='" + money.PrjID + "'"; ds = db.GetDataSet(money_totality); if (ds.Tables[0].Rows[0][0].ToString() != "") { //string s = ds.Tables[0].Rows[0][0].ToString(); moneyt = Double.Parse(ds.Tables[0].Rows[0][0].ToString()); } double usem = moneyt - usemoney; sqlString = "insert into tbl_UseMoney(Project_ID,Money_Totality,Money_Use,Money_surplus,Money_UseDetails,Money_CrUse,Money_Time) values('" + money.PrjID + "'," + moneyt + "," + usemoney + "," + usem + ",'" + money.MoneyDetails + "'," + money.MoneyCrUse + ",'" + money.MoneyTime + "')"; if (db.ExecuteSQL(sqlString) != -1) { return(true); } return(false); }
private double isDouble(string database) { double money = 0; if (database != "") { money = Double.Parse(database); } return(money); }
public SqlMoney() { db = new SqlDataBase(); money = new UserMoneyBean(); }