public ReadingMasterView() { InitializeComponent(); if (DesignMode) { return; } this.MasterController = ControllersFactory.GetController(Controllers.READING_MASTER); this.DetailController = ControllersFactory.GetController(Controllers.READING_DETAIL); this.Model = new ReadingMasterModel(); }
private void ListBox1_SelectedIndexChanged(object sender, EventArgs e) { if (this.listBox1.SelectedIndex < 0) { return; } var table = MasterController.Read(new ReadingMasterModel() { ID = int.Parse(this.listBox1.Text.Substring(0, 3).Trim()) }, "ID"); if (table.Rows.Count == 0) { return; } this.Model = new ReadingMasterModel() { ID = int.Parse(table.Rows[0]["ID"].ToString()), RD_DATE = Convert.ToDateTime(table.Rows[0]["RD_DATE"].ToString()) }; }
private void Button3_Click(object sender, EventArgs e) { this.Model = new ReadingMasterModel(); }