コード例 #1
0
        private void btnupdate_Click(object sender, EventArgs e)
        {
            StudentInfoModel stu = new StudentInfoModel();

            stu = (StudentInfoModel)dgvStudent.CurrentRow.DataBoundItem;
            StudentInfoBLL stubll = new StudentInfoBLL();

            stubll.updateStudentInfo(stu);
        }
コード例 #2
0
        private void btnSure_Click(object sender, EventArgs e)
        {
            string pwd = txtp.Text;
            string pp  = txtPwd.Text;

            if (pwd != pp)
            {
                MessageBox.Show("密码不一致", "错误");
            }
            else
            {
                StudentInfoBLL   stubll = new StudentInfoBLL();
                StudentInfoModel stu    = stubll.getStudentInfoByID(stuID);
                stu.StuPwd = pwd;
                if (stubll.updateStudentInfo(stu) == 1)
                {
                    this.Close();
                    this.Dispose();
                }
            }
        }
コード例 #3
0
        private void InfoBaseForm_Load(object sender, EventArgs e)
        {
            StudentInfoBLL   stubll   = new StudentInfoBLL();
            StudentInfoModel stuModel = new StudentInfoModel();
            GetGroupsBLL     group    = new GetGroupsBLL();

            stuModel            = stubll.getStudentInfoByID(stuID);
            txtstuName.Text     = stuModel.StuName;
            txtstuName.ReadOnly = true;

            txtstuID.Text     = stuModel.StuID;
            txtstuID.ReadOnly = true;

            txtentrance.Text     = stuModel.StuClass;
            txtentrance.ReadOnly = true;

            BorrowHistoryBLL         bll  = new BorrowHistoryBLL();
            List <ShowBorrowHistory> list = bll.getListBorrowHisoryNow(stuModel.StuID);

            txtnowBorrows.Text = list.Count.ToString();



            string    sql = "select schoolName from SchoolType where schoolid='" + stuModel.SchoolID + "'";
            SQLHelper h   = new SQLHelper();

            SqlParameter[] psa =
            {
                new SqlParameter("@stuID", stuID),
            };
            string s = h.ExecuteScalar(sql, psa).ToString();

            txtschool.Text     = s;
            txtschool.ReadOnly = true;

            string    sqla = "select CollegeName from Collegetype where CollegeId=" + "'" + stuModel.CollegeID + "'";
            SQLHelper a    = new SQLHelper();

            SqlParameter[] psb =
            {
                new SqlParameter("@stuID", stuID),
            };
            string t = a.ExecuteScalar(sqla, psb).ToString();

            txtcollege.Text     = t;
            txtcollege.ReadOnly = true;

            string    sqlb = "select ProfessionName from professiontype where ProfessionID=" + "'" + stuModel.ProfessionID + "'";
            SQLHelper b    = new SQLHelper();

            SqlParameter[] psc =
            {
                new SqlParameter("@stuID", stuID),
            };
            string u = b.ExecuteScalar(sqlb, psc).ToString();

            txtprofession.Text     = u;
            txtprofession.ReadOnly = true;

            txtstuClass.Text     = stuModel.StuClass;
            txtstuClass.ReadOnly = true;
            StudentInfoBLL stublld = new StudentInfoBLL();

            int m = stublld.timeoutBorrowsBook(stuID);

            stuModel.NowsCredit = stuModel.NowsCredit - m;
            txtnowsCredit.Text  = stuModel.NowsCredit.ToString();
            stublld.updateStudentInfo(stuModel);
        }