public virtual ExpertAttachmentContainer SelectChildrenByAttachmentOfExpert(DBGuid IDVal) { TraceCallEnterEvent.Raise(); try { ExpertAttachmentContainer result; DataSet entitySet = m_DataContext.ndihdAttachmentOfExpertSelectBy(IDVal); result = new ExpertAttachmentContainer(entitySet.Tables[0]); TraceCallReturnEvent.Raise(); return result; } catch (Exception ex) { ExceptionManager.Publish(ex); TraceCallReturnEvent.Raise(false); throw; } }
public virtual ExpertAttachmentContainer ExpertAttachmentSelectAll() { TraceCallEnterEvent.Raise(); try { ExpertAttachmentContainer result; DataSet entitySet = m_DataContext.ndihdExpertAttachmentSelectAll(); result = new ExpertAttachmentContainer(entitySet.Tables[0]); TraceCallReturnEvent.Raise(); return result; } catch (Exception ex) { ExceptionManager.Publish(ex); TraceCallReturnEvent.Raise(false); throw; } }
// ------------------------------------------------------------------------------------- /// <summary> /// fill edit window controls /// </summary> // ------------------------------------------------------------------------------------- private void RetrieveData() { try { // Get data IExpertService expSrv = ServiceFactory.GetExpertService(); Expert exp = expSrv.ExpertSelect(CurrentID); IExpertAttachmentService attSrv = ServiceFactory.GetExpertAttachmentService(); // Fill the controls txtName.Text = exp.Name; txtNamePrefix.Text = exp.NamePrefix; txtPhone1.Text = exp.Phone1; txtPhone2.Text = exp.Phone2; txtPhone3.Text = exp.Phone3; txtFax.Text = exp.Fax; txtEmail1.Text = exp.Email1; txtEmail2.Text = exp.Email2; txtEmail3.Text = exp.Email3; txtPostCode.Text = exp.PostCode; txtCity.Text = exp.City; txtAddress.Text = exp.Address; txtAddressInstitute.Text = exp.AddressInstitute; txtJob.Text = exp.Job; cmbQualification.SelectedValue = exp.QualificationRef.ToString(); txtGraduation.Text = exp.Graduation; txtProfession.Text = exp.Profession; txtActivity.Text = exp.Activity; txtPublications.Text = exp.Publications; txtBiography.Text = exp.Biography; cbxActivate.Checked = exp.IsActive; ExpertAttachmentContainer avaiableFiles = new ExpertAttachmentContainer(); foreach (ExpertAttachment file in m_currentExpert.ExpertAttachments.All) { ExpertAttachment oldFile = attSrv.ExpertAttachmentSelectFile(file.ID); if (oldFile.FileData != null && oldFile.FileData.Length > 0) { file.FileData = oldFile.FileData; file.FileSize = oldFile.FileSize; if (!avaiableFiles.All.Items.Contains(file)) { avaiableFiles.Add(file); } } } m_currentExpert.ExpertAttachments = avaiableFiles; FillFileDatagrid(DBGuid.Null); } catch (Exception ex) { // --- Log exception ExceptionManager.Publish(ex); // --- Display Exception ErrorHandler.DisplayError("Hiba lépett fel az adatok lekérdezése során", ex); // --- invisible btnOk button btnOk.Visible = false; } }