}//删除驾照信息 public static bool AddPlate(plate p) { db0.open(); string sql = "select * from [Linfo] where [llicenseno]='@no'"; using (db0.sqlc) { SqlCommand cmd = new SqlCommand(sql, db0.sqlc); SqlParameter[] sp = new SqlParameter[] { new SqlParameter("no", p.Carno), new SqlParameter("ifm", p.Ifmaster), new SqlParameter("type", p.Type), new SqlParameter("st", p.State.ToString()), new SqlParameter("own", p.Owner) }; if (!cmd.ExecuteScalar().ToString().Equals(string.Empty)) { return(false); } else { sql = "insert [Linfo] values ('@no',@ifm,'@type',@st,'@own')"; cmd.CommandText = sql; cmd.ExecuteNonQuery(); return(true); } } }//号牌登记
}//驾照补换登记 public static bool RegisterPlate(plate p) { db0.open(); using (db0.sqlc) { string sql = "update [Linfo] set [state]='@state' where [llicenseno]='@id'"; SqlCommand cmd0 = new SqlCommand(sql, db0.sqlc); SqlParameter[] sp = new SqlParameter[] { new SqlParameter("id", p.Carno), new SqlParameter("state", p.State) }; cmd.Parameters.Add(sp); if (cmd0.ExecuteNonQuery() != 0) { return(true); } else { return(false); } } }//号牌补换登记