void GetOnCreditItemInfo(int OnCreditID) { m_OnCredit = CGlobalInstance.Instance.DbAdaHelper.GetOnCreditItem(OnCreditID); if (m_OnCredit != null) { tbCompanyB.Text = m_OnCredit.Company; tbAddress.Text = m_OnCredit.Address; tbPhone.Text = m_OnCredit.Phone; tbRemarkB.Text = m_OnCredit.Remark; tbOnCreditLimit.Text = m_OnCredit.OnCreditLimit.ToString(); tbOnCreditSum.Text = m_OnCredit.OnCreditSum.ToString(); tbSurplusB.Text = m_OnCredit.Surplus.ToString(); } else { tbCompanyB.Text = "数据获取异常"; tbAddress.Text = ""; tbPhone.Text = ""; tbRemarkB.Text = ""; tbOnCreditLimit.Text = ""; tbOnCreditSum.Text = ""; tbSurplusB.Text = ""; } }
void GetSelectedOnCredit() { if (cbOnCredit.SelectedItem != null) { DataRowView dr = (System.Data.DataRowView)cbOnCredit.SelectedItem; if (!string.IsNullOrEmpty(cbOnCredit.Text)) { int OnCreditID = Convert.ToInt32(dr["OnCreditID"]); GetOnCreditItemInfo(OnCreditID); } else { tbCompanyB.Text = dr["Company"].ToString(); tbAddress.Text = dr["Address"].ToString(); tbPhone.Text = dr["Phone"].ToString(); tbRemarkB.Text = dr["Remark"].ToString(); tbOnCreditLimit.Text = dr["OnCreditLimit"].ToString(); tbOnCreditSum.Text = dr["OnCreditSum"].ToString(); tbSurplusB.Text = dr["Surplus"].ToString(); } } else { m_OnCredit = null; tbCompanyB.Text = ""; tbAddress.Text = ""; tbPhone.Text = ""; tbRemarkB.Text = ""; tbOnCreditLimit.Text = ""; tbOnCreditSum.Text = ""; tbSurplusB.Text = ""; } }
public FormOnCreditItem() { m_OnCreditItem = new _tagOnCredit(); InitializeComponent(); }