Skip to content

Instantly share code, notes, and snippets.

@Cellane
Created November 15, 2012 08:30
Show Gist options
  • Save Cellane/4077390 to your computer and use it in GitHub Desktop.
Save Cellane/4077390 to your computer and use it in GitHub Desktop.
if (materialDataForm.ShowDialog() == DialogResult.OK)
{
MaterialController materialController = new MaterialController();
ErrorList errors;
int code = (int)materialDataForm.numCode.Value;
string name = materialDataForm.txtName.Text;
float amount = (float)materialDataForm.numAmount.Value;
string unit = materialDataForm.cbUnit.Text;
decimal price = materialDataForm.numPrice.Value;
errors = materialController.Add(code, name, amount, unit, price);
if (errors.IsEmpty())
{
materialDataForm.Close();
}
else
{
MessageBox.Show(errors.ToString());
}
}
else
{
materialDataForm.Close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment