示例#1
0
 async public Task updateDevice(val v1)
 {
     using var cmd   = Db.Connection.CreateCommand();
     cmd.CommandText = "updatedevice";
     cmd.CommandType = CommandType.StoredProcedure;
     BindDeviceput(cmd, v1);
     await cmd.ExecuteNonQueryAsync();
 }
示例#2
0
 async public Task addDevice(val v)
 {
     using var cmd   = Db.Connection.CreateCommand();
     cmd.CommandText = "insertdevice";
     cmd.CommandType = CommandType.StoredProcedure;
     BindDevice(cmd, v);
     await cmd.ExecuteNonQueryAsync();
 }
示例#3
0
 private void BindDevice(MySqlCommand cmd, val v)
 {
     cmd.Parameters.Add(new MySqlParameter("device_type_id", v.device_type_id));
     cmd.Parameters.Add(new MySqlParameter("device_brand_id", v.device_brand_id));
     cmd.Parameters.Add(new MySqlParameter("model", v.model));
     cmd.Parameters.Add(new MySqlParameter("color", v.color));
     cmd.Parameters.Add(new MySqlParameter("price", v.price));
     cmd.Parameters.Add(new MySqlParameter("serial_number", v.serial_number));
     cmd.Parameters.Add(new MySqlParameter("warranty_year", v.warranty_year));
     cmd.Parameters.Add(new MySqlParameter("purchase_date", v.purchase_date));
     cmd.Parameters.Add(new MySqlParameter("status_id", v.status_id));
     cmd.Parameters.Add(new MySqlParameter("specification_id", v.specification_id));
     cmd.Parameters.Add(new MySqlParameter("entry_date", v.entry_date));
 }