private void simpleButton1_Click(object sender, EventArgs e) { if (groupBox2.Enabled == true) { PSP_LineData d1 = new PSP_LineData(); PSP_LineData temp = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox2.Tag.ToString()); d1.UID = groupBox2.Tag.ToString(); d1.q1 = comboBox1.Text; d1.q2 = comboBox2.Text; d1.q3 = comboBox3.Text; d1.q4 = comboBox4.Text; d1.q5 = comboBox5.Text; d1.q6 = comboBox6.Text; d1.q7 = comboBox7.Text; d1.q8 = comboBox8.Text; d1.q9 = comboBox9.Text; d1.q10 = comboBox10.Text; d1.q11 = comboBox11.Text; d1.q12 = comboBox12.Text; d1.q13 = comboBox13.Text; d1.q14 = comboBox14.Text; d1.q15 = comboBox15.Text; d1.q16 = t1.Text; d1.q17 = t2.Text; d1.q18 = t3.Text; d1.q19 = t4.Text; d1.q20 = comboBox16.Text; d1.q21 = comboBox17.Text; d1.q22 = comboBox18.Text; d1.q23 = comboBox19.Text; d1.q24 = comboBox20.Text; d1.q25 = comboBox21.Text; d1.col1 = textBox1.Text; if (temp == null) { Services.BaseService.Create <PSP_LineData>(d1); } else { Services.BaseService.Update <PSP_LineData>(d1); } } if (groupBox3.Enabled == true) { PSP_LineData d1 = new PSP_LineData(); PSP_LineData temp = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox3.Tag.ToString()); d1.UID = groupBox3.Tag.ToString(); d1.q1 = b1c1.Text; d1.q2 = b1c2.Text; d1.q3 = b1c3.Text; d1.q4 = b1c4.Text; d1.q5 = b1c5.Text; d1.q6 = b1c6.Text; d1.q7 = b1c7.Text; d1.q8 = b1c8.Text; d1.q9 = b1c9.Text; d1.q10 = b1c10.Text; d1.q11 = b1c11.Text; d1.q12 = b1c12.Text; d1.q13 = b1c13.Text; d1.q14 = b1c14.Text; d1.q15 = b1c15.Text; d1.q16 = t5.Text; d1.q17 = t6.Text; d1.q18 = t7.Text; d1.q19 = t8.Text; d1.q20 = b1c16.Text; d1.q21 = b1c17.Text; d1.q22 = b1c18.Text; d1.q23 = b1c19.Text; d1.q24 = b1c20.Text; d1.q25 = b1c21.Text; d1.col1 = textBox2.Text; if (temp == null) { Services.BaseService.Create <PSP_LineData>(d1); } else { Services.BaseService.Update <PSP_LineData>(d1); } } if (groupBox4.Enabled == true) { PSP_LineData d1 = new PSP_LineData(); PSP_LineData temp = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox4.Tag.ToString()); d1.UID = groupBox4.Tag.ToString(); d1.q1 = b2c1.Text; d1.q2 = b2c2.Text; d1.q3 = b2c3.Text; d1.q4 = b2c4.Text; d1.q5 = b2c5.Text; d1.q6 = b2c6.Text; d1.q7 = b2c7.Text; d1.q8 = b2c8.Text; d1.q9 = b2c9.Text; d1.q10 = b2c10.Text; d1.q11 = b2c11.Text; d1.q12 = b2c12.Text; d1.q13 = b2c13.Text; d1.q14 = b2c14.Text; d1.q15 = b2c15.Text; d1.q16 = t9.Text; d1.q17 = t10.Text; d1.q18 = t11.Text; d1.q19 = t12.Text; d1.q20 = b2c16.Text; d1.q21 = b2c17.Text; d1.q22 = b2c18.Text; d1.q23 = b2c19.Text; d1.q24 = b2c20.Text; d1.q25 = b2c21.Text; d1.col1 = textBox3.Text; if (temp == null) { Services.BaseService.Create <PSP_LineData>(d1); } else { Services.BaseService.Update <PSP_LineData>(d1); } } if (groupBox5.Enabled == true) { PSP_LineData d1 = new PSP_LineData(); PSP_LineData temp = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox5.Tag.ToString()); d1.UID = groupBox5.Tag.ToString(); d1.q1 = b3c1.Text; d1.q2 = b3c2.Text; d1.q3 = b3c3.Text; d1.q4 = b3c4.Text; d1.q5 = b3c5.Text; d1.q6 = b3c6.Text; d1.q7 = b3c7.Text; d1.q8 = b3c8.Text; d1.q9 = b3c9.Text; d1.q10 = b3c10.Text; d1.q11 = b3c11.Text; d1.q12 = b3c12.Text; d1.q13 = b3c13.Text; d1.q14 = b3c14.Text; d1.q15 = b3c15.Text; d1.q16 = t13.Text; d1.q17 = t14.Text; d1.q18 = t15.Text; d1.q19 = t16.Text; d1.q20 = b3c16.Text; d1.q21 = b3c17.Text; d1.q22 = b3c18.Text; d1.q23 = b3c19.Text; d1.q24 = b3c20.Text; d1.q25 = b3c21.Text; d1.col1 = textBox4.Text; if (temp == null) { Services.BaseService.Create <PSP_LineData>(d1); } else { Services.BaseService.Update <PSP_LineData>(d1); } } if (groupBox6.Enabled == true) { PSP_LineData d1 = new PSP_LineData(); PSP_LineData temp = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox6.Tag.ToString()); d1.UID = groupBox6.Tag.ToString(); d1.q1 = b4c1.Text; d1.q2 = b4c2.Text; d1.q3 = b4c3.Text; d1.q4 = b4c4.Text; d1.q5 = b4c5.Text; d1.q6 = b4c6.Text; d1.q7 = b4c7.Text; d1.q8 = b4c8.Text; d1.q9 = b4c9.Text; d1.q10 = b4c10.Text; d1.q11 = b4c11.Text; d1.q12 = b4c12.Text; d1.q13 = b4c13.Text; d1.q14 = b4c14.Text; d1.q15 = b4c15.Text; d1.q16 = t17.Text; d1.q17 = t18.Text; d1.q18 = t19.Text; d1.q19 = t20.Text; d1.q20 = b4c16.Text; d1.q21 = b4c17.Text; d1.q22 = b4c18.Text; d1.q23 = b4c19.Text; d1.q24 = b4c20.Text; d1.q25 = b4c21.Text; d1.col1 = textBox5.Text; if (temp == null) { Services.BaseService.Create <PSP_LineData>(d1); } else { Services.BaseService.Update <PSP_LineData>(d1); } } }
private void frmLineList2_Load(object sender, EventArgs e) { data = Services.BaseService.GetOneByKey <PSP_LineData>("a"); q1.Text = data.q1; q2.Text = data.q2; q3.Text = data.q3; q4.Text = data.q4; q5.Text = data.q5; q6.Text = data.q6; q7.Text = data.q7; q8.Text = data.q8; q9.Text = data.q9; q10.Text = data.q10; q11.Text = data.q11; q12.Text = data.q12; q13.Text = data.q13; q14.Text = data.q14; q15.Text = data.q15; q16.Text = data.q16; q17.Text = data.q17; q18.Text = data.q18; q19.Text = data.q19; q20.Text = data.q20; q21.Text = data.q21; q22.Text = data.q22; q23.Text = data.q23; q24.Text = data.q24; q25.Text = data.q25; for (int i = 0; i < list.Count; i++) { LineList1 line = Services.BaseService.GetOneByKey <LineList1>(list[i].ToString()); this.Controls["lb" + (i + 1)].Text = line.LineName; this.Controls["groupBox" + (i + 2)].Tag = line.UID; this.Controls["groupBox" + (i + 2)].Enabled = true; } if (groupBox2.Enabled == true) { PSP_LineData d1 = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox2.Tag.ToString()); //d1.UID = groupBox2.Tag.ToString(); if (d1 != null) { comboBox1.Text = d1.q1; comboBox2.Text = d1.q2; comboBox3.Text = d1.q3; comboBox4.Text = d1.q4; comboBox5.Text = d1.q5; comboBox6.Text = d1.q6; comboBox7.Text = d1.q7; comboBox8.Text = d1.q8; comboBox9.Text = d1.q9; comboBox10.Text = d1.q10; comboBox11.Text = d1.q11; comboBox12.Text = d1.q12; comboBox13.Text = d1.q13; comboBox14.Text = d1.q14; comboBox15.Text = d1.q15; t1.Text = d1.q16; t2.Text = d1.q17; t3.Text = d1.q18; t4.Text = d1.q19; comboBox16.Text = d1.q20; comboBox17.Text = d1.q21; comboBox18.Text = d1.q22; comboBox19.Text = d1.q23; comboBox20.Text = d1.q24; comboBox21.Text = d1.q25; textBox1.Text = d1.col1; } } if (groupBox3.Enabled == true) { PSP_LineData d1 = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox3.Tag.ToString()); //d1.UID = groupBox3.Tag.ToString(); if (d1 != null) { b1c1.Text = d1.q1; b1c2.Text = d1.q2; b1c3.Text = d1.q3; b1c4.Text = d1.q4; b1c5.Text = d1.q5; b1c6.Text = d1.q6; b1c7.Text = d1.q7; b1c8.Text = d1.q8; b1c9.Text = d1.q9; b1c10.Text = d1.q10; b1c11.Text = d1.q11; b1c12.Text = d1.q12; b1c13.Text = d1.q13; b1c14.Text = d1.q14; b1c15.Text = d1.q15; t5.Text = d1.q16; t6.Text = d1.q17; t7.Text = d1.q18; t8.Text = d1.q19; b1c16.Text = d1.q20; b1c17.Text = d1.q21; b1c18.Text = d1.q22; b1c19.Text = d1.q23; b1c20.Text = d1.q24; b1c21.Text = d1.q25; textBox2.Text = d1.col1; } } if (groupBox4.Enabled == true) { PSP_LineData d1 = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox4.Tag.ToString()); //d1.UID = groupBox4.Tag.ToString(); if (d1 != null) { b2c1.Text = d1.q1; b2c2.Text = d1.q2; b2c3.Text = d1.q3; b2c4.Text = d1.q4; b2c5.Text = d1.q5; b2c6.Text = d1.q6; b2c7.Text = d1.q7; b2c8.Text = d1.q8; b2c9.Text = d1.q9; b2c10.Text = d1.q10; b2c11.Text = d1.q11; b2c12.Text = d1.q12; b2c13.Text = d1.q13; b2c14.Text = d1.q14; b2c15.Text = d1.q15; t9.Text = d1.q16; t10.Text = d1.q17; t11.Text = d1.q18; t12.Text = d1.q19; b2c16.Text = d1.q20; b2c17.Text = d1.q21; b2c18.Text = d1.q22; b2c19.Text = d1.q23; b2c20.Text = d1.q24; b2c21.Text = d1.q25; textBox3.Text = d1.col1; } } if (groupBox5.Enabled == true) { PSP_LineData d1 = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox5.Tag.ToString()); //d1.UID = groupBox5.Tag.ToString(); if (d1 != null) { b3c1.Text = d1.q1; b3c2.Text = d1.q2; b3c3.Text = d1.q3; b3c4.Text = d1.q4; b3c5.Text = d1.q5; b3c6.Text = d1.q6; b3c7.Text = d1.q7; b3c8.Text = d1.q8; b3c9.Text = d1.q9; b3c10.Text = d1.q10; b3c11.Text = d1.q11; b3c12.Text = d1.q12; b3c13.Text = d1.q13; b3c14.Text = d1.q14; b3c15.Text = d1.q15; t13.Text = d1.q16; t14.Text = d1.q17; t15.Text = d1.q18; t16.Text = d1.q19; b3c16.Text = d1.q20; b3c17.Text = d1.q21; b3c18.Text = d1.q22; b3c19.Text = d1.q23; b3c20.Text = d1.q24; b3c21.Text = d1.q25; textBox4.Text = d1.col1; } } if (groupBox6.Enabled == true) { PSP_LineData d1 = Services.BaseService.GetOneByKey <PSP_LineData>(groupBox6.Tag.ToString()); // d1.UID = groupBox6.Tag.ToString(); if (d1 != null) { b4c1.Text = d1.q1; b4c2.Text = d1.q2; b4c3.Text = d1.q3; b4c4.Text = d1.q4; b4c5.Text = d1.q5; b4c6.Text = d1.q6; b4c7.Text = d1.q7; b4c8.Text = d1.q8; b4c9.Text = d1.q9; b4c10.Text = d1.q10; b4c11.Text = d1.q11; b4c12.Text = d1.q12; b4c13.Text = d1.q13; b4c14.Text = d1.q14; b4c15.Text = d1.q15; t17.Text = d1.q16; t18.Text = d1.q17; t19.Text = d1.q18; t20.Text = d1.q19; b4c16.Text = d1.q20; b4c17.Text = d1.q21; b4c18.Text = d1.q22; b4c19.Text = d1.q23; b4c20.Text = d1.q24; b4c21.Text = d1.q25; textBox5.Text = d1.col1; } } }