示例#1
0
        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);
            }
        }
示例#2
0
        private void LoadList()
        {

            EClass d = new EClass();
            DataTable dt = d.GetClasses();

            grdList.AutoGenerateColumns = false;
            grdList.DataSource = dt;
        }
示例#3
0
        private void FillClassCombo()
        {

            EClass c = new EClass();
            DataTable dt = c.GetClasses();
            cbxClass.DataSource = dt;
            cbxClass.DisplayMember = "CName";
            cbxClass.ValueMember = "ClassID";
            IsClassesLoaded = true;

        }