private void list_xm_SelectedValueChanged(object sender, EventArgs e) { selectedXm = (XM)list_xm.SelectedItem; List <LJZ> ljzList = ls.findByXmId(selectedXm.fId); loadLjzList(ljzList); }
private void loadSingleData(XM xm) { List <XM> list = new List <XM>(); list.Add(xm); loadDataList(list); }
public void save(XM xm) { validate(xm); useTransaction(ctx => { insertOrUpdate(xm, ctx); return(xm); }); }
private void b_ok_Click(object sender, EventArgs e) { if (dgv.SelectedRows == null || dgv.SelectedRows.Count < 1) { MessageBox.Show(this, "请选择一个项目"); return; } selectedXm = (XM)dgv.SelectedRows[0].DataBoundItem; this.DialogResult = DialogResult.OK; this.Close(); }
private void openCreateXmForm() { XM xm = xs.newXm(); FormXm f = new FormXm(xm); DialogResult r = f.ShowDialog(this); if (r == DialogResult.OK) { loadSingleData(xm); } }
public void validate(XM xm) { if (String.IsNullOrEmpty(xm.XMMC)) { throw new Exception("项目名称不能为空。"); } if (String.IsNullOrEmpty(xm.XMZL)) { throw new Exception("项目坐落不能为空。"); } }
private void findXm() { FormXmList f = new FormXmList(); DialogResult r = f.ShowDialog(this); if (r == DialogResult.OK) { XM xm = f.selectedXm; zrz.XMMC = xm.XMMC; zrz.XMID = xm.fId; tb_xmmc.Text = xm.XMMC; } }
private static IEnumerable <XM> AllOrders(string GetProductsQuery) { // The following is order summary data var xmlist = new ObservableCollection <XM>(); try { using (SqlConnection conn = new SqlConnection(connectionString)) { conn.Open(); if (conn.State == System.Data.ConnectionState.Open) { using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandText = GetProductsQuery; using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { var product = new XM { xmbh = reader.GetString(0), xmmz = reader.GetString(1), xmlb = reader.GetString(2), qssj = reader.GetDateTime(3), jzsj = reader.GetDateTime(4), xmjb = reader.GetString(5), xmjf = reader.GetString(6), }; xmlist.Add(product); } } } } } return(xmlist); } catch (Exception eSql) { string e = eSql.ToString(); DisplayNoWifiDialog(e); } return(xmlist); }
public XM newXm() { XM xm = new XM(); return(xm); }
public FormXm(XM xm) { this.xm = xm; InitializeComponent(); init(); }