Hello all nice coders :) i have a question about a function i have that uses an class as input. hmm prob easier to explain after i show some code!
class customer
{
public string number, name, phone;
public void newcustomer(customer custom)
{
//write to a database
//using the strings above
}
}
public partial class Form1 : Form
{
customer Kund = new customerr();
kund.number="123";
kund.name="AB";
kund.phone="0604343";
customer.newcustomer(customer);
}
ok so now i input the class and it does its job without problem
but!
cant you do something with the function so it has to take for example "name + phone" to be able to create the customer and "number" can be optional
so i cant create blank customers or just a customer with just an phonenumber
is this possible to make in the function or other i guess i can do an if (kund.number!="") and stuff like that but it seems like not a good way to go
thank you for answers :)