private void Responsibility_Load(object sender, EventArgs e) { CmbDataGridview cmbd = new CmbDataGridview(); CCTRS ctr = new CCTRS(); ctr.ColorDataGridView(dgv_responsibility); cmbd.bind(dgv_responsibility, mystr, "Responsibility"); dgv_responsibility.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; }
private void Today_Form_Load(object sender, EventArgs e) { CCTRS ctr = new CCTRS(); ctr.ColorDataGridView(dgv_form); string mysql = "SELECT 打印编号,学员性别,年级科目,家教地址简单 as 家教地址,家教时间,concat((CASE WHEN 教员要求性别='' THEN NULL ELSE concat(教员要求性别,' ') END)," + "(CASE WHEN 教员要求地域 = '' THEN '' ELSE concat(教员要求地域, ' ') END)," + "(CASE WHEN 教员要求年级 = '' THEN '' ELSE concat(教员要求年级, ' ') END)," + "(CASE WHEN 教员要求专业 = '' THEN '' ELSE concat(教员要求专业, ' ') END)," + "(CASE WHEN 教员要求其他 = '' THEN '' ELSE concat(教员要求其他, ' ') END)) as 教员要求 FROM [Parents] WHERE 家教状态='接入' OR 家教状态='换人' OR 家教状态='重请' " + "ORDER BY 打印编号 DESC"; DataSet mydataset = mydb.ExecuteQuery(mysql, "Parents"); dgv_form.DataSource = mydataset.Tables["Parents"]; dgv_form.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; }
private void Workers_Revise_Load(object sender, EventArgs e) { CmbDataGridview cmbdgv = new CmbDataGridview(); CCTRS ctr = new CCTRS(); ctr.ColorDataGridView(dgv_inquire); string tb = "Workers"; cmbdgv.bind(dgv_inquire, mystr, tb); for (int i = 1; i < dgv_inquire.ColumnCount; i++) { dgv_inquire.Columns[i].ReadOnly = true; } dgv_inquire.Columns[0].ReadOnly = false; dgv_inquire.Columns[1].Visible = false; dgv_inquire.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; }
private void Students_Revise_Load(object sender, EventArgs e) { CmbDataGridview cmbd = new CmbDataGridview(); CCTRS ctr = new CCTRS(); ctr.ColorDataGridView(dgv_parents); string mystr = "SELECT 家长编号,打印编号,经办状态,经办时间,经办人,处理备注 FROM [Tutors-Parents] WHERE " + "教员编号='" + tutors_num1 + "'" + " ORDER BY (SELECT right(经办时间,10)) DESC"; cmbd.bind(dgv_parents, mystr, "Tutors-Parents"); dgv_parents.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader; dgv_parents.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; txt_num.Text = tutors_num1; txt_student_name.Text = tutors_name1; txt_student_num.Text = student_num1; cmbc.cboDataBind(cbo_subject, "SELECT distinct 院系专业 FROM [Tutors]", "Tutors", "院系专业"); cbo_subject.Text = grade_subject1; cbo_degree.Text = tutors_degree1; if (sex1 == "男") { rdo_man.Checked = true; } if (sex1 == "女") { rdo_woman.Checked = true; } txt_phone.Text = phone1; txt_place.Text = place1; if (blacklist1 == "是") { cbo_yesno.SelectedItem = "是"; } if (blacklist1 == "否") { cbo_yesno.SelectedItem = "否"; } txt_imprisonment.Text = imprisonment1; txt_important_remarks.Text = remarks1; }
private void Tutors_revise_Load(object sender, EventArgs e) { CmbClass cmbc = new CmbClass(); cmbc.cboDataBind(cbo_reception, "SELECT distinct 姓名 FROM [Workers]", "Workers", "姓名"); CmbDataGridview cmbd = new CmbDataGridview(); CCTRS ctr = new CCTRS(); ctr.ColorDataGridView(dgv_tutors); string mystr = "SELECT 教员编号,教员姓名,经办状态,经办时间,经办人,处理备注 FROM [Parents-Tutors] WHERE " + "打印编号='" + print_num1 + "' ORDER BY (SELECT right(经办时间,10)) DESC"; cmbd.bind(dgv_tutors, mystr, "Parents-Tutors"); dgv_tutors.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader; dgv_tutors.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; txt_parent_num.Text = parent_num1; txt_print_num.Text = print_num1; mystr = "SELECT 接入时间 FROM [Parents] WHERE ID='" + ID1 + "'"; dt_recepiton_time.Text = mydb.Returnafield(mystr); txt_parent_name.Text = parent_name1; txt_phone.Text = phone1; mystr = "SELECT 家教地址简单 FROM [Parents] WHERE ID='" + ID1 + "'"; txt_sadd.Text = mydb.Returnafield(mystr); txt_dadd.Text = dadd1; txt_grade_subject.Text = grade_subject1; if (student_sex1 == "男") { rdo_man.Checked = true; } if (student_sex1 == "女") { rdo_woman.Checked = true; } txt_tutor_price.Text = tutors_price1; txt_tutor_time.Text = tutors_time1; mystr = "SELECT 接待人 FROM [Parents] WHERE ID='" + ID1 + "'"; cbo_reception.Text = mydb.Returnafield(mystr); mystr = "SELECT 教员要求性别 FROM [Parents] WHERE ID='" + ID1 + "'"; cbo_sex.SelectedItem = mydb.Returnafield(mystr); mystr = "SELECT 教员要求地域 FROM [Parents] WHERE ID='" + ID1 + "'"; txt_place.Text = mydb.Returnafield(mystr); mystr = "SELECT 教员要求年级 FROM [Parents] WHERE ID='" + ID1 + "'"; txt_grade.Text = mydb.Returnafield(mystr); mystr = "SELECT 教员要求专业 FROM [Parents] WHERE ID='" + ID1 + "'"; txt_subject.Text = mydb.Returnafield(mystr); mystr = "SELECT 教员要求其他 FROM [Parents] WHERE ID='" + ID1 + "'"; txt_other_requests.Text = mydb.Returnafield(mystr); // string[] tutors_state = tutors_state1.Split(' '); // cbo_tutor_state.SelectedItem = tutors_state.Last(); cbo_tutor_state.SelectedItem = tutors_state1; txt_important_remarks.Text = important_mark1; cbo_payment_state.SelectedItem = payment_state1; dt_payment_time.Text = payment_time1; if (cbo_payment_state.SelectedItem.ToString() == "待缴" || cbo_payment_state.SelectedItem.ToString() == "无需缴纳") { dt_payment_time.Enabled = false; } if (cbo_payment_state.SelectedItem.ToString() == "已缴") { dt_payment_time.Enabled = true; } flag = true; }