public static int CPHWInsert(Model.CPHW ch) { SqlHelper.connectionStr = GetSQLConnect(); string sqlstr = "INSERT INTO WMS_CPHW (ID,GoodName,StoreName,Finalize,FLAG) VALUES ('" + ch.Id + "','" + ch.GoodName + "','" + ch.StoreName + "','',0)"; try { SqlHelper.ExecCommand(sqlstr); return(0); } catch { return(-1); } }
//成品货位保存 private void simpleButton2_Click(object sender, EventArgs e) { if (CheckDataIntegrity1() == true) { Model.CPHW ch = new Model.CPHW(); ch.Id = Guid.NewGuid().ToString(); ch.GoodName = textBox5.Text; ch.StoreName = textBox3.Text; if (SQL.SqlExecute.CPHWInsert(ch) == 0) { MessageBox.Show("保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("保存失败", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("所填数据必须为非空", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error); } }