protected void dgList_DeleteCommand(object source, DataGridCommandEventArgs e)
    {
        ClassInfoMgr mgr = new ClassInfoMgr();

        mgr.DelClassInfo(e.Item.Cells[0].Text);
        this.initForm();
    }
    /// <summary>
    /// 初始化人员列表信息
    /// </summary>
    private void initForm()
    {
        ClassInfoMgr mgr = new ClassInfoMgr();

        this.dgList.DataSource = mgr.GetClassInfoList();
        this.dgList.DataBind();
    }
Esempio n. 3
0
    /// <summary>
    /// 获取一条Person类信息
    /// </summary>
    /// <param name="PersonID">登录编号</param>
    /// <returns>一条Person类记录</returns>
    public Person GetPerson(string PersonID)
    {
        Person       person = new Person();
        string       strSQL = "SELECT Top 1 * FROM Sys_Person WHERE PersonID = '" + PersonID + "'";
        DataTable    dt     = CMMgr.GetDataTable(strSQL);
        ClassInfoMgr cMgr   = new ClassInfoMgr();
        SpecMgr      sMgr   = new SpecMgr();

        if (dt.Rows.Count > 0)
        {
            DataRow row = dt.Rows[0];
            person.PersonID   = row["PersonID"].ToString();
            person.PersonName = row["PersonName"].ToString();
            person.Password   = row["Password"].ToString();
            person.Sex        = row["Sex"].ToString();
            person.Birthday   = row["Birthday"].ToString();
            person.ClassInfo  = cMgr.GetClassInfo(row["ClassInfoID"].ToString());
            person.Spec       = sMgr.GetSpec(row["SpecID"].ToString());

            return(person);
        }
        else
        {
            return(person);
        }
    }
Esempio n. 4
0
    /// <summary>
    /// 获取一条Client类信息
    /// </summary>
    /// <param name="ClientID">登录编号</param>
    /// <returns>一条Client类记录</returns>
    public Client GetClient(string ClientID)
    {
        Client       client = new Client();
        string       strSQL = "SELECT Top 1 * FROM Sys_Client WHERE ClientID = '" + ClientID + "'";
        ClassInfoMgr cMgr   = new ClassInfoMgr();
        SpecMgr      sMgr   = new SpecMgr();

        DataTable dt = CMMgr.GetDataTable(strSQL);

        if (dt.Rows.Count > 0)
        {
            DataRow row = dt.Rows[0];
            client.ClientID   = row["ClientID"].ToString();
            client.ClientName = row["ClientName"].ToString();
            client.Password   = row["Password"].ToString();
            client.Sex        = row["Sex"].ToString();
            client.ClassInfo  = cMgr.GetClassInfo(row["ClassInfoID"].ToString());
            client.Spec       = sMgr.GetSpec(row["SpecID"].ToString());
            client.Tel        = row["Tel"].ToString();
            client.Mail       = row["Mail"].ToString();
            client.QQ         = row["QQ"].ToString();

            return(client);
        }
        else
        {
            return(client);
        }
    }
 protected void btnNew_Click(object sender, EventArgs e)
 {
     if (this.txtClassInfoName.Text.Trim() != "")
     {
         ClassInfoMgr mgr       = new ClassInfoMgr();
         ClassInfo    classInfo = new ClassInfo();
         classInfo.ClassInfoName    = this.txtClassInfoName.Text.Trim();
         this.txtClassInfoName.Text = "";
         mgr.UpdateClassInfo(classInfo);
         this.initForm();
     }
     else
     {
         this.SendMessage("学生班级名称不能为空");
     }
 }
    protected void dgList_UpdateCommand(object source, DataGridCommandEventArgs e)
    {
        TextBox txt = (TextBox)e.Item.Cells[1].Controls[0];

        if (txt.Text.Trim() == "")
        {
            this.SendMessage("请填写更改后的名称");
        }
        else
        {
            ClassInfoMgr mgr       = new ClassInfoMgr();
            ClassInfo    classInfo = new ClassInfo();
            classInfo.ClassInfoID   = int.Parse(e.Item.Cells[0].Text);
            classInfo.ClassInfoName = txt.Text.Trim();
            mgr.UpdateClassInfo(classInfo);
            this.dgList.EditItemIndex = -1;
            this.initForm();
        }
    }