private void upDate(CheckBox checkbox) { if (checkbox.Checked) { SQLClass.getsqlcom("update v set v_static = 'true' where v_vid = '" + checkbox.Tag + "'"); } else { SQLClass.getsqlcom("update v set v_static = 'false' where v_vid = '" + checkbox.Tag + "'"); } }
private void btn_ok_Click(object sender, EventArgs e) { switch (Form_Type) { case 0: SQLClass.getsqlcom("update measure set measure_text = '" + txt_measure_text.Text.ToString().Trim() + "' where measure_id = '" + data_id + "'"); break; case 1: SQLClass.getsqlcom("update measure set measure_text = '" + txt_measure_text.Text.ToString().Trim() + "', measure_state = '2' where measure_id = '" + data_id + "'"); break; case 2: break; } Form_OK = 1; this.Close(); }
private void btn_ok_Click(object sender, EventArgs e) { if (Convert.ToString(txt_measure_data.Tag) == "1") { StateClass stateclass = new StateClass(); int state = stateclass.UpdateMeasure(Convert.ToSingle(txt_measure_data.Text), Convert.ToInt32(cBox_measure_process.Tag)); switch (Form_Type) { case 0: SQLClass.getsqlcom("insert into measure values ('" + txt_measure_data.Text.ToString().Trim() + "','" + cBox_measure_machine.Tag.ToString() + "','" + cBox_measure_process.Tag.ToString() + "','" + state + "','','" + DateTime.Now + "')"); break; case 1: SQLClass.getsqlcom("update measure set measure_data = '" + txt_measure_data.Text.ToString().Trim() + "', measure_machine = '" + cBox_measure_machine.Tag.ToString() + "', measure_process = '" + cBox_measure_process.Tag.ToString() + "', measure_state = '" + state + "' where measure_id = '" + data_id + "'"); break; case 2: break; } Form_OK = 1; this.Close(); } }
public void UpdateProcess(int measure_id, float measure, string ucl, string lcl) { if (ucl == "" && lcl == "") { state = 3; } else if (ucl == "") { float process_lcl = Convert.ToSingle(lcl); if (measure >= process_lcl) { state = 3; } else { state = 0; } } else if (lcl == "") { float process_ucl = Convert.ToSingle(ucl); if (measure <= process_ucl) { state = 3; } else { state = 0; } } else { float process_ucl = Convert.ToSingle(ucl); float process_lcl = Convert.ToSingle(lcl); if (measure >= process_lcl && measure <= process_ucl) { state = 3; } else { state = 0; } } SQLClass.getsqlcom("update measure set measure_state = '" + state + "' where measure_id = '" + measure_id + "'"); }