Exemplo n.º 1
0
 public FrmStaff(Guid?id = null)
 {
     InitializeComponent();
     if (id != null)
     {
         getId = Guid.Parse(id.ToString());
         DataTable dt = StaffDao.GetStaffById(getId);
         if (dt != null)
         {
             txtName.Text      = dt.Rows[0]["Name"].ToString();
             txtSalary.Text    = dt.Rows[0]["Salary"].ToString();
             dtpHireDate.Value = DateTime.Parse(dt.Rows[0]["HireDate"].ToString());
             dtpStopDate.Value = DateTime.Parse(dt.Rows[0]["StopDate"].ToString());
             pic = StaffDao.GetPhoto(getId);
             if (pic != null)
             {
                 picStaff.Image = Helpers.ByteArrayToImage(pic);
             }
         }
     }
 }