60 lines
1.4 KiB
C#
60 lines
1.4 KiB
C#
|
namespace LDBproject.AdditionalForms;
|
|||
|
|
|||
|
public partial class EmployeeF : Form
|
|||
|
{
|
|||
|
private int? _librarianID;
|
|||
|
|
|||
|
public EmployeeF()
|
|||
|
{
|
|||
|
InitializeComponent();
|
|||
|
}
|
|||
|
|
|||
|
public int ID
|
|||
|
{
|
|||
|
set
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
_librarianID = value;
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
MessageBox.Show(ex.Message, "EmployeeF [ Error : while setting ID ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void SaveBtn_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
if (string.IsNullOrWhiteSpace(FIOEnterTb.Text)
|
|||
|
|| GenresCheckedBL.CheckedItems.Count == 0)
|
|||
|
{
|
|||
|
throw new Exception("EmployeeF [ Blank spaces were left, not enough information ]");
|
|||
|
}
|
|||
|
|
|||
|
if (_librarianID.HasValue)
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
Close();
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
MessageBox.Show(ex.Message, "EmployeeF [ Error : while saving data ]",
|
|||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void CancelBtn_Click(object sender, EventArgs e) => Close();
|
|||
|
|
|||
|
private object CreateWorker(int id) { return null; }
|
|||
|
}
|
|||
|
|