public ConfCurrency GetBaseCurrencyView(int SEQNO) { string errorStr = ""; string listQuery = " SELECT cc.SEQNO ,cc.CURRENCY_UNIT ,BASIC_UNIT ,MEMO ,AMNT ,DATETIME_UPD FROM conf_currency cc left outer join "; listQuery += " (SELECT CURRENCY_UNIT, AMNT, DATETIME_UPD FROM conf_exchange_rate "; listQuery += " WHERE SEQNO in (SELECT max(SEQNO) FROM conf_exchange_rate GROUP BY CURRENCY_UNIT )) cer"; listQuery += " on cc.CURRENCY_UNIT = cer.CURRENCY_UNIT WHERE SEQNO = " + SEQNO; DataTable listDt = getQueryResult(listQuery, out errorStr); ConfCurrency model = new ConfCurrency(); if (listDt != null && listDt.Rows.Count != 0) { model.SEQNO = int.Parse(listDt.Rows[0]["SEQNO"].ToString().Trim()); model.CURRENCY_UNIT = listDt.Rows[0]["CURRENCY_UNIT"].ToString().Trim(); if (listDt.Rows[0]["BASIC_UNIT"].ToString().Trim() != "") { model.BASIC_UNIT = Convert.ToDouble(listDt.Rows[0]["BASIC_UNIT"].ToString().Trim()); } if (listDt.Rows[0]["AMNT"].ToString().Trim() != "") { model.AMNT = Convert.ToDouble(listDt.Rows[0]["AMNT"].ToString().Trim()); } model.DATETIME_UPD = listDt.Rows[0]["DATETIME_UPD"].ToString().Trim(); model.MEMO = listDt.Rows[0]["MEMO"].ToString().Trim(); } return(model); }
public BaseCurrencyModels GetBaseCurrencyList() { string errorStr = ""; string listQuery = " SELECT cc.SEQNO ,cc.CURRENCY_UNIT ,BASIC_UNIT ,MEMO ,AMNT ,DATETIME_UPD FROM conf_currency cc left outer join "; listQuery += " (SELECT CURRENCY_UNIT, AMNT, DATETIME_UPD FROM conf_exchange_rate "; listQuery += " WHERE SEQNO in (SELECT max(SEQNO) FROM conf_exchange_rate GROUP BY CURRENCY_UNIT )) cer"; listQuery += " on cc.CURRENCY_UNIT = cer.CURRENCY_UNIT order by cc.SEQNO"; DataTable listDt = getQueryResult(listQuery, out errorStr); BaseCurrencyModels model = new BaseCurrencyModels(); if (listDt != null && listDt.Rows.Count != 0) { for (int i = 0; i < listDt.Rows.Count; i++) { ConfCurrency temp = new ConfCurrency(); temp.SEQNO = int.Parse(listDt.Rows[i]["SEQNO"].ToString().Trim()); temp.CURRENCY_UNIT = listDt.Rows[i]["CURRENCY_UNIT"].ToString().Trim(); if (listDt.Rows[i]["BASIC_UNIT"].ToString().Trim() != "") { temp.BASIC_UNIT = Convert.ToDouble(listDt.Rows[i]["BASIC_UNIT"].ToString().Trim()); } temp.MEMO = listDt.Rows[i]["MEMO"].ToString().Trim(); if (listDt.Rows[i]["AMNT"].ToString().Trim() != "") { temp.AMNT = Convert.ToDouble(listDt.Rows[i]["AMNT"].ToString().Trim()); } temp.DATETIME_UPD = listDt.Rows[i]["DATETIME_UPD"].ToString().Trim(); model.Items.Add(temp); } } return(model); }