Esempio n. 1
0
        private void frmAccountEdit_Load(object sender, EventArgs e)
        {
            string  str = "select * from userInfo where userID='" + userID + "'";
            DataSet ds  = operate.getTable(str);

            ds.Dispose();
            userIDValue.Text   = userID;
            IDValue.Text       = ds.Tables[0].Rows[0][0].ToString();
            userNameValue.Text = ds.Tables[0].Rows[0][2].ToString();
            userPwdValue.Text  = ds.Tables[0].Rows[0][3].ToString();
            switch (ds.Tables[0].Rows[0][4].ToString())
            {
            case "student": userAuthValue.Text = "毕业生"; break;

            case "teacher": userAuthValue.Text = "教师"; break;

            case "corporation": userAuthValue.Text = "企业"; break;

            case "admin": userAuthValue.Text = "管理"; break;

            default: break;
            }
            stuIDValue.Text   = ds.Tables[0].Rows[0][5].ToString();
            corIDValue.Text   = ds.Tables[0].Rows[0][6].ToString();
            adNameValue.Text  = ds.Tables[0].Rows[0][7].ToString();
            teaNameValue.Text = ds.Tables[0].Rows[0][8].ToString();
        }
Esempio n. 2
0
        private void frmStudentView_Load(object sender, EventArgs e)
        {
            operate.getImage(stuID, pictureBox1);
            stuIDValue.Text = stuID;
            DataSet ds = operate.getTable("select * from stuInfo where stuID='" + stuID + "'");

            ds.Dispose();
            stuNameValue.Text      = ds.Tables[0].Rows[0][1].ToString();
            stuFmrNameValue.Text   = ds.Tables[0].Rows[0][3].ToString();
            stuSexValue.Text       = ds.Tables[0].Rows[0][4].ToString();
            stuBirthValue.Text     = ds.Tables[0].Rows[0][5].ToString();
            stuNationValue.Text    = ds.Tables[0].Rows[0][6].ToString();
            stuPoliValue.Text      = ds.Tables[0].Rows[0][7].ToString();
            stuResValue.Text       = ds.Tables[0].Rows[0][8].ToString();
            stuIDCValue.Text       = ds.Tables[0].Rows[0][9].ToString();
            stuWorkPlaceValue.Text = ds.Tables[0].Rows[0][10].ToString();
            stuPCValue.Text        = ds.Tables[0].Rows[0][11].ToString();
            stuWorkTelValue.Text   = ds.Tables[0].Rows[0][12].ToString();
            stuAddValue.Text       = ds.Tables[0].Rows[0][13].ToString();
            stuTelValue.Text       = ds.Tables[0].Rows[0][14].ToString();
            stuExpValue.Text       = ds.Tables[0].Rows[0][15].ToString();
            stuPrzCrtValue.Text    = ds.Tables[0].Rows[0][16].ToString();
            if (isTeacher == true)
            {
                button1.Visible = true;
            }
            else
            {
                button1.Visible = false;
            }
        }
Esempio n. 3
0
        private void frmStudent_Load(object sender, EventArgs e)
        {
            operate.getImage(stuID, pictureBox1);
            stuIDValue.Text = stuID;
            DataSet ds = operate.getTable("select * from stuInfo where stuID='" + stuID + "'");

            ds.Dispose();
            stuNameValue.Text      = ds.Tables[0].Rows[0][1].ToString();
            stuFmrNameValue.Text   = ds.Tables[0].Rows[0][3].ToString();
            stuSexValue.Text       = ds.Tables[0].Rows[0][4].ToString();
            stuBirthValue.Text     = ds.Tables[0].Rows[0][5].ToString();
            stuNationValue.Text    = ds.Tables[0].Rows[0][6].ToString();
            stuPoliValue.Text      = ds.Tables[0].Rows[0][7].ToString();
            stuResValue.Text       = ds.Tables[0].Rows[0][8].ToString();
            stuIDCValue.Text       = ds.Tables[0].Rows[0][9].ToString();
            stuWorkPlaceValue.Text = ds.Tables[0].Rows[0][10].ToString();
            stuPCValue.Text        = ds.Tables[0].Rows[0][11].ToString();
            stuWorkTelValue.Text   = ds.Tables[0].Rows[0][12].ToString();
            stuAddValue.Text       = ds.Tables[0].Rows[0][13].ToString();
            stuTelValue.Text       = ds.Tables[0].Rows[0][14].ToString();
            stuExpValue.Text       = ds.Tables[0].Rows[0][15].ToString();
            stuPrzCrtValue.Text    = ds.Tables[0].Rows[0][16].ToString();
            string dgvs = "select id as '编号',reqType as '申请类型',reqDate as '申请日期',reqResult as '申请结果',conDate as '申核日期' from requestInfo where reqPeople='" + stuNameValue.Text + "'";

            operate.bindDataGridView(dataGridView1, dgvs);
            dgvs = "select corID as '企业编号',corName as '企业名',corTel as '企业电话',corAdd as '企业地址' from corInfo";
            operate.bindDataGridView(dataGridView2, dgvs);
            label3.Text = ds.Tables[0].Rows[0][2].ToString();
        }
Esempio n. 4
0
        private void frmCorView_Load(object sender, EventArgs e)
        {
            string  str = "select * from corInfo where corID='" + corID + "'";
            DataSet ds  = operate.getTable(str);

            ds.Dispose();
            corIDValue.Text          = corID;
            corNameValue.Text        = ds.Tables[0].Rows[0][1].ToString();
            corResPersonValue.Text   = ds.Tables[0].Rows[0][2].ToString();
            corRegAddValue.Text      = ds.Tables[0].Rows[0][3].ToString();
            corTelValue.Text         = ds.Tables[0].Rows[0][4].ToString();
            corPersonValue.Text      = ds.Tables[0].Rows[0][5].ToString();
            corPersonTelValue.Text   = ds.Tables[0].Rows[0][6].ToString();
            corPersonEmailValue.Text = ds.Tables[0].Rows[0][7].ToString();
            corConValue.Text         = ds.Tables[0].Rows[0][8].ToString();
            corAddValue.Text         = ds.Tables[0].Rows[0][9].ToString();
            label1.Text = ds.Tables[0].Rows[0][10].ToString();
            operate.getCorImage(corID, pictureBox1);
        }
Esempio n. 5
0
        private void frmCorEdit_Load(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            DataSet ds = new DataSet();

            ds = operate.getTable("select * from corInfo where corID='" + corID + "'");
            ds.Dispose();
            corIDValue.Text          = corID;
            corNameValue.Text        = ds.Tables[0].Rows[0][1].ToString();
            corResPersonValue.Text   = ds.Tables[0].Rows[0][2].ToString();
            corRegAddValue.Text      = ds.Tables[0].Rows[0][3].ToString();
            corTelValue.Text         = ds.Tables[0].Rows[0][4].ToString();
            corPersonValue.Text      = ds.Tables[0].Rows[0][5].ToString();
            corPersonTelValue.Text   = ds.Tables[0].Rows[0][6].ToString();
            corPersonEmailValue.Text = ds.Tables[0].Rows[0][7].ToString();
            corConValue.Text         = ds.Tables[0].Rows[0][8].ToString();
            corAddValue.Text         = ds.Tables[0].Rows[0][9].ToString();
            operate.getCorImage(corID, pictureBox1);
        }
Esempio n. 6
0
        private void frmCorporation_Load(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();

            ds = operate.getTable("select * from corInfo where corID='" + corID + "'");
            ds.Dispose();
            corIDValue.Text          = corID;
            corNameValue.Text        = ds.Tables[0].Rows[0][1].ToString();
            corResPersonValue.Text   = ds.Tables[0].Rows[0][2].ToString();
            corRegAddValue.Text      = ds.Tables[0].Rows[0][3].ToString();
            corTelValue.Text         = ds.Tables[0].Rows[0][4].ToString();
            corPersonValue.Text      = ds.Tables[0].Rows[0][5].ToString();
            corPersonTelValue.Text   = ds.Tables[0].Rows[0][6].ToString();
            corPersonEmailValue.Text = ds.Tables[0].Rows[0][7].ToString();
            corConValue.Text         = ds.Tables[0].Rows[0][8].ToString();
            corAddValue.Text         = ds.Tables[0].Rows[0][9].ToString();
            corAuthValue.Text        = ds.Tables[0].Rows[0][11].ToString();
            operate.getCorImage(corID, pictureBox1);
            if (corAuthValue.Text == "否")
            {
                reqContentKey.Text      = "申请内容";
                reqIDValue.Visible      = false;
                reqContentValue.Visible = true;
                reqTypeValue.Items.Add("认证申请");
            }
            else
            {
                reqIDValue.Visible = true;
                reqTypeValue.Items.Add("申请查看学生");
                reqContentKey.Text      = "学号";
                reqContentValue.Visible = false;
                reqTypeValue.Items.Remove("认证申请");
            }
            string str = "select id as '编号',reqType as '申请类型',reqDate as '申请日期',reqResult as '申请结果'from requestInfo where reqPeople='" + corNameValue.Text + "'";

            operate.bindDataGridView(dataGridView1, str);
        }
Esempio n. 7
0
        private void frmRequestView_Load(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();

            ds = operate.getTable("select * from requestInfo where id='" + id + "'");
            ds.Dispose();
            reqIDValue.Text      = id;
            reqTypeValue.Text    = ds.Tables[0].Rows[0][1].ToString();
            reqContentValue.Text = ds.Tables[0].Rows[0][2].ToString();
            reqPeopleValue.Text  = ds.Tables[0].Rows[0][3].ToString();
            reqDateValue.Text    = ds.Tables[0].Rows[0][4].ToString();
            reqResultValue.Text  = ds.Tables[0].Rows[0][5].ToString();
            reqAdminValue.Text   = ds.Tables[0].Rows[0][6].ToString();
            conDateValue.Text    = ds.Tables[0].Rows[0][7].ToString();
            if (reqTypeValue.Text.Contains("复核申请"))
            {
                groupBox2.Enabled = false;
                button2.Visible   = false;
            }
            else if (reqTypeValue.Text == "申请查看学生")
            {
                groupBox2.Visible = false;
                if (reqResultValue.Text == "批准")
                {
                    button2.Visible = true;
                }
                else
                {
                    button2.Visible = false;
                }
            }
            else if (reqTypeValue.Text == "学生信息申核")
            {
                groupBox2.Visible = false;
                button2.Visible   = false;
            }
        }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (userName.Text.Trim() == "" || userPwd.Text.Trim() == "")
                {
                    MessageBox.Show("用户名或密码不能为空!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    return;
                }
                else
                {
                    SqlConnection conn = DBConnections.conn();
                    conn.Open();
                    string        sqlStr = "select * from userInfo where userName='******' and userPwd='" + userPwd.Text + "'";
                    SqlCommand    cmd    = new SqlCommand(sqlStr, conn);
                    SqlDataReader sdr    = cmd.ExecuteReader();
                    sdr.Read();
                    if (sdr.HasRows)
                    {
                        DataSet ds = operate.getTable(sqlStr);
                        ds.Dispose();
                        string auth = ds.Tables[0].Rows[0][4].ToString();
                        string time = DateTime.Now.ToString();
                        sqlStr = "update userInfo set LastLogin='******' where UserName='******'";
                        operate.sqlCmd(sqlStr);
                        conn.Close();
                        switch (auth)
                        {
                        case "admin":
                            MessageBox.Show("登陆成功,您是系统管理", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            frmAdmin fm1 = new frmAdmin();
                            fm1.name = ds.Tables[0].Rows[0][7].ToString();
                            fm1.Show();
                            break;

                        case "student":
                            MessageBox.Show("登陆成功,您是学生用户", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            frmStudent fm2 = new frmStudent();
                            fm2.stuID = ds.Tables[0].Rows[0][5].ToString();
                            fm2.Show();
                            break;

                        case "teacher":
                            MessageBox.Show("登陆成功,您是教师用户", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            frmTeacher fm3 = new frmTeacher();
                            fm3.name = ds.Tables[0].Rows[0][8].ToString();
                            fm3.Show();
                            break;

                        case "corporation":
                            MessageBox.Show("登陆成功,您是企业用户", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            frmCorporation fm4 = new frmCorporation();
                            fm4.corID = ds.Tables[0].Rows[0][6].ToString();
                            fm4.Show();
                            break;
                        }
                        this.Hide();
                    }
                    else
                    {
                        conn.Close();
                        MessageBox.Show("登陆失败,请检查帐号或密码是否正确", "登录失败", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        userPwd.Clear();
                    }
                }
            }
            catch {
                MessageBox.Show("错误", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }