1 Star 0 Fork 0

qinix/SangyMed

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
U_Main.pas 73.11 KB
一键复制 编辑 原始数据 按行查看 历史
MrGreen7 提交于 2018-04-24 18:12 . Date : 09/06/1439
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467
unit U_Main;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes,
System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, U_Base_Form,
FMX.TabControl, FMX.TreeView, FMX.Layouts, FMX.Controls.Presentation,
FMX.StdCtrls, FMX.Objects, FMX.Ani, FMX.Effects, Data.Bind.EngExt,
FMX.Bind.DBEngExt, System.Rtti, System.Bindings.Outputs, Data.Bind.Components,
Data.Bind.DBScope, Data.Bind.Grid, U_Frame_Principale, U_Frame_Serologie,
U_Frame_Biochimic, U_Frame_Hemostase, U_Frame_Hemogramme, U_Frame_Information,
FMX.Edit, U_Frame_Ordonnance, FMX.Menus, FMX.Grid.Style, FMX.ScrollBox,
FMX.Grid, FMX.Bind.Grid, FMX.Bind.Editors, FireDAC.Stan.Def,
FireDAC.FMXUI.Wait, FireDAC.Phys.SQLiteWrapper, FireDAC.Stan.Intf,
FireDAC.Phys, FireDAC.Phys.SQLite, FMX.ListBox, FMX.DateTimeCtrls,
FireDAC.UI.Intf, FireDAC.Comp.UI;
type
TMain = class(TBase_Form)
ListT: TTabControl;
Medical: TTabItem;
Panel5: TPanel;
TreeView1: TTreeView;
T_Accueil: TTreeViewItem;
T_Patient: TTreeViewItem;
Patient_Recherche: TTreeViewItem;
New_Patient: TTreeViewItem;
T_RDV: TTreeViewItem;
HeaderT: TTabControl;
H_Accueil: TTabItem;
Panel4: TPanel;
Layout6: TLayout;
Layout22: TLayout;
Label5: TLabel;
ShadowEffect7: TShadowEffect;
Label8: TLabel;
Label4: TLabel;
ShadowEffect9: TShadowEffect;
ColorAnimation2: TColorAnimation;
Layout24: TLayout;
Label11: TLabel;
ShadowEffect6: TShadowEffect;
Label14: TLabel;
Label10: TLabel;
ShadowEffect3: TShadowEffect;
ColorAnimation5: TColorAnimation;
Layout25: TLayout;
Label2: TLabel;
ShadowEffect2: TShadowEffect;
Label3: TLabel;
Label1: TLabel;
ShadowEffect1: TShadowEffect;
ColorAnimation1: TColorAnimation;
Line6: TLine;
Line7: TLine;
Line8: TLine;
Line9: TLine;
Layout23: TLayout;
Label12: TLabel;
ShadowEffect12: TShadowEffect;
ColorAnimation4: TColorAnimation;
Label13: TLabel;
ShadowEffect13: TShadowEffect;
Label7: TLabel;
ShadowEffect5: TShadowEffect;
Label9: TLabel;
Line1: TLine;
Label6: TLabel;
ShadowEffect4: TShadowEffect;
ColorAnimation3: TColorAnimation;
H_Editeur: TTabItem;
Panel6: TPanel;
Layout26: TLayout;
Layout33: TLayout;
Label70: TLabel;
ShadowEffect58: TShadowEffect;
Label71: TLabel;
ColorAnimation34: TColorAnimation;
ShadowEffect59: TShadowEffect;
Layout34: TLayout;
Label72: TLabel;
ShadowEffect60: TShadowEffect;
Label73: TLabel;
ShadowEffect61: TShadowEffect;
ColorAnimation35: TColorAnimation;
Line17: TLine;
Line18: TLine;
Layout35: TLayout;
Label74: TLabel;
ShadowEffect62: TShadowEffect;
Label75: TLabel;
ColorAnimation36: TColorAnimation;
ShadowEffect63: TShadowEffect;
Line16: TLine;
H_Gen_Patient: TTabItem;
Panel10: TPanel;
Layout: TLayout;
Layout_Exit_Patient: TLayout;
Label16: TLabel;
ShadowEffect10: TShadowEffect;
Label15: TLabel;
ColorAnimation6: TColorAnimation;
ShadowEffect8: TShadowEffect;
Layout5: TLayout;
Label28: TLabel;
ShadowEffect19: TShadowEffect;
Label27: TLabel;
ShadowEffect20: TShadowEffect;
ColorAnimation15: TColorAnimation;
Layout7: TLayout;
Label29: TLabel;
ShadowEffect21: TShadowEffect;
Label30: TLabel;
ColorAnimation16: TColorAnimation;
ShadowEffect22: TShadowEffect;
Layout8: TLayout;
Label31: TLabel;
ShadowEffect23: TShadowEffect;
Label64: TLabel;
Label32: TLabel;
ColorAnimation17: TColorAnimation;
ShadowEffect24: TShadowEffect;
Line2: TLine;
Line3: TLine;
Line4: TLine;
Line5: TLine;
Layout18: TLayout;
Label51: TLabel;
ShadowEffect43: TShadowEffect;
Label63: TLabel;
ShadowEffect53: TShadowEffect;
Label66: TLabel;
ShadowEffect56: TShadowEffect;
Label62: TLabel;
ShadowEffect52: TShadowEffect;
Line14: TLine;
Line15: TLine;
Label61: TLabel;
ShadowEffect51: TShadowEffect;
ColorAnimation31: TColorAnimation;
Label65: TLabel;
ShadowEffect55: TShadowEffect;
ColorAnimation33: TColorAnimation;
Label52: TLabel;
ShadowEffect44: TShadowEffect;
ColorAnimation27: TColorAnimation;
Line10: TLine;
H_Gen_RechercheP: TTabItem;
Panel12: TPanel;
Layout29: TLayout;
Layout_Exit_RechercheP: TLayout;
Label17: TLabel;
ShadowEffect11: TShadowEffect;
Label18: TLabel;
ColorAnimation7: TColorAnimation;
ShadowEffect14: TShadowEffect;
Layout15: TLayout;
Label45: TLabel;
ShadowEffect37: TShadowEffect;
Label46: TLabel;
ShadowEffect38: TShadowEffect;
ColorAnimation24: TColorAnimation;
Layout16: TLayout;
Label47: TLabel;
ShadowEffect39: TShadowEffect;
Label48: TLabel;
ColorAnimation25: TColorAnimation;
ShadowEffect40: TShadowEffect;
Layout17: TLayout;
Label50: TLabel;
ShadowEffect42: TShadowEffect;
Label49: TLabel;
ColorAnimation26: TColorAnimation;
ShadowEffect41: TShadowEffect;
Line20: TLine;
Line21: TLine;
Line22: TLine;
Line23: TLine;
H_Gen_NouveauP: TTabItem;
Panel13: TPanel;
Layout30: TLayout;
Layout20: TLayout;
Label56: TLabel;
ShadowEffect48: TShadowEffect;
Label55: TLabel;
ColorAnimation29: TColorAnimation;
ShadowEffect47: TShadowEffect;
Layout3: TLayout;
Label19: TLabel;
ShadowEffect15: TShadowEffect;
Label20: TLabel;
ColorAnimation8: TColorAnimation;
ShadowEffect16: TShadowEffect;
Layout19: TLayout;
Label53: TLabel;
ShadowEffect45: TShadowEffect;
Label54: TLabel;
ColorAnimation28: TColorAnimation;
ShadowEffect46: TShadowEffect;
Line11: TLine;
Line12: TLine;
Line13: TLine;
MainT: TTabControl;
P_Accueil: TTabItem;
L_Left_P_Accueil: TLayout;
GrouBox1_Table: TGroupBox;
Label_Refresh1: TLabel;
ColorAnimation10: TColorAnimation;
FloatAnimation1: TFloatAnimation;
GrouBox3_Table: TGroupBox;
Label_Refresh3: TLabel;
ColorAnimation12: TColorAnimation;
FloatAnimation3: TFloatAnimation;
L_Right_P_Accueil: TLayout;
GrouBox2_Table: TGroupBox;
Label_Refresh2: TLabel;
ColorAnimation11: TColorAnimation;
FloatAnimation2: TFloatAnimation;
GrouBox4_Table: TGroupBox;
Label_Refresh4: TLabel;
ColorAnimation13: TColorAnimation;
FloatAnimation4: TFloatAnimation;
Patient: TTabItem;
StatusBar1: TStatusBar;
Label26: TLabel;
Label59: TLabel;
Label60: TLabel;
Status_Edit1: TEdit;
Status_Edit2: TEdit;
Status_Edit3: TEdit;
Refresh_Patient_Table: TLabel;
ColorAnimation14: TColorAnimation;
FloatAnimation5: TFloatAnimation;
Recherche_Patient: TTabItem;
Layout1: TLayout;
Layout2: TLayout;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
RB_Nom: TRadioButton;
RB_Prenom: TRadioButton;
GroupBox3: TGroupBox;
RB_Interne: TRadioButton;
RB_Externe: TRadioButton;
Label76: TLabel;
GroupBox4: TGroupBox;
Layout31: TLayout;
Edit_Recherche: TEdit;
Nouveau_Patient: TTabItem;
TabControl_NouveauP: TTabControl;
TabItem1: TTabItem;
Frame_Information: TFrame2;
TabItem2: TTabItem;
Frame_Hemogramme: TFrame3;
TabItem3: TTabItem;
Frame_Hemostase: TFrame4;
TabItem4: TTabItem;
Frame_Biochimic: TFrame6;
TabItem5: TTabItem;
Frame_Serologie: TFrame5;
Frame_Principale: TFrame1;
Edit_Patient: TTabItem;
Frame_EP_Principale: TFrame1;
TabControl1: TTabControl;
TabItem8: TTabItem;
Frame_EP_Information: TFrame2;
TabItem9: TTabItem;
Frame_EP_Hemogramme: TFrame3;
TabItem10: TTabItem;
Frame_EP_Hemostase: TFrame4;
TabItem11: TTabItem;
Frame_EP_Biochimic: TFrame6;
TabItem12: TTabItem;
Frame_EP_Serologie: TFrame5;
PopupMenu1: TPopupMenu;
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
StringGrid3: TStringGrid;
StringGrid4: TStringGrid;
StringGrid5: TStringGrid;
StringGrid6: TStringGrid;
BindSourceDB1: TBindSourceDB;
BindingsList1: TBindingsList;
LinkGridToDataSourceBindSourceDB1: TLinkGridToDataSource;
BindSourceDB2: TBindSourceDB;
LinkGridToDataSourceBindSourceDB2: TLinkGridToDataSource;
BindSourceDB3: TBindSourceDB;
LinkGridToDataSourceBindSourceDB3: TLinkGridToDataSource;
PoP_Hemogramme: TMenuItem;
PoP_Biochimic: TMenuItem;
PoP_Serologie: TMenuItem;
PoP_Hemostase: TMenuItem;
Label23: TLabel;
PopupMenu2: TPopupMenu;
PoP2_Hemog: TMenuItem;
PoP2_Hemos: TMenuItem;
PoP2_Boi: TMenuItem;
PoP2_Serologie: TMenuItem;
BindSourceDB4: TBindSourceDB;
LinkGridToDataSourceBindSourceDB4: TLinkGridToDataSource;
Layout4: TLayout;
Label21: TLabel;
ShadowEffect17: TShadowEffect;
Label223: TLabel;
ColorAnimation9: TColorAnimation;
ShadowEffect18: TShadowEffect;
BindSourceDB5: TBindSourceDB;
LinkGridToDataSourceBindSourceDB5: TLinkGridToDataSource;
BindSourceDB6: TBindSourceDB;
LinkGridToDataSourceBindSourceDB6: TLinkGridToDataSource;
Layout9: TLayout;
Label22: TLabel;
FDGUIxWaitCursor1: TFDGUIxWaitCursor;
SaveDialog1: TSaveDialog;
Layout10: TLayout;
Layout11: TLayout;
Layout12: TLayout;
Edit_Search_Wilaya: TEdit;
Edit_Search_Commune: TEdit;
Edit2: TEdit;
Layout13: TLayout;
Rectangle1: TRectangle;
Rectangle2: TRectangle;
Layout14: TLayout;
Label24: TLabel;
ShadowEffect25: TShadowEffect;
Label25: TLabel;
ColorAnimation18: TColorAnimation;
ShadowEffect26: TShadowEffect;
Line19: TLine;
Line24: TLine;
Layout21: TLayout;
Label33: TLabel;
ShadowEffect27: TShadowEffect;
Label34: TLabel;
ColorAnimation19: TColorAnimation;
ShadowEffect28: TShadowEffect;
Line25: TLine;
procedure FormShow(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormCreate(Sender: TObject);
procedure FormPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF);
procedure Label12Click(Sender: TObject);
procedure Label4Click(Sender: TObject);
procedure Label1Click(Sender: TObject);
procedure Label6Click(Sender: TObject);
procedure T_AccueilClick(Sender: TObject);
procedure T_PatientClick(Sender: TObject);
procedure Patient_RechercheClick(Sender: TObject);
procedure New_PatientClick(Sender: TObject);
procedure T_RDVClick(Sender: TObject);
procedure P_AccueilClick(Sender: TObject);
procedure PatientClick(Sender: TObject);
procedure Recherche_PatientClick(Sender: TObject);
procedure Nouveau_PatientClick(Sender: TObject);
procedure RDVClick(Sender: TObject);
procedure OrdonnanceClick(Sender: TObject);
procedure Label52Click(Sender: TObject);
procedure Label65Click(Sender: TObject);
procedure Label61Click(Sender: TObject);
procedure Label30Click(Sender: TObject);
procedure Label15Click(Sender: TObject);
procedure Label32Click(Sender: TObject);
procedure Label223Click(Sender: TObject);
procedure Label48Click(Sender: TObject);
procedure Label18Click(Sender: TObject);
procedure Label55Click(Sender: TObject);
procedure Frame_PrincipaleButton1Click(Sender: TObject);
procedure Label54Click(Sender: TObject);
procedure Label20Click(Sender: TObject);
procedure Frame_EP_PrincipaleButton1Click(Sender: TObject);
procedure Frame_EP_PrincipaleButton3Click(Sender: TObject);
procedure Frame_EP_PrincipaleButton2Click(Sender: TObject);
procedure Frame_PrincipaleButton2Click(Sender: TObject);
procedure FloatAnimation2Finish(Sender: TObject);
procedure FloatAnimation4Finish(Sender: TObject);
procedure FloatAnimation5Finish(Sender: TObject);
procedure StringGrid5CellClick(const Column: TColumn; const Row: Integer);
procedure StringGrid5CellDblClick(const Column: TColumn;
const Row: Integer);
procedure StringGrid6CellClick(const Column: TColumn; const Row: Integer);
procedure StringGrid6CellDblClick(const Column: TColumn;
const Row: Integer);
procedure FormResize(Sender: TObject);
procedure Nouveau_PatientResize(Sender: TObject);
procedure Edit_PatientResize(Sender: TObject);
procedure P_AccueilResize(Sender: TObject);
procedure Label_Refresh2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure Label_Refresh2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure Label_Refresh4MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure Label_Refresh4MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure Label_Refresh1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure Label_Refresh1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure Label_Refresh3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure Label_Refresh3MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure Refresh_Patient_TableMouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Single);
procedure Label27Click(Sender: TObject);
procedure PoP2_HemosClick(Sender: TObject);
procedure Refresh_Patient_TableMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Single);
procedure PoP2_HemogClick(Sender: TObject);
procedure PoP2_BoiClick(Sender: TObject);
procedure PoP2_SerologieClick(Sender: TObject);
procedure Label71Click(Sender: TObject);
procedure PoP_BiochimicClick(Sender: TObject);
procedure PoP_HemogrammeClick(Sender: TObject);
procedure PoP_HemostaseClick(Sender: TObject);
procedure PoP_SerologieClick(Sender: TObject);
procedure Edit_RechercheChangeTracking(Sender: TObject);
procedure RB_NomChange(Sender: TObject);
procedure RB_PrenomChange(Sender: TObject);
procedure RB_InterneChange(Sender: TObject);
procedure RB_ExterneChange(Sender: TObject);
procedure Label76Click(Sender: TObject);
procedure Edit_Search_WilayaChangeTracking(Sender: TObject);
procedure Edit_Search_CommuneChangeTracking(Sender: TObject);
procedure Edit2ChangeTracking(Sender: TObject);
procedure Label49Click(Sender: TObject);
procedure Label46Click(Sender: TObject);
procedure FloatAnimation1Finish(Sender: TObject);
procedure FloatAnimation3Finish(Sender: TObject);
procedure Label10Click(Sender: TObject);
procedure LoadParam;
procedure Label73Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Label75Click(Sender: TObject);
procedure SaveDialog1TypeChange(Sender: TObject);
procedure Label25Click(Sender: TObject);
procedure Label34Click(Sender: TObject);
procedure MainTDblClick(Sender: TObject);
private
{ Private declarations }
WidthX, HeightX: Integer;
public
{ Public declarations }
Patient_ID, ID_Medecin, Nom: String;
Pass, Privilege: Boolean;
end;
var
Main: TMain;
implementation
Uses
U_Parametre, U_Connecter, U_Entreprise, Winapi.Windows, U_DataModule,
FireDAC.Comp.Client, U_Fenetre, U_Print_HM, U_Print_Bio, U_Print_HS,
U_Print_SR, U_Propre, ShellApi;
{$R *.fmx}
{$R Alg_Res.RES}
procedure LoadFM(const Dlg: TFenetre);
Begin
With Dlg do
Begin
Label2.StyledSettings := Label2.StyledSettings - [TStyledSetting.FontColor];
Label4.StyledSettings := Label4.StyledSettings - [TStyledSetting.FontColor];
Label12.StyledSettings := Label12.StyledSettings -
[TStyledSetting.FontColor];
Label6.StyledSettings := Label6.StyledSettings - [TStyledSetting.FontColor];
Label10.StyledSettings := Label10.StyledSettings -
[TStyledSetting.FontColor];
End;
End;
procedure LoadFP(const Dlg: TFenetre);
Begin
With Dlg do
Begin
Label2.StyledSettings := Label2.StyledSettings + [TStyledSetting.FontColor];
Label4.StyledSettings := Label4.StyledSettings + [TStyledSetting.FontColor];
Label12.StyledSettings := Label12.StyledSettings +
[TStyledSetting.FontColor];
Label6.StyledSettings := Label6.StyledSettings + [TStyledSetting.FontColor];
Label10.StyledSettings := Label10.StyledSettings +
[TStyledSetting.FontColor];
End;
End;
procedure StringGrid5ColResize;
Var
i: Integer;
Begin
With Main do
Begin
for i := 0 to 15 do
Begin
StringGrid5.Columns[i].Width := 120;
if (i = 0) then
StringGrid5.Columns[i].Width := 80;
if (i = 5) then
StringGrid5.Columns[i].Width := 70;
if (i = 6) then
StringGrid5.Columns[i].Width := 70;
End;
for i := 0 to 2 do
Begin
StringGrid1.Columns[i].Width := 140;
StringGrid3.Columns[i].Width := 140;
StringGrid2.Columns[i].Width := 140;
StringGrid4.Columns[i].Width := 140;
End;
End;
End;
procedure Load(Top1, Top2, Top3, Top4: Integer);
Begin
if (Main.Privilege = True) then
Begin
With DataModule1 do
Begin
FDQ_Groupage.Active := False;
FDQ_Patient.Active := False;
FDQ_Patient_Table.Active := False;
FDQ_Homme.Active := False;
FDQ_Femme.Active := False;
FDQ_Groupage.SQl.Clear;
FDQ_Groupage.SQl.Text :=
('Select Nom, Prenom, Groupage From Patient Where Groupage !="Null" ORDER BY Date_de_Entre DESC LIMIT '
+ Top2.ToString + ';');
FDQ_Groupage.Active := True;
// Patient Table
FDQ_Patient.SQl.Clear;
FDQ_Patient.SQl.Text :=
('Select Nom, Prenom,Type From Patient ORDER BY Date_de_Entre DESC LIMIT '
+ Top4.ToString + ';');
FDQ_Patient.Active := True;
// Homme
FDQ_Homme.SQl.Clear;
FDQ_Homme.SQl.Text :=
('Select Nom, Prenom, Date_de_Entre From Patient Where Sexe="Homme" ORDER BY Date_de_Entre DESC LIMIT '
+ Top1.ToString + ';');
FDQ_Homme.Active := True;
// Femme
FDQ_Femme.SQl.Clear;
FDQ_Femme.SQl.Text :=
('Select Nom,Prenom, Date_de_Entre From Patient Where Sexe="Femme" ORDER BY Date_de_Entre DESC LIMIT '
+ Top3.ToString + ';');
FDQ_Femme.Active := True;
// Main patient Table
FDQ_Patient_Table.SQl.Clear;
FDQ_Patient_Table.SQl.Text :=
('Select Patient_ID, Nom, Prenom, Date_de_Nai, Date_de_Entre, Type, Sexe, Etat_Civil, Wilaya, Commune, Adresse, Mobile, Email, Groupage, Telephone, Fax From Patient ;');
FDQ_Patient_Table.Active := True;
End;
End
else
Begin
With DataModule1 do
Begin
FDQ_Groupage.Active := False;
FDQ_Patient.Active := False;
FDQ_Patient_Table.Active := False;
FDQ_Groupage.SQl.Clear;
FDQ_Groupage.SQl.Text :=
('Select Nom, Prenom, Groupage From Patient Where Groupage!="Null" And ID="'
+ Main.ID_Medecin + '" ORDER BY Date_de_Entre DESC LIMIT ' +
Top2.ToString + '0;');
FDQ_Groupage.Active := True;
// Patient Table
FDQ_Patient.SQl.Clear;
FDQ_Patient.SQl.Text := ('Select Nom, Prenom,Type From Patient Where ID="'
+ Main.ID_Medecin + '" ORDER BY Date_de_Entre DESC LIMIT ' +
Top4.ToString + ';');
FDQ_Patient.Active := True;
// Homme
FDQ_Homme.SQl.Clear;
FDQ_Homme.SQl.Text :=
('Select Nom,Prenom, Date_de_Entre From Patient Where Sexe="Homme" And ID="'
+ Main.ID_Medecin + '"ORDER BY Date_de_Entre DESC LIMIT ' +
Top1.ToString + ';');
FDQ_Homme.Active := True;
// Femme
FDQ_Femme.SQl.Clear;
FDQ_Femme.SQl.Text :=
('Select Nom,Prenom, Date_de_Entre From Patient Where Sexe="Femme" And ID="'
+ Main.ID_Medecin + '"ORDER BY Date_de_Entre DESC LIMIT ' +
Top3.ToString + ';');
FDQ_Femme.Active := True;
// Main patient Table
FDQ_Patient_Table.SQl.Clear;
FDQ_Patient_Table.SQl.Text :=
('Select Patient_ID, Nom, Prenom, Date_de_Nai, Date_de_Entre, Type, Sexe, Etat_Civil, Wilaya, Commune, Adresse, Mobile, Email, Groupage, Telephone, Fax From Patient '
+ 'Where ID="' + Main.ID_Medecin +
'" ORDER BY Date_de_Entre DESC LIMIT 10;');
FDQ_Patient_Table.Active := True;
End;
End;
StringGrid5ColResize;
End;
procedure ChangeParaMinus;
Begin
With Main do
Begin
Label25.StyledSettings := Label25.StyledSettings -
[TStyledSetting.FontColor];
Label34.StyledSettings := Label34.StyledSettings -
[TStyledSetting.FontColor];
Label_Refresh1.StyledSettings := Label_Refresh1.StyledSettings -
[TStyledSetting.FontColor];
Label_Refresh2.StyledSettings := Label_Refresh2.StyledSettings -
[TStyledSetting.FontColor];
Label_Refresh3.StyledSettings := Label_Refresh3.StyledSettings -
[TStyledSetting.FontColor];
Label_Refresh4.StyledSettings := Label_Refresh4.StyledSettings -
[TStyledSetting.FontColor];
Label71.StyledSettings := Label71.StyledSettings -
[TStyledSetting.FontColor];
Label75.StyledSettings := Label75.StyledSettings -
[TStyledSetting.FontColor];
Label73.StyledSettings := Label73.StyledSettings -
[TStyledSetting.FontColor];
Label1.StyledSettings := Label1.StyledSettings - [TStyledSetting.FontColor];
Label4.StyledSettings := Label4.StyledSettings - [TStyledSetting.FontColor];
Label6.StyledSettings := Label6.StyledSettings - [TStyledSetting.FontColor];
Label12.StyledSettings := Label12.StyledSettings -
[TStyledSetting.FontColor];
Label10.StyledSettings := Label10.StyledSettings -
[TStyledSetting.FontColor];
Label49.StyledSettings := Label49.StyledSettings -
[TStyledSetting.FontColor];
Label48.StyledSettings := Label48.StyledSettings -
[TStyledSetting.FontColor];
Label46.StyledSettings := Label46.StyledSettings -
[TStyledSetting.FontColor];
Label223.StyledSettings := Label223.StyledSettings -
[TStyledSetting.FontColor];
Label18.StyledSettings := Label18.StyledSettings -
[TStyledSetting.FontColor];
Label52.StyledSettings := Label52.StyledSettings -
[TStyledSetting.FontColor];
Label65.StyledSettings := Label65.StyledSettings -
[TStyledSetting.FontColor];
Label61.StyledSettings := Label61.StyledSettings -
[TStyledSetting.FontColor];
Label32.StyledSettings := Label32.StyledSettings -
[TStyledSetting.FontColor];
Label30.StyledSettings := Label30.StyledSettings -
[TStyledSetting.FontColor];
Label27.StyledSettings := Label27.StyledSettings -
[TStyledSetting.FontColor];
Label55.StyledSettings := Label55.StyledSettings -
[TStyledSetting.FontColor];
Label54.StyledSettings := Label54.StyledSettings -
[TStyledSetting.FontColor];
Label20.StyledSettings := Label20.StyledSettings -
[TStyledSetting.FontColor];
Label15.StyledSettings := Label15.StyledSettings -
[TStyledSetting.FontColor];
//
T_Accueil.StyledSettings := T_Accueil.StyledSettings -
[TStyledSetting.FontColor];
T_Patient.StyledSettings := T_Patient.StyledSettings -
[TStyledSetting.FontColor];
T_RDV.StyledSettings := T_RDV.StyledSettings - [TStyledSetting.FontColor];
Patient_Recherche.StyledSettings := Patient_Recherche.StyledSettings -
[TStyledSetting.FontColor];
New_Patient.StyledSettings := New_Patient.StyledSettings -
[TStyledSetting.FontColor];
//
Edit_Patient.StyledSettings := Edit_Patient.StyledSettings -
[TStyledSetting.FontColor];
Nouveau_Patient.StyledSettings := Nouveau_Patient.StyledSettings -
[TStyledSetting.FontColor];
Patient.StyledSettings := Patient.StyledSettings -
[TStyledSetting.FontColor];
Recherche_Patient.StyledSettings := Recherche_Patient.StyledSettings -
[TStyledSetting.FontColor];
P_Accueil.StyledSettings := P_Accueil.StyledSettings -
[TStyledSetting.FontColor];
//
TabItem1.StyledSettings := TabItem1.StyledSettings -
[TStyledSetting.FontColor];
TabItem2.StyledSettings := TabItem2.StyledSettings -
[TStyledSetting.FontColor];
TabItem3.StyledSettings := TabItem3.StyledSettings -
[TStyledSetting.FontColor];
TabItem4.StyledSettings := TabItem4.StyledSettings -
[TStyledSetting.FontColor];
TabItem5.StyledSettings := TabItem5.StyledSettings -
[TStyledSetting.FontColor];
TabItem8.StyledSettings := TabItem8.StyledSettings -
[TStyledSetting.FontColor];
TabItem9.StyledSettings := TabItem9.StyledSettings -
[TStyledSetting.FontColor];
TabItem10.StyledSettings := TabItem10.StyledSettings -
[TStyledSetting.FontColor];
TabItem11.StyledSettings := TabItem11.StyledSettings -
[TStyledSetting.FontColor];
TabItem12.StyledSettings := TabItem12.StyledSettings -
[TStyledSetting.FontColor];
End;
End;
procedure ChangeParamPlus;
Begin
With Main do
Begin
Label25.StyledSettings := Label25.StyledSettings +
[TStyledSetting.FontColor];
Label34.StyledSettings := Label34.StyledSettings +
[TStyledSetting.FontColor];
Label_Refresh1.StyledSettings := Label_Refresh1.StyledSettings +
[TStyledSetting.FontColor];
Label_Refresh2.StyledSettings := Label_Refresh2.StyledSettings +
[TStyledSetting.FontColor];
Label_Refresh3.StyledSettings := Label_Refresh3.StyledSettings +
[TStyledSetting.FontColor];
Label_Refresh4.StyledSettings := Label_Refresh4.StyledSettings +
[TStyledSetting.FontColor];
Label71.StyledSettings := Label71.StyledSettings +
[TStyledSetting.FontColor];
Label75.StyledSettings := Label75.StyledSettings +
[TStyledSetting.FontColor];
Label73.StyledSettings := Label73.StyledSettings +
[TStyledSetting.FontColor];
Label1.StyledSettings := Label1.StyledSettings + [TStyledSetting.FontColor];
Label4.StyledSettings := Label4.StyledSettings + [TStyledSetting.FontColor];
Label6.StyledSettings := Label6.StyledSettings + [TStyledSetting.FontColor];
Label12.StyledSettings := Label12.StyledSettings +
[TStyledSetting.FontColor];
Label10.StyledSettings := Label10.StyledSettings +
[TStyledSetting.FontColor];
Label49.StyledSettings := Label49.StyledSettings +
[TStyledSetting.FontColor];
Label48.StyledSettings := Label48.StyledSettings +
[TStyledSetting.FontColor];
Label46.StyledSettings := Label46.StyledSettings +
[TStyledSetting.FontColor];
Label223.StyledSettings := Label223.StyledSettings +
[TStyledSetting.FontColor];
Label18.StyledSettings := Label18.StyledSettings +
[TStyledSetting.FontColor];
Label52.StyledSettings := Label52.StyledSettings +
[TStyledSetting.FontColor];
Label65.StyledSettings := Label65.StyledSettings +
[TStyledSetting.FontColor];
Label61.StyledSettings := Label61.StyledSettings +
[TStyledSetting.FontColor];
Label32.StyledSettings := Label32.StyledSettings +
[TStyledSetting.FontColor];
Label30.StyledSettings := Label30.StyledSettings +
[TStyledSetting.FontColor];
Label27.StyledSettings := Label27.StyledSettings +
[TStyledSetting.FontColor];
Label55.StyledSettings := Label55.StyledSettings +
[TStyledSetting.FontColor];
Label54.StyledSettings := Label54.StyledSettings +
[TStyledSetting.FontColor];
Label20.StyledSettings := Label20.StyledSettings +
[TStyledSetting.FontColor];
Label15.StyledSettings := Label15.StyledSettings +
[TStyledSetting.FontColor];
//
T_Accueil.StyledSettings := T_Accueil.StyledSettings +
[TStyledSetting.FontColor];
T_Patient.StyledSettings := T_Patient.StyledSettings +
[TStyledSetting.FontColor];
T_RDV.StyledSettings := T_RDV.StyledSettings + [TStyledSetting.FontColor];
Patient_Recherche.StyledSettings := Patient_Recherche.StyledSettings +
[TStyledSetting.FontColor];
New_Patient.StyledSettings := New_Patient.StyledSettings +
[TStyledSetting.FontColor];
//
Edit_Patient.StyledSettings := Edit_Patient.StyledSettings +
[TStyledSetting.FontColor];
Nouveau_Patient.StyledSettings := Nouveau_Patient.StyledSettings +
[TStyledSetting.FontColor];
Patient.StyledSettings := Patient.StyledSettings +
[TStyledSetting.FontColor];
Recherche_Patient.StyledSettings := Recherche_Patient.StyledSettings +
[TStyledSetting.FontColor];
P_Accueil.StyledSettings := P_Accueil.StyledSettings +
[TStyledSetting.FontColor];
//
TabItem1.StyledSettings := TabItem1.StyledSettings +
[TStyledSetting.FontColor];
TabItem2.StyledSettings := TabItem2.StyledSettings +
[TStyledSetting.FontColor];
TabItem3.StyledSettings := TabItem3.StyledSettings +
[TStyledSetting.FontColor];
TabItem4.StyledSettings := TabItem4.StyledSettings +
[TStyledSetting.FontColor];
TabItem5.StyledSettings := TabItem5.StyledSettings +
[TStyledSetting.FontColor];
TabItem8.StyledSettings := TabItem8.StyledSettings +
[TStyledSetting.FontColor];
TabItem9.StyledSettings := TabItem9.StyledSettings +
[TStyledSetting.FontColor];
TabItem10.StyledSettings := TabItem10.StyledSettings +
[TStyledSetting.FontColor];
TabItem11.StyledSettings := TabItem11.StyledSettings +
[TStyledSetting.FontColor];
TabItem12.StyledSettings := TabItem12.StyledSettings +
[TStyledSetting.FontColor];
End;
end;
procedure ChangeParamP(const Dlg: TParametre);
Begin
With Dlg do
Begin
//
Generale.StyledSettings := Generale.StyledSettings +
[TStyledSetting.FontColor];
TreeViewItem1.StyledSettings := TreeViewItem1.StyledSettings +
[TStyledSetting.FontColor];
TreeViewItem3.StyledSettings := TreeViewItem3.StyledSettings +
[TStyledSetting.FontColor];
//
Tree_Sub_CompteMod.StyledSettings := Tree_Sub_CompteMod.StyledSettings +
[TStyledSetting.FontColor];
Tree_Sub_CompteRem.StyledSettings := Tree_Sub_CompteRem.StyledSettings +
[TStyledSetting.FontColor];
Tree_Sub_Pref.StyledSettings := Tree_Sub_Pref.StyledSettings +
[TStyledSetting.FontColor];
Tree_Sub_Patient.StyledSettings := Tree_Sub_Patient.StyledSettings +
[TStyledSetting.FontColor];
Tree_Sub_PAccueil.StyledSettings := Tree_Sub_PAccueil.StyledSettings +
[TStyledSetting.FontColor];
Tree_Sub_CompteDel.StyledSettings := Tree_Sub_CompteDel.StyledSettings +
[TStyledSetting.FontColor];
End;
End;
procedure ChangeParamM(const Dlg: TParametre);
Begin
With Dlg do
Begin
//
Generale.StyledSettings := Generale.StyledSettings -
[TStyledSetting.FontColor];
TreeViewItem1.StyledSettings := TreeViewItem1.StyledSettings -
[TStyledSetting.FontColor];
TreeViewItem3.StyledSettings := TreeViewItem3.StyledSettings -
[TStyledSetting.FontColor];
//
Tree_Sub_CompteMod.StyledSettings := Tree_Sub_CompteMod.StyledSettings -
[TStyledSetting.FontColor];
Tree_Sub_CompteRem.StyledSettings := Tree_Sub_CompteRem.StyledSettings -
[TStyledSetting.FontColor];
Tree_Sub_Pref.StyledSettings := Tree_Sub_Pref.StyledSettings -
[TStyledSetting.FontColor];
Tree_Sub_Patient.StyledSettings := Tree_Sub_Patient.StyledSettings -
[TStyledSetting.FontColor];
Tree_Sub_PAccueil.StyledSettings := Tree_Sub_PAccueil.StyledSettings -
[TStyledSetting.FontColor];
Tree_Sub_CompteDel.StyledSettings := Tree_Sub_CompteDel.StyledSettings -
[TStyledSetting.FontColor];
End;
End;
function LoadTheme(const Dlg: TForm): Integer;
Var
Theme: Integer;
Begin
With Main do
Begin
With DataModule1.FDQuery1 do
Begin
Active := False;
SQl.Clear;
SQl.Text := ('Select * From Parametre Where ID="' + ID_Medecin + '"');
Active := True;
Open;
Theme := FieldByName('Theme').AsInteger;
Close;
Active := False;
SQl.Clear;
End;
if (Theme = 0) then
Begin
Dlg.StyleBook := Windows10;
End
else if (Theme = 1) then
Begin
Dlg.StyleBook := Windows10SlateGrey;
End;
Result := Theme;
End;
End;
procedure TMain.LoadParam();
Var
Bar1, Bar2, Bar3, Bar4, Theme: Integer;
HM, HS, Bio, Serlg: Boolean;
Lang: String;
Begin
With Main Do
Begin
With DataModule1.FDQuery1 do
Begin
Active := False;
SQl.Clear;
SQl.Text := ('Select * From Parametre Where Id="' + ID_Medecin + '"');
Open;
Bar1 := FieldByName('Bar1').AsInteger;
Bar2 := FieldByName('Bar2').AsInteger;
Bar3 := FieldByName('Bar3').AsInteger;
Bar4 := FieldByName('Bar4').AsInteger;
Theme := FieldByName('Theme').AsInteger;
HM := FieldByName('HM').AsBoolean;
HS := FieldByName('HS').AsBoolean;
Bio := FieldByName('Bio').AsBoolean;
Serlg := FieldByName('Serlg').AsBoolean;
Lang := FieldByName('Lang').AsString;
Close;
SQl.Clear;
End;
// Setting the Tables
Begin
GrouBox1_Table.Text :=
('Les ' + Bar1.ToString + ' dernires homme ajouter');
GrouBox2_Table.Text := ('Les ' + Bar2.ToString + ' dernires groupage');
GrouBox3_Table.Text :=
('Les ' + Bar3.ToString + ' dernires femmes ajouter');
GrouBox4_Table.Text :=
('Les ' + Bar4.ToString + ' dernires patient ajouter');
// System
Begin
if (Theme = 0) then
Begin
StyleBook := Windows10;
ChangeParaMinus;
Rectangle1.Visible := True;
Rectangle2.Visible := False;
End
else if (Theme = 1) then
Begin
StyleBook := Windows10SlateGrey;
ChangeParamPlus;
Rectangle2.Visible := True;
Rectangle1.Visible := False;
End;
End;
// StringGrids
Begin
StringGrid1.RowCount := Bar1;
StringGrid2.RowCount := Bar2;
StringGrid3.RowCount := Bar3;
StringGrid4.RowCount := Bar4;
Load(Bar1, Bar2, Bar3, Bar4);
End;
End;
// Setting The Tabs Visibility
Begin
TabItem2.Visible := HM;
TabItem3.Visible := HS;
TabItem4.Visible := Bio;
TabItem5.Visible := Serlg;
TabItem9.Visible := HM;
TabItem10.Visible := HS;
TabItem11.Visible := Bio;
TabItem12.Visible := Serlg;
End;
End;
End;
procedure TMain.MainTDblClick(Sender: TObject);
begin
inherited;
Patient_ID := '';
end;
procedure LoadParam2(const Dlg: TParametre);
Var
Bar1, Bar2, Bar3, Bar4, Theme: Integer;
HM, HS, Bio, Serlg: Boolean;
Lang: String;
Begin
With Dlg Do
Begin
With DataModule1.FDQuery1 do
Begin
Active := False;
SQl.Clear;
SQl.Text := ('Select * From Parametre Where Id="' +
Main.ID_Medecin + '"');
Open;
Bar1 := FieldByName('Bar1').AsInteger;
Bar2 := FieldByName('Bar2').AsInteger;
Bar3 := FieldByName('Bar3').AsInteger;
Bar4 := FieldByName('Bar4').AsInteger;
Theme := FieldByName('Theme').AsInteger;
HM := FieldByName('HM').AsBoolean;
HS := FieldByName('HS').AsBoolean;
Bio := FieldByName('Bio').AsBoolean;
Serlg := FieldByName('Serlg').AsBoolean;
Lang := FieldByName('Lang').AsString;
Close;
SQl.Clear;
End;
// System
Begin
ComboBox1.ItemIndex := Theme;
End;
// Visibility
Begin
if (HM = True) then
Switch1.IsChecked := True;
if (HS = True) then
Switch2.IsChecked := True;
if (Bio = True) then
Switch3.IsChecked := True;
if (Serlg = True) then
Switch4.IsChecked := True;
End;
// Bars & Edit's
Begin
// Edit
Edit_ST_1.Text := Bar1.ToString;
Edit_ST_2.Text := Bar2.ToString;
Edit_ST_3.Text := Bar3.ToString;
Edit_ST_4.Text := Bar4.ToString;
// Bars
TrackBar1.Value := Bar1.ToSingle;
TrackBar2.Value := Bar2.ToSingle;
TrackBar3.Value := Bar3.ToSingle;
TrackBar4.Value := Bar4.ToSingle;
End;
End;
End;
procedure StatusBar;
Begin
With Main Do
Begin
With DataModule1.FDQ_Status_Patient do
Begin
Active := False;
SQl.Clear;
SQl.Text := 'Select count(*) From Patient';
Active := True;
Open;
Status_Edit1.Text := IntToStr(Fields[0].AsInteger);
Active := False;
SQl.Clear;
SQl.Text := 'Select Count(*) From Patient Where Type="Externe"';
Active := True;
Open;
Status_Edit2.Text := IntToStr(Fields[0].AsInteger);
Active := False;
SQl.Clear;
SQl.Text := 'Select Count(*) From Patient Where type="Interne"';
Active := True;
Open;
Status_Edit3.Text := IntToStr(Fields[0].AsInteger);
Active := False;
SQl.Clear;
End;
End;
End;
procedure TMain.SaveDialog1TypeChange(Sender: TObject);
begin
inherited;
case SaveDialog1.FilterIndex of
1:
SaveDialog1.DefaultExt := '.BAK';
2:
SaveDialog1.DefaultExt := '.db';
end;
end;
procedure TMain.StringGrid5CellClick(const Column: TColumn; const Row: Integer);
Var
tRow: Integer;
begin
inherited;
Patient_ID := '';
tRow := StringGrid5.Row;
Patient_ID := StringGrid5.Cells[0, tRow];
end;
procedure TMain.StringGrid5CellDblClick(const Column: TColumn;
const Row: Integer);
begin
inherited;
inherited;
Label65Click(Self);
end;
procedure StringGrid6ColResize();
Var
i: Integer;
Begin
With Main do
Begin
for i := 0 to 15 do
Begin
StringGrid6.Columns[i].Width := 120;
if (i = 0) then
StringGrid6.Columns[i].Width := 80;
if (i = 5) then
StringGrid6.Columns[i].Width := 70;
if (i = 6) then
StringGrid6.Columns[i].Width := 70;
End;
End;
End;
procedure TMain.StringGrid6CellClick(const Column: TColumn; const Row: Integer);
Var
tRow: Integer;
begin
inherited;
Patient_ID := '';
tRow := StringGrid6.Row;
Patient_ID := StringGrid6.Cells[0, tRow];
end;
procedure TMain.StringGrid6CellDblClick(const Column: TColumn;
const Row: Integer);
begin
inherited;
Label48Click(Self);
end;
procedure Resources();
Var
ResStream: TResourceStream;
AppData: String;
Begin
AppData := GetEnvironmentVariable('AppData');
CreateDir(AppData + '\SangyMed');
AppData := AppData + '\SangyMed\Alg_info.db';
ResStream := TResourceStream.Create(HInstance, 'Alg_Res', 'db');
try
ResStream.Position := 0;
ResStream.SaveToFile(AppData);
finally
ResStream.Free;
end;
End;
Procedure Recherche(Recherche, filtre, typ, wilaya, commune, groupage: String);
Var
typs, wila, comn, Grp: String;
Begin
With DataModule1.FDQ_Recherche do
Begin
if (Main.Privilege = False) then
SQl.Text :=
('Select Patient_ID, Nom,Prenom,Type,Wilaya,Commune,Groupage,Date_de_Nai,Date_de_Entre,Sexe,Etat_Civil,Adresse,Mobile,Email,Telephone,Fax From patient Where ID="'
+ Main.ID_Medecin + '";')
else
SQl.Text :=
('Select Patient_ID, Nom,Prenom,Type,Wilaya,Commune,Groupage,Date_de_Nai,Date_de_Entre,Sexe,Etat_Civil,Adresse,Mobile,Email,Telephone,Fax From patient;');
// Where type="' + typ + '";');
{ if (Recherche = '') then
Filtered := False
else }
Begin
if (typ = '') then
typs := ''
else
typs := (' And (Type LIKE ''%' + typ + '%'')');
if (wilaya = '') then
wila := ''
else
wila := (' And (Wilaya LIKE ''%' + wilaya + '%'')');
if (commune = '') then
comn := ''
else
comn := (' And (Commune LIKE ''%' + commune + '%'')');
if (groupage = '') then
Grp := ''
else
Grp := (' And (Groupage LIKE ''%' + groupage + '%'')');
//
Filter := ('(' + filtre + ' LIKE ''%' + Recherche + '%'')') + typs + wila
+ comn + Grp;
Filtered := True;
End;
End;
End;
procedure TMain.Edit_RechercheChangeTracking(Sender: TObject);
Var
Filter, typ: String;
begin
inherited;
// Searh By
if (RB_Nom.IsChecked = True) then
Filter := ('Nom')
else if (RB_Prenom.IsChecked = True) then
Filter := ('Prenom');
// Show By
if (RB_Interne.IsChecked = True) then
typ := ('Interne')
else if (RB_Externe.IsChecked = True) then
typ := ('Externe');
if ((RB_Interne.IsChecked = False) and (RB_Externe.IsChecked = False) and
(Edit_Search_Wilaya.Text = '') and (Edit2.Text = '') and
(Edit_Search_Commune.Text = '') and (Edit_Recherche.Text = '')) then
DataModule1.FDQ_Recherche.Active := False
else
Begin
Recherche(Edit_Recherche.Text, Filter, typ, Edit_Search_Wilaya.Text,
Edit_Search_Commune.Text, Edit2.Text);
DataModule1.FDQ_Recherche.Active := True;
StringGrid6ColResize;
End;
if (Edit_Recherche.Text = '') then
Begin
Patient_ID := '';
End;
end;
procedure TMain.Edit2ChangeTracking(Sender: TObject);
begin
inherited;
Edit_Recherche.OnChangeTracking(Self);
end;
procedure TMain.Edit_PatientResize(Sender: TObject);
begin
inherited;
Frame_EP_Principale.OnResize(Frame_EP_Principale);
Frame_EP_Information.OnResize(Frame_EP_Information);
Frame_EP_Hemogramme.OnResize(Frame_EP_Hemogramme);
Frame_EP_Hemostase.OnResize(Frame_EP_Hemostase);
Frame_EP_Biochimic.OnResize(Frame_EP_Biochimic);
Frame_EP_Serologie.OnResize(Frame_EP_Serologie);
// Frame_EP_Ordonnance.OnResize(Frame_EP_Ordonnance);
end;
procedure TMain.Edit_Search_CommuneChangeTracking(Sender: TObject);
begin
inherited;
Edit_Recherche.OnChangeTracking(Self);
end;
procedure TMain.Edit_Search_WilayaChangeTracking(Sender: TObject);
begin
inherited;
Edit_Recherche.OnChangeTracking(Self);
end;
procedure TMain.FloatAnimation1Finish(Sender: TObject);
begin
inherited;
DataModule1.FDQ_Homme.Active := False;
DataModule1.FDQ_Homme.Active := True;
StringGrid5ColResize;
end;
procedure TMain.FloatAnimation2Finish(Sender: TObject);
begin
inherited;
DataModule1.FDQ_Groupage.Active := False;
DataModule1.FDQ_Groupage.Active := True;
StringGrid5ColResize;
end;
procedure TMain.FloatAnimation3Finish(Sender: TObject);
begin
inherited;
DataModule1.FDQ_Femme.Active := False;
DataModule1.FDQ_Femme.Active := True;
StringGrid5ColResize;
end;
procedure TMain.FloatAnimation4Finish(Sender: TObject);
begin
inherited;
DataModule1.FDQ_Patient.Active := False;
DataModule1.FDQ_Patient.Active := True;
StringGrid5ColResize;
end;
procedure TMain.FloatAnimation5Finish(Sender: TObject);
begin
inherited;
DataModule1.FDQ_Patient_Table.Active := False;
DataModule1.FDQ_Patient_Table.Active := True;
StringGrid5ColResize;
StatusBar;
end;
procedure TMain.FormClose(Sender: TObject; var Action: TCloseAction);
Var
Pass: String;
begin
inherited;
with DataModule1 do
Begin
Pass := GenerateID;
Pass := Encryt(Pass);
Database_Encrypt(Pass);
End;
end;
procedure TMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
var
Msg: Integer;
begin
inherited;
Msg := MessageDlg('Vous etez sure !', TMsgDlgType.mtConfirmation,
[TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0);
if (Msg = mrNo) then
CanClose := False;
end;
procedure TMain.FormCreate(Sender: TObject);
Var
AppData: String;
Num: Integer;
begin
AppData := GetEnvironmentVariable('AppData');
AppData := AppData + '\SangyMed\Alg_info.db';
if (FileExists(AppData) = False) then
Begin
Resources();
End;
inherited;
WidthX := 1280;
HeightX := 688;
end;
procedure TMain.FormPaint(Sender: TObject; Canvas: TCanvas;
const ARect: TRectF);
begin
inherited;
WidthX := Main.Width;
HeightX := Main.Height;
StringGrid5ColResize;
end;
procedure TMain.FormResize(Sender: TObject);
begin
inherited;
// Frame resize
Layout10.Width := (GroupBox4.Width) / 3;
Layout11.Width := (GroupBox4.Width) / 3;
Layout12.Width := (GroupBox4.Width) / 3;
Nouveau_Patient.OnResize(Nouveau_Patient);
Edit_Patient.OnResize(Edit_Patient);
//
P_Accueil.OnResize(P_Accueil);
// Minmum Size for MainForm -- U_Main.pas --
if ((Main.Width <= Screen.Width) or (Main.Height <= Screen.Height)) then
begin
// Setting Main form Sizes
if (Main.Width <= ((Screen.Width div 2) + (Screen.Width div 4))) then
begin
Main.Width := ((Screen.Width div 2) + (Screen.Width div 4));
Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
end;
if (Main.Height <= (Screen.Height div 2) + (Screen.Height div 4)) then
begin
Main.Height := ((Screen.Height div 2) + (Screen.Height div 4));
Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
end;
end;
end;
procedure TMain.FormShow(Sender: TObject);
var
LogDlg: TConnecter;
begin
inherited;
P_Accueil.IsSelected := True;
H_Accueil.IsSelected := True;
LogDlg := TConnecter.Create(Self);
if (LogDlg.ShowModal = mrOk) then
Begin
LogDlg.Free;
ShowMessage('Bienvenue Mr(s) "' + Nom + '"');
// Load();
LoadParam;
End
else
Application.Terminate;
// StatusBar;
end;
procedure TMain.Frame_EP_PrincipaleButton1Click(Sender: TObject);
Var
ID: String;
begin
inherited;
if (Frame_EP_Principale.SetEdit = True) then
Begin
With DataModule1.FDQuery1 do
Begin
Active := False;
SQl.Clear;
SQl.Text := 'Select * From Patient Where Patient_ID="' +
Patient_ID + '";';
Active := True;
Edit;
ID := Frame_EP_Principale.Edit;
Frame_EP_Principale.Edit;
Frame_EP_Information.Edit;
Post;
Active := False;
SQl.Clear;
End;
Frame_EP_Biochimic.Edit(ID);
Frame_EP_Hemogramme.Edit(ID);
Frame_EP_Hemostase.Edit(ID);
Frame_EP_Serologie.Edit(ID);
Frame_EP_PrincipaleButton3Click(Self);
End;
end;
procedure TMain.Frame_EP_PrincipaleButton2Click(Sender: TObject);
begin
inherited;
Frame_Principale.Clear();
if (TabItem8.IsSelected = True) then
Frame_EP_Information.Clear;
if (TabItem9.IsSelected = True) then
Frame_EP_Hemogramme.Clear;
if (TabItem10.IsSelected = True) then
Frame_EP_Hemostase.Clear;
if (TabItem11.IsSelected = True) then
Frame_EP_Biochimic.Clear;
if (TabItem12.IsSelected = True) then
Frame_EP_Serologie.Clear;
end;
procedure TMain.Frame_EP_PrincipaleButton3Click(Sender: TObject);
begin
inherited;
Edit_Patient.Visible := False;
Patient.IsSelected := True;
H_Gen_Patient.IsSelected := True;
end;
procedure TMain.Frame_PrincipaleButton1Click(Sender: TObject);
Var
ID: String;
begin
inherited;
if (Frame_Principale.SetEdit = True) then
Begin
with DataModule1.FDQuery1 do
Begin
Active := False;
SQl.Clear;
SQl.Text := ('Select * From Patient');
Active := True;
Insert;
FieldByName('ID').AsString := ID_Medecin;
ID := Frame_Principale.Insert;
Frame_Information.Insert;
Post;
SQl.Clear;
Active := False;
End;
if (Frame_Hemogramme.Pret = True) then
Frame_Hemogramme.Insert(ID);
if (Frame_Hemostase.Pret = True) then
Frame_Hemostase.Insert(ID);
if (Frame_Serologie.Pret = True) then
Frame_Serologie.Insert(ID);
if (Frame_Biochimic.Pret = True) then
Frame_Biochimic.Insert(ID);
Frame_PrincipaleButton2Click(Self);
end;
end;
procedure TMain.Frame_PrincipaleButton2Click(Sender: TObject);
begin
inherited;
Frame_Information.Clear;
Frame_Principale.Clear;
Frame_Hemogramme.Clear;
Frame_Hemostase.Clear;
Frame_Biochimic.Clear;
Frame_Serologie.Clear;
end;
procedure TMain.Label10Click(Sender: TObject);
Var
PropreDlg: TPropre;
i: Integer;
begin
inherited;
PropreDlg := TPropre.Create(Self);
i := LoadTheme(PropreDlg);
if (i = 0) then
Begin
PropreDlg.Rectangle1.Visible := True;
PropreDlg.Rectangle2.Visible := False;
End
else if (i = 1) then
begin
PropreDlg.Rectangle2.Visible := True;
PropreDlg.Rectangle1.Visible := False;
end;
if (PropreDlg.ShowModal = mrCancel) then
PropreDlg.Free;
end;
procedure TMain.Label12Click(Sender: TObject);
var
EtablissementDlg: TEtablissement;
i: Integer;
begin
inherited;
EtablissementDlg := TEtablissement.Create(Self);
i := LoadTheme(EtablissementDlg);
if (i = 0) then
Begin
EtablissementDlg.Rectangle1.Visible := True;
EtablissementDlg.Rectangle2.Visible := False;
End
else if (i = 1) then
Begin
EtablissementDlg.Rectangle2.Visible := True;
EtablissementDlg.Rectangle1.Visible := False;
End;
if (EtablissementDlg.ShowModal = mrClose) then
EtablissementDlg.Free;
end;
procedure TMain.Label15Click(Sender: TObject);
begin
inherited;
Patient.Visible := False;
H_Gen_Patient.Visible := False;
H_Accueil.IsSelected := True;
H_Accueil.IsSelected := True;
end;
procedure TMain.Label18Click(Sender: TObject);
begin
inherited;
Recherche_Patient.Visible := False;
H_Gen_RechercheP.Visible := False;
H_Accueil.IsSelected := True;
H_Accueil.IsSelected := True;
end;
procedure TMain.Label1Click(Sender: TObject);
begin
inherited;
H_Accueil.Visible := True;
H_Accueil.IsSelected := True;
P_Accueil.Visible := True;
P_Accueil.IsSelected := True;
Patient.Visible := False;
Nouveau_Patient.Visible := False;
Recherche_Patient.Visible := False;
H_Gen_Patient.Visible := False;
H_Gen_NouveauP.Visible := False;
H_Gen_RechercheP.Visible := False;
end;
procedure TMain.Label20Click(Sender: TObject);
begin
inherited;
Nouveau_Patient.Visible := False;
H_Gen_NouveauP.Visible := False;
H_Accueil.IsSelected := True;
H_Accueil.IsSelected := True;
end;
procedure TMain.Label223Click(Sender: TObject);
begin
inherited;
// H_Accueil.IsSelected := True;
Edit_Recherche.Text := '';
Edit2.Text := '';
Edit_Search_Commune.Text := '';
Edit_Search_Wilaya.Text := '';
RB_Interne.IsChecked := False;
RB_Externe.IsChecked := False;
DataModule1.FDQ_Recherche.Active := False;
end;
procedure TMain.Label25Click(Sender: TObject);
Var
Str, Date0: String;
Date1: TDateTime;
Days: double;
begin
inherited;
if (Patient_ID <> '') then
Begin
With DataModule1.FDQuery1 do
Begin
Active := False;
SQl.Clear;
SQl.Text := ('Select Date_Donner_Sang from Patient Where Patient_ID="' +
Patient_ID + '";');
Active := True;
Open;
Date0 := FieldByName('Date_Donner_Sang').AsString;
Close;
Active := False;
SQl.Clear;
if (Date0 = '') then
Begin
MessageDlg('Ce patient n''a pas donn de sang', TMsgDlgType.mtWarning,
[TMsgDlgBtn.mbOK], 0);
End
else
begin
Date1 := VarToDateTime(Date0);
Days := Date - Date1;
if (Days = 30) then
Str := ('1 mois t pass')
else if (Days = 60) then
Str := ('2 mois t pass')
else if (Days = 90) then
Str := ('3 mois t pass')
else
Str := (Days.ToString + ' jours t pass');
MessageDlg(Str, TMsgDlgType.mtInformation, [TMsgDlgBtn.mbOK], 0);
end;
End;
End
else
Begin
ShowMessage
('Sil vous plait choisir une patient ou double clicker sur un patient pour le modifier');
End;
end;
procedure TMain.Label27Click(Sender: TObject);
Var
P: TPointF;
begin
inherited;
P.X := (((Label27.Width) / 2) * (-1));
P.Y := Label27.Height;
P := Label27.LocalToAbsolute(P);
P := ClientToScreen(P);
PopupMenu2.Popup(P.X, P.Y);
end;
procedure TMain.Label_Refresh1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation1.enabled := False;
end;
procedure TMain.Label_Refresh1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation1.enabled := True;
end;
procedure TMain.Label_Refresh2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation2.enabled := False;
end;
procedure TMain.Label_Refresh2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation2.enabled := True;
end;
procedure TMain.Label_Refresh3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation3.enabled := False;
end;
procedure TMain.Label_Refresh3MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation3.enabled := True;
end;
procedure TMain.Label_Refresh4MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation4.enabled := False;
end;
procedure TMain.Label_Refresh4MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation4.enabled := True;
end;
procedure TMain.Label30Click(Sender: TObject);
begin
inherited;
Patient_RechercheClick(Self);
end;
procedure TMain.Label32Click(Sender: TObject);
Var
P: TPointF;
begin
inherited;
P.X := (((Label32.Width) / 2) * (-1));
P.Y := Label32.Height;
P := Label32.LocalToAbsolute(P);
P := ClientToScreen(P);
PopupMenu1.Popup(P.X, P.Y);
end;
procedure TMain.Label34Click(Sender: TObject);
begin
inherited;
Label25Click(Self);
end;
procedure TMain.Label46Click(Sender: TObject);
begin
inherited;
Label61.OnClick(Self);
end;
procedure TMain.Label48Click(Sender: TObject);
begin
inherited;
Edit_Patient.Visible := True;
Edit_Patient.IsSelected := True;
H_Accueil.IsSelected := True;
Frame_EP_Principale.OnDataLoad;
Frame_EP_Information.OnDataLoad;
end;
procedure TMain.Label49Click(Sender: TObject);
begin
inherited;
Label76.OnClick(Self);
end;
procedure TMain.Label4Click(Sender: TObject);
Var
FenetreDlg: TFenetre;
i: Integer;
begin
inherited;
FenetreDlg := TFenetre.Create(Self);
i := LoadTheme(FenetreDlg);
if (i = 0) then
Begin
FenetreDlg.Rectangle1.Visible := True;
FenetreDlg.Rectangle2.Visible := False;
LoadFM(FenetreDlg);
End
else if (i = 1) then
Begin
FenetreDlg.Rectangle2.Visible := True;
FenetreDlg.Rectangle1.Visible := False;
LoadFP(FenetreDlg);
End;
if (FenetreDlg.ShowModal = mrClose) then
FenetreDlg.Free;
end;
procedure TMain.Label52Click(Sender: TObject);
begin
inherited;
New_PatientClick(Self);
end;
procedure TMain.Label54Click(Sender: TObject);
begin
inherited;
Frame_PrincipaleButton2Click(Self);
end;
procedure TMain.Label55Click(Sender: TObject);
begin
inherited;
Frame_PrincipaleButton1Click(Self);
end;
procedure TMain.Label61Click(Sender: TObject);
begin
inherited;
if (Patient_ID <> '') then
Begin
With DataModule1.FDCmnd_Drop_Patient do
Begin
Active := False;
CommandText.Clear;
CommandText.Text := ('DELETE FROM Patient WHERE Patient_ID="' +
Patient_ID + '";');
Active := True;
Execute;
Active := False;
CommandText.Clear;
FloatAnimation5.OnFinish(FloatAnimation5);
Patient_ID := '';
End;
End
else
Begin
ShowMessage
('Sil vous plait choisir une patient ou double clicker sur un patient pour le modifier');
End;
end;
procedure TMain.Label65Click(Sender: TObject);
begin
inherited;
if (Patient_ID <> '') then
Begin
Edit_Patient.Visible := True;
Edit_Patient.IsSelected := True;
H_Accueil.IsSelected := True;
TabItem8.IsSelected := True;
Frame_EP_Principale.OnDataLoad;
Frame_EP_Information.OnDataLoad;
Frame_EP_Hemogramme.OnDataLoad;
Frame_EP_Hemostase.OnDataLoad;
Frame_EP_Serologie.OnDataLoad;
Frame_EP_Biochimic.OnDataLoad;
Main.OnResize(Self);
End
else
Begin
ShowMessage
('Sil vous plait choisir une patient ou double clicker sur un patient pour le modifier');
End;
end;
procedure TMain.Label6Click(Sender: TObject);
var
OptionDlg: TParametre;
Theme, Result: Integer;
begin
inherited;
OptionDlg := TParametre.Create(Self);
LoadParam2(OptionDlg);
Theme := LoadTheme(OptionDlg);
if (Theme = 0) then
Begin
ChangeParamM(OptionDlg);
OptionDlg.Rectangle1.Visible := True;
OptionDlg.Rectangle2.Visible := False;
End
else if (Theme = 1) then
Begin
ChangeParamP(OptionDlg);
OptionDlg.Rectangle2.Visible := True;
OptionDlg.Rectangle1.Visible := False;
End;
if (OptionDlg.ShowModal = mrOk) then
Begin
OptionDlg.Free;
Pass := True;
T_RDV.OnClick(T_RDV);
End;
end;
procedure TMain.Label71Click(Sender: TObject);
Var
output, Path, DirPath, Ext: String;
Encrypt: Boolean;
Msg: Integer;
begin
inherited;
output := '';
Path := '';
DirPath := '';
if (SaveDialog1.Execute) then
Begin
Msg := MessageDlg('Voulez-vous crypter la base de donnes! ' + sLineBreak +
'' + sLineBreak +
'Le cryptage des donnes signifie que la base de donnes ne sera ouverte qu'' partir de cette Application.',
TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0);
if (Msg = mrYes) then
Encrypt := True
else
Encrypt := False;
With DataModule1 do
Begin
SaveDialog1.DefaultExt := '';
output := SaveDialog1.FileName;
DirPath := GetEnvironmentVariable('AppData');
Path := (DirPath + '\SangyMed\Data.db');
FDConnection3.Params.Add('Database=' + Path);
FDConnection3.Open();
FDSQLiteBackup1.DriverLink := FDPhysSQLiteDriverLink1;
FDSQLiteBackup1.DatabaseObj := FDConnection3.CliObj;
SaveDialog1.OnTypeChange(Self);
FDSQLiteBackup1.DestDatabase := output;
try
FDSQLiteBackup1.Backup;
except
on E: Exception do
BEgin
FDSQLiteSecurity1.DriverLink := FDPhysSQLiteDriverLink1;
FDSQLiteSecurity1.database := output;
FDSQLiteSecurity1.Password := 'Painkiller';
FDSQLiteSecurity1.RemovePassword;
FDSQLiteBackup1.Backup;
End;
end;
if (Encrypt = True) then
Begin
FDSQLiteSecurity1.DriverLink := FDPhysSQLiteDriverLink1;
FDSQLiteSecurity1.database := output;
FDSQLiteSecurity1.Password := 'Painkiller';
FDSQLiteSecurity1.SetPassword;
ShowMessage('La base de donnes a t sauvegardent avec succs');
End;
End;
End;
end;
procedure TMain.Label73Click(Sender: TObject);
begin
inherited;
try
ShellExecute(0, 'open', 'c:\Windows\system32\calc.exe', nil, nil,
SW_SHOWNORMAL);
except
on E: Exception do
ShowMessage
('Il semble que la calculatrice ne fonctionne pas bien dans votre systme');
end;
end;
procedure TMain.Label75Click(Sender: TObject);
Var
OpenDialog1: TOpenDialog;
Path, DirPath, input: String;
i, j: Integer;
bol, bol1: Boolean;
const
Tabs: array [1 .. 8] of String = ('Medecin', 'Etablissement', 'Parametre',
'Patient', 'Biochimie', 'Hemogramme', 'Hemostase_VS', 'Serologie');
begin
inherited;
bol := False;
bol1 := True;
Path := '';
DirPath := '';
input := '';
OpenDialog1 := TOpenDialog.Create(Self);
OpenDialog1.Filter := ('BAK file|*.BAK|db file|*.db|All|*.*');
DirPath := GetEnvironmentVariable('AppData');
Path := (DirPath + '\SangyMed\Data.db');
if (OpenDialog1.Execute) then
Begin
input := OpenDialog1.FileName;
With DataModule1 do
begin
// Dencrypt
FDSQLiteSecurity1.DriverLink := FDPhysSQLiteDriverLink1;
FDSQLiteSecurity1.database := input;
FDSQLiteSecurity1.Password := 'Painkiller';
try
FDSQLiteSecurity1.RemovePassword;
except
on E: Exception do
Begin
bol1 := False;
End;
end;
for i := 1 to length(Tabs) do
Begin
FDConnection3.Params.Add('Database=' + input);
FDConnection3.Connected := True;
FDConnection4.Params.Add('Database=' + Path);
FDConnection4.Connected := True;
FDQuery3.SQl.Clear;
FDQuery3.SQl.Text := ('Select * From ' + Tabs[i] + ';');
FDQuery3.Active := True;
FDQuery4.SQl.Clear;
FDQuery4.SQl.Text := ('Select * From ' + Tabs[i] + ';');
FDQuery4.Active := True;
FDBatchMoveDataSetReader1.DataSet := FDQuery3;
FDBatchMoveDataSetWriter1.DataSet := FDQuery4;
try
FDBatchMove1.Execute();
except
on E: Exception do
Begin
ShowMessage
('Il semble que les donnes que vous essayez de restaurer dj existent.');
bol := True;
Break;
End;
end;
FDQuery3.Active := False;
FDQuery4.Active := False;
End;
// Encrypt
if (bol = True) then
begin
FDSQLiteSecurity1.DriverLink := FDPhysSQLiteDriverLink1;
FDSQLiteSecurity1.database := input;
FDSQLiteSecurity1.Password := 'Painkiller';
FDSQLiteSecurity1.SetPassword;
end;
if (bol = False) then
ShowMessage('La base de donnes a t restaurer avec succs');
end;
End;
end;
procedure TMain.Label76Click(Sender: TObject);
begin
inherited;
if (Label76.RotationAngle = 0) then
Begin
Label76.RotationAngle := 180;
GroupBox1.Height := 112;
GroupBox2.Visible := True;
GroupBox3.Visible := True;
GroupBox4.Visible := True;
Layout2.Height := Layout31.Height + GroupBox1.Height;
End
else if (Label76.RotationAngle = 180) then
Begin
Label76.RotationAngle := 0;
GroupBox1.Height := 33;
GroupBox2.Visible := False;
GroupBox3.Visible := False;
GroupBox4.Visible := False;
Layout2.Height := Layout31.Height + GroupBox1.Height;
End;
end;
procedure TMain.New_PatientClick(Sender: TObject);
begin
inherited;
Nouveau_Patient.Visible := True;
Nouveau_Patient.OnClick(Patient);
Nouveau_Patient.IsSelected := True;
TabItem1.IsSelected := True;
Main.OnResize(Self);
end;
procedure TMain.Nouveau_PatientClick(Sender: TObject);
begin
inherited;
H_Gen_Patient.Visible := False;
H_Accueil.IsSelected := False;
H_Gen_NouveauP.Visible := True;
H_Gen_RechercheP.Visible := False;
H_Gen_NouveauP.IsSelected := True;
end;
procedure TMain.Nouveau_PatientResize(Sender: TObject);
begin
inherited;
Frame_Principale.OnResize(Frame_Principale);
Frame_Information.OnResize(Frame_Information);
Frame_Hemogramme.OnResize(Frame_Hemogramme);
Frame_Hemostase.OnResize(Frame_Hemostase);
Frame_Biochimic.OnResize(Frame_Biochimic);
Frame_Serologie.OnResize(Frame_Serologie);
// Frame_Ordonnance.OnResize(Frame_Ordonnance);
end;
function TabExist(Tab: String): Boolean;
Begin
With Main do
Begin
With DataModule1.FDQuery1 do
Begin
Active := False;
SQl.Clear;
SQl.Text := ('Select * From ' + Tab + ' Where Patient_ID="' +
Patient_ID + '"');
Active := True;
Open;
if (Locate('Patient_ID', Patient_ID, [])) then
Result := True
else
Result := False;
Active := False;
SQl.Clear;
End;
End;
End;
procedure TMain.OrdonnanceClick(Sender: TObject);
begin
inherited;
H_Gen_Patient.Visible := False;
H_Gen_RechercheP.Visible := False;
H_Gen_NouveauP.Visible := False;
end;
procedure TMain.PatientClick(Sender: TObject);
begin
inherited;
H_Gen_Patient.Visible := True;
H_Gen_Patient.IsSelected := True;
H_Gen_RechercheP.Visible := False;
H_Gen_NouveauP.Visible := False;
end;
procedure TMain.Patient_RechercheClick(Sender: TObject);
begin
inherited;
Recherche_Patient.Visible := True;
Recherche_Patient.OnClick(Patient);
Recherche_Patient.IsSelected := True;
Main.OnResize(Main);
end;
procedure TMain.PoP2_HemogClick(Sender: TObject);
Var
Print_HMDlg: TPrint_HM;
i: Integer;
begin
inherited;
if (Patient_ID <> '') then
Begin
if (TabExist('Hemogramme') = True) then
Begin
Print_HMDlg := TPrint_HM.Create(Self);
i := LoadTheme(Print_HMDlg);
if (i = 0) then
Begin
Print_HMDlg.Rectangle1.Visible := True;
Print_HMDlg.Rectangle2.Visible := False;
End
else if (i = 1) then
Begin
Print_HMDlg.Rectangle1.Visible := True;
Print_HMDlg.Rectangle2.Visible := False;
End;
if (Print_HMDlg.ShowModal = mrCancel) then
Print_HMDlg.Free;
End
else
ShowMessage('Ce patient ''a pas de dossier d''analyse de l''Hmogramme');
End
else
ShowMessage('Sil vous plait choisir une patient');
end;
procedure TMain.PoP2_HemosClick(Sender: TObject);
Var
PrintHSDlg: Tprint_HS;
i: Integer;
begin
inherited;
if (Patient_ID <> '') then
Begin
if (TabExist('Hemostase_VS') = True) then
Begin
PrintHSDlg := Tprint_HS.Create(Self);
i := LoadTheme(PrintHSDlg);
if (i = 0) then
Begin
PrintHSDlg.Rectangle1.Visible := True;
PrintHSDlg.Rectangle2.Visible := False;
End
else if (i = 1) then
Begin
PrintHSDlg.Rectangle2.Visible := True;
PrintHSDlg.Rectangle1.Visible := False;
End;
if (PrintHSDlg.ShowModal = mrCancel) then
PrintHSDlg.Free;
End
else
ShowMessage
('Ce patient ''a pas de dossier d''analyse de l''Hmostase et VS');
End
else
ShowMessage('Sil vous plait choisir une patient');
end;
procedure TMain.PoP2_BoiClick(Sender: TObject);
Var
PrintBioDLg: TPrint_Bio;
i: Integer;
begin
inherited;
if (Patient_ID <> '') then
Begin
if (TabExist('Biochimie') = True) then
Begin
PrintBioDLg := TPrint_Bio.Create(Self);
i := LoadTheme(PrintBioDLg);
if (i = 0) then
Begin
PrintBioDLg.Rectangle1.Visible := True;
PrintBioDLg.Rectangle2.Visible := False;
End
else if (i = 1) then
Begin
PrintBioDLg.Rectangle1.Visible := True;
PrintBioDLg.Rectangle2.Visible := False;
End;
if (PrintBioDLg.ShowModal = mrCancel) then
PrintBioDLg.Free;
End
else
ShowMessage('Ce patient ''a pas de dossier d''analyse de la Biochimie');
end
else
ShowMessage('Sil vous plait choisir une patient');
end;
procedure TMain.PoP2_SerologieClick(Sender: TObject);
Var
PrintSRDlg: TPrint_SR;
i: Integer;
begin
inherited;
if (Patient_ID <> '') then
Begin
if (TabExist('Serologie') = True) then
Begin
PrintSRDlg := TPrint_SR.Create(Self);
i := LoadTheme(PrintSRDlg);
if (i = 0) then
Begin
PrintSRDlg.Rectangle7.Visible := True;
PrintSRDlg.Rectangle8.Visible := False;
End
else if (i = 1) then
Begin
PrintSRDlg.Rectangle7.Visible := True;
PrintSRDlg.Rectangle8.Visible := False;
End;
if (PrintSRDlg.ShowModal = mrCancel) then
PrintSRDlg.Free;
End
else
ShowMessage('Ce patient ''a pas de dossier d''analyse de la Srologie');
End
else
ShowMessage('Sil vous plait choisir une patient');
end;
procedure TMain.PoP_BiochimicClick(Sender: TObject);
begin
inherited;
if (Patient_ID <> '') then
Begin
Edit_Patient.Visible := True;
Edit_Patient.IsSelected := True;
H_Accueil.IsSelected := True;
TabItem11.IsSelected := True;
Frame_EP_Principale.OnDataLoad;
Frame_EP_Information.OnDataLoad;
Frame_EP_Hemogramme.OnDataLoad;
Frame_EP_Hemostase.OnDataLoad;
Frame_EP_Serologie.OnDataLoad;
Frame_EP_Biochimic.OnDataLoad;
End
else
Begin
ShowMessage
('Sil vous plait choisir une patient ou double clicker sur un patient pour le modifier');
End;
end;
procedure TMain.PoP_HemogrammeClick(Sender: TObject);
begin
inherited;
if (Patient_ID <> '') then
Begin
Edit_Patient.Visible := True;
Edit_Patient.IsSelected := True;
H_Accueil.IsSelected := True;
TabItem9.IsSelected := True;
Frame_EP_Principale.OnDataLoad;
Frame_EP_Information.OnDataLoad;
Frame_EP_Hemogramme.OnDataLoad;
Frame_EP_Hemostase.OnDataLoad;
Frame_EP_Serologie.OnDataLoad;
Frame_EP_Biochimic.OnDataLoad;
End
else
Begin
ShowMessage
('Sil vous plait choisir une patient ou double clicker sur un patient pour le modifier');
End;
end;
procedure TMain.PoP_HemostaseClick(Sender: TObject);
begin
inherited;
if (Patient_ID <> '') then
Begin
Edit_Patient.Visible := True;
Edit_Patient.IsSelected := True;
H_Accueil.IsSelected := True;
TabItem10.IsSelected := True;
Frame_EP_Principale.OnDataLoad;
Frame_EP_Information.OnDataLoad;
Frame_EP_Hemogramme.OnDataLoad;
Frame_EP_Hemostase.OnDataLoad;
Frame_EP_Serologie.OnDataLoad;
Frame_EP_Biochimic.OnDataLoad;
End
else
Begin
ShowMessage
('Sil vous plait choisir une patient ou double clicker sur un patient pour le modifier');
End;
end;
procedure TMain.PoP_SerologieClick(Sender: TObject);
begin
inherited;
if (Patient_ID <> '') then
Begin
Edit_Patient.Visible := True;
Edit_Patient.IsSelected := True;
H_Accueil.IsSelected := True;
TabItem12.IsSelected := True;
Frame_EP_Principale.OnDataLoad;
Frame_EP_Information.OnDataLoad;
Frame_EP_Hemogramme.OnDataLoad;
Frame_EP_Hemostase.OnDataLoad;
Frame_EP_Serologie.OnDataLoad;
Frame_EP_Biochimic.OnDataLoad;
End
else
Begin
ShowMessage
('Sil vous plait choisir une patient ou double clicker sur un patient pour le modifier');
End;
end;
procedure TMain.P_AccueilClick(Sender: TObject);
begin
inherited;
H_Gen_Patient.Visible := False;
H_Accueil.IsSelected := True;
H_Gen_RechercheP.Visible := False;
H_Gen_NouveauP.Visible := False;
end;
procedure TMain.P_AccueilResize(Sender: TObject);
begin
inherited;
// Width
L_Left_P_Accueil.Width := MainT.Width / 2;
L_Right_P_Accueil.Width := MainT.Width / 2;
// Height
GrouBox1_Table.Height := L_Left_P_Accueil.Height / 2;
GrouBox2_Table.Height := L_Right_P_Accueil.Height / 2;
GrouBox3_Table.Height := L_Left_P_Accueil.Height / 2;
GrouBox4_Table.Height := L_Right_P_Accueil.Height / 2;
end;
procedure TMain.RB_ExterneChange(Sender: TObject);
begin
inherited;
if (RB_Externe.IsChecked = True) then
Edit_Recherche.OnChangeTracking(Self);
end;
procedure TMain.RB_InterneChange(Sender: TObject);
begin
inherited;
if (RB_Interne.IsChecked = True) then
Edit_Recherche.OnChangeTracking(Self);
end;
procedure TMain.RB_NomChange(Sender: TObject);
begin
inherited;
Edit_Recherche.OnChangeTracking(Self);
end;
procedure TMain.RB_PrenomChange(Sender: TObject);
begin
inherited;
Edit_Recherche.OnChangeTracking(Self);
end;
procedure TMain.RDVClick(Sender: TObject);
begin
inherited;
H_Gen_Patient.Visible := False;
H_Gen_RechercheP.Visible := False;
H_Gen_NouveauP.Visible := False;
end;
procedure TMain.Recherche_PatientClick(Sender: TObject);
begin
inherited;
H_Gen_Patient.Visible := False;
H_Accueil.IsSelected := False;
H_Gen_NouveauP.Visible := False;
H_Gen_RechercheP.Visible := True;
H_Gen_RechercheP.IsSelected := True;
end;
procedure TMain.Refresh_Patient_TableMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation5.enabled := False;
end;
procedure TMain.Refresh_Patient_TableMouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Single);
begin
inherited;
FloatAnimation5.enabled := True;
end;
procedure TMain.T_AccueilClick(Sender: TObject);
begin
inherited;
P_Accueil.Visible := True;
P_Accueil.OnClick(P_Accueil);
P_Accueil.IsSelected := True;
end;
procedure TMain.T_PatientClick(Sender: TObject);
begin
inherited;
Patient.Visible := True;
Patient.OnClick(Patient);
Patient.IsSelected := True;
end;
procedure TMain.T_RDVClick(Sender: TObject);
Var
ConnecterDlg: TConnecter;
Msg: Integer;
begin
inherited;
if (Pass = False) then
Msg := MessageDlg('tes-vous sr', TMsgDlgType.mtInformation,
[TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0);
if ((Msg = mrYes) or (Pass = True)) then
Begin
DataModule1.Init();
ConnecterDlg := TConnecter.Create(Self);
if (ConnecterDlg.ShowModal = mrOk) then
Begin
ShowMessage('Bienvenue MR ''' + Nom);
// Load();
LoadParam;
ConnecterDlg.Free;
End
else
Application.Terminate;
End;
end;
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qinix2/SangyMed.git
git@gitee.com:qinix2/SangyMed.git
qinix2
SangyMed
SangyMed
master

搜索帮助