public bool UpdateTstkm00(Tstkm00 paramter, SqlConnection conn, SqlTransaction tran) { #region 參數 string sqlExecute = string.Empty; DynamicParameters sqlParam = new DynamicParameters(); sqlParam.Add("@tick_qtax", paramter.tick_qtax); sqlParam.Add("@tick_cost", paramter.tick_cost); sqlParam.Add("@tick_tot_amt", paramter.tick_tot_amt); sqlParam.Add("@tick_tot_cost", paramter.tick_tot_cost()); sqlParam.Add("@tick_tkno", paramter.tick_tkno); sqlParam.Add("@tick_tkseq", paramter.tick_tkseq); #endregion #region SQL 語法 sqlExecute = @" UPDATE TSTKM00 SET tick_qtax = @tick_qtax, tick_cost = @tick_cost, tick_tot_amt = @tick_tot_amt, tick_tot_cost = @tick_tot_cost WHERE tick_tkno = @tick_tkno AND tick_tkseq = @tick_tkseq ;" ; #endregion #region SQL 查詢 return(conn.Execute(sqlExecute, sqlParam, tran) > 0); #endregion }
public double getErat(Tstkm00 paramter) { #region SQL 語法 string sqlQuery = @" select tick_erat from tstkm00 WHERE tick_tkno = @tick_tkno AND tick_tkseq = @tick_tkseq ;" ; #endregion DynamicParameters sqlParam = new DynamicParameters(); sqlParam.Add("@tick_tkno", paramter.tick_tkno); sqlParam.Add("@tick_tkseq", paramter.tick_tkseq); #region SQL 查詢 using (SqlConnection conn = SQLFunc.OpenConnection(_connectString)) { return(conn.Query <double>(sqlQuery, sqlParam).FirstOrDefault()); } #endregion }