Exemplo n.º 1
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();
                }
            }
        }
Exemplo n.º 2
0
        //check student whether exist
        private bool checkStudent(out StudentInfoModel stu)
        {
            StudentInfoBLL bll = new StudentInfoBLL();

            stu = bll.getStudentInfoByID(txtUser.Text.Trim());
            if (stu == null)
            {
                lblU.Visible = true;
                return(false);
            }
            else
            {
                if (stu.StuPwd == txtPwd.Text.Trim())
                {
                    return(true);
                }
                else
                {
                    lblP.Visible = true;
                    return(false);
                }
            }
        }
Exemplo n.º 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);
        }