private void btnSave_Click(object sender, EventArgs e) { EClass d = new EClass(); try { if (!IsValid()) { return; } d.CName = txtCName.Text; d.Desc = txtDesc.Text; if (dataBoundItem != null) { d.CID =Convert.ToInt16( dataBoundItem["ClassID"].ToString()); d.Update(); } else { d.Insert(); } this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { Utility.WriteToLog(ex, this); } }
private void LoadList() { EClass d = new EClass(); DataTable dt = d.GetClasses(); grdList.AutoGenerateColumns = false; grdList.DataSource = dt; }
private void FillClassCombo() { EClass c = new EClass(); DataTable dt = c.GetClasses(); cbxClass.DataSource = dt; cbxClass.DisplayMember = "CName"; cbxClass.ValueMember = "ClassID"; IsClassesLoaded = true; }