private void button1_Click(object sender, EventArgs e) { string SteelMaterials = textBox1.Text; string StrrlRole = textBox2.Text; int SteelCount = Convert.ToInt32(textBox3.Text); string MeasureUnit = comboBox1.Text; string PeopleSteel = comboBox2.Text; SteelMater steels = new SteelMater(); steels.SteelMaterials = SteelMaterials; steels.SteelRole = StrrlRole; steels.SteelCount = SteelCount; steels.MeasureUnit = MeasureUnit; steels.PeopleSteel = PeopleSteel; var d = dal.Add(steels); if (d > 0) { this.Close(); ShowSteels(); } else { MessageBox.Show("请重新添加订单"); } }
public int Update(SteelMater s) { string sql = $"update SteelMater set SteelMaterials='{s.SteelMaterials}',SteelRole='{s.SteelRole}',SteelCount='{s.SteelCount}',MeasureUnit='{s.MeasureUnit}',PeopleSteel='{s.PeopleSteel}'"; return(DBHelper.ExecuteNonQuery(sql)); }
public int Add(SteelMater steel) { string sql = $"insert into SteelMater values('{steel.SteelMaterials}','{steel.SteelRole}','{steel.SteelCount}','{steel.MeasureUnit}','{steel.PeopleSteel}')"; return(DBHelper.ExecuteNonQuery(sql)); }