コード例 #1
0
        private void ShowData()
        {
            Employee emp = blObjct.SelectEmployee(EmpId);


            txt_code.Text              = emp.EmpCode;
            txt_Name.Text              = emp.EmpName;
            txt_fatherName.Text        = emp.FatherName;
            txt_address.Text           = emp.Address;
            txt_phon.Text              = emp.PhoneNo;
            txt_nationality.Text       = emp.Nationality;
            cbGender.Text              = emp.Gender;
            txt_maritalStatus.Text     = emp.MaritalStatus;
            dtpDob.Text                = Convert.ToString(emp.DateOfBirth);
            txt_PassportNo.Text        = emp.PassportNo;
            dtpPasprtExpryDate.Text    = Convert.ToString(emp.PassportExpiryDate);
            txt_LabrCrdNo.Text         = emp.LabourCardNo;
            dtpLbrCrdExpryDate.Text    = Convert.ToString(emp.LabourCardExpiryDate);
            txt_noOchildren.Text       = emp.NoOfChildren;
            cbBloodgrp.Text            = emp.BloodGroup;
            txt_BankAccNo.Text         = emp.BankAccNo;
            txt_BankName.Text          = emp.BankName;
            txt_BankBrach.Text         = emp.BankBranch;
            txt_qlifucation.Text       = emp.Qualification;
            cbYearOfPassing.Text       = Convert.ToString(emp.YearOfPassing);
            txt_percentageOfMarks.Text = emp.PercentageOfMarks;
            txt_university.Text        = emp.University;
            txt_yearOfExperience.Text  = Convert.ToString(emp.YearsOfExperience);
            txt_EmployeeStatus.Text    = emp.EmployeeStatus;

            if (empPhoto.Image != null)
            {
                empPhoto.Image.Dispose();
            }

            MemoryStream stmBLOBData;

            try
            {
                //BLOB is read into Byte array, then used to construct MemoryStream, then passed to PictureBox.
                Byte[] byteBLOBData = new Byte[0];



                stmBLOBData = new MemoryStream(emp.EmpPhoto);

                empPhoto.Image = Image.FromStream(stmBLOBData);
            }
            catch
            { }
            finally
            {
                stmBLOBData = null;
            }

            txt_sponserName.Text  = emp.SponsorName;
            txt_VisaNo.Text       = emp.VisaNo;
            dtpVisaExpryDate.Text = Convert.ToString(emp.VisaExpiryDate);
            txt_AnnualLeave.Text  = Convert.ToString(emp.AnnualLeaveMaturity);
        }