using System; using System.Collections.Generic; using Datalib.EntityClasses; using Datalib.HelperClasses; using Datalib.RelationClasses; using Datalib.DatabaseSpecific; using System.Linq; using Datalib.Linq; using SD.LLBLGen.Pro.ORMSupportClasses; namespace PatientMan.Forms { public partial class frmClinics : PatientMan.BasicForms.frmCommon { public EntityCollection ClinicInfos = new EntityCollection(); public frmClinics() { InitializeComponent(); } private void frmClinics_Load(object sender, EventArgs e) { var pro = new EntityCollection(); var Agency = new EntityCollection(); var regimen = new EntityCollection(); var tests = new EntityCollection(); var treatments = new EntityCollection(); var Patients = new EntityCollection(); adapter.FetchEntityCollection(pro, null); adapter.FetchEntityCollection(Agency, null); adapter.FetchEntityCollection(regimen, null); adapter.FetchEntityCollection(tests, null); adapter.FetchEntityCollection(treatments, null); adapter.FetchEntityCollection(Patients, null); _province.DataSource = pro; _AgencyType.DataSource = Agency; _regimen.DataSource = regimen; _test.DataSource = tests; _treatment.DataSource = treatments; _Patients.DataSource = Patients.Select(q => new { q.PatientId, PatientName = strUtil.Decrypt(q.PatientName) }).ToList(); RelationPredicateBucket filter = new RelationPredicateBucket(); ; filter.PredicateExpression.Add(TblExaminationInfoFields.IsClinic == 1); adapter.FetchEntityCollection(ClinicInfos, filter); LoadData(); } public override void LoadData() { usrClinlicInfo.ClinicInfos = ClinicInfos; grdClinicInfo.DataSource = ClinicInfos; usrClinlicInfo.BindingData(); usrClinlicInfo.LoadLibrary(); } private void gridView_DoubleClick(object sender, EventArgs e) { if (ClinicInfos.Count == 0) { return; } var PatientId = ClinicInfos[BindingContext[ClinicInfos].Position].PatientId; var frm = new frmPatientInfo(); frm.PatientsCollection = new EntityCollection(); var PatientInfo = new TblPatientEntity(PatientId); adapter.FetchEntity(PatientInfo); frm.PatientsCollection.Add(PatientInfo); frm.PatientInfo = PatientInfo; frm.LoadData(); frm.gotoClinic(); frm.ShowDialog(); } private void Print_Click(object sender, EventArgs e) { } private void View_Click(object sender, EventArgs e) { } private void barPrint_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { grdClinicInfo.ShowRibbonPrintPreview(); } } }