78 lines
2.4 KiB
C#
78 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Datalib.EntityClasses;
|
|
using Datalib.HelperClasses;
|
|
using Datalib.Linq;
|
|
using System.Linq;
|
|
using SD.LLBLGen.Pro.ORMSupportClasses;
|
|
|
|
|
|
namespace PatientMan.Forms
|
|
{
|
|
public partial class frmPreClinics : PatientMan.BasicForms.frmCommon
|
|
{
|
|
public EntityCollection <TblPreClinicsInfoEntity> PreClinics = new EntityCollection <TblPreClinicsInfoEntity>();
|
|
public frmPreClinics()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void frmPreClinics_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
|
|
|
|
LinqMetaData MetaData = new LinqMetaData();
|
|
MetaData.AdapterToUse = adapter;
|
|
var tests = (from q in MetaData.TblTest select new { q.Testid, TestName = SettingInfo.Language == 0 ? q.VTestName : q.ETestName }).ToList();
|
|
var Patients = (from q in MetaData.TblPatient select new { q.PatientId, PatientName = strUtil.Decrypt(q.PatientName) }).ToList();
|
|
|
|
|
|
|
|
_test.DataSource = tests;
|
|
|
|
_Patients.DataSource = Patients;
|
|
|
|
adapter.FetchEntityCollection(PreClinics, null);
|
|
LoadData();
|
|
}
|
|
|
|
public override void LoadData()
|
|
{
|
|
usrPreClinicInfo.PreClinicsInfos = PreClinics;
|
|
grdPreClinicInfo.DataSource = PreClinics;
|
|
usrPreClinicInfo.BindingData();
|
|
usrPreClinicInfo.LoadLibrary();
|
|
}
|
|
|
|
|
|
private void gridview_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
if (PreClinics.Count == 0)
|
|
{
|
|
return;
|
|
}
|
|
var PatientId = PreClinics[BindingContext[PreClinics].Position].PatientId;
|
|
var frm = new frmPatientInfo();
|
|
frm.PatientsCollection = new EntityCollection<TblPatientEntity>();
|
|
var PatientInfo = new TblPatientEntity(PatientId);
|
|
adapter.FetchEntity(PatientInfo);
|
|
frm.PatientsCollection.Add(PatientInfo);
|
|
frm.PatientInfo = PatientInfo;
|
|
frm.LoadData();
|
|
frm.gotoPreclinic();
|
|
frm.ShowDialog();
|
|
}
|
|
|
|
private void Print_Click(object sender, EventArgs e)
|
|
{
|
|
grdPreClinicInfo.ShowPrintPreview();
|
|
}
|
|
|
|
private void barPrint_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
{
|
|
grdPreClinicInfo.ShowPrintPreview();
|
|
}
|
|
}
|
|
}
|