60 lines
1.3 KiB
C#
Raw Normal View History

2024-12-20 20:09:17 +04:00
namespace LDBproject.AdditionalForms;
public partial class CustomerF : Form
{
private int? _custID;
public CustomerF()
{
InitializeComponent();
}
public int ID
{
set
{
try
{
_custID = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "CustomerF [ Error : wrong data ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
private void SaveBtn_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(FIOEnterTb.Text)
|| BirthdayDTPicker.Value.Year < 1940)
{
throw new Exception("CustomerF [ Blank spaces were left, not enough information ]");
}
if (_custID.HasValue)
{
}
else
{
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "CustomerF [ Error : while saving ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void CancelBtn_Click(object sender, EventArgs e) => Close();
private object CreateCustomer(int id) { return null; }
}