private void LoadData1() { try { dalAssetList dal = new dalAssetList(); BindingCollection <modAssetDepreList> list = dal.GetDepreList(out Util.emsg); DBGrid1.DataSource = list; } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnAssetId_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; dalAssetList dal = new dalAssetList(); BindingCollection <modAssetList> list = dal.GetIList("1", string.Empty, string.Empty, string.Empty, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList("请选择资产:", list); frm.Selection = true; if (frm.ShowDialog() == DialogResult.OK) { modAssetList mod = dal.GetItem(Util.retValue1, out Util.emsg); if (mod != null) { txtAssetId.Text = mod.AssetId; txtAssetName.Text = mod.AssetName; txtNetMny.Text = mod.NetMny.ToString(); } else { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }