From 496290a1099bfe46caaa8fa2ac443830e8b216a7 Mon Sep 17 00:00:00 2001 From: roberto Date: Thu, 15 Mar 2012 15:45:02 +0000 Subject: [PATCH] =?UTF-8?q?Version=201.0.3=20Tareas=20#789:A=C3=B1ador=20e?= =?UTF-8?q?l=20campo=20'Doctor'=20para=20los=20pacientes=20Se=20adapta=20e?= =?UTF-8?q?l=20programa=20para=20contemplar=20pabellones=20y=20doctores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.FarmaciaPH_Etiquetas/trunk@30 7b0b1a58-4aa1-b946-8089-8453ede31e50 --- Database/scripts/etiquetas.sql | 26 +- .../Empresas/Views/uEditorEmpresa.dfm | 32 ++ .../Empresas/Views/uEditorEmpresa.pas | 2 +- Source/Cliente/Etiquetas.RES | Bin 137364 -> 137364 bytes Source/Cliente/Etiquetas.dproj | 2 +- Source/Cliente/Etiquetas.rc | 8 +- Source/Cliente/uPantallaPrincipal.dfm | 57 ++++ .../Controller/Contactos_controller.dpk | 18 +- .../Controller/Contactos_controller.dproj | 23 ++ .../Controller/View/uIEditorDoctores.pas | 23 ++ .../Controller/View/uIEditorPabellones.pas | 23 ++ .../Controller/uDoctoresController.pas | 219 ++++++++++++ .../Controller/uPabellonesController.pas | 219 ++++++++++++ .../Contactos/Data/uDataModulePacientes.dfm | 227 ++++--------- .../Contactos/Data/uDataModulePacientes.pas | 36 +- .../Contactos/Model/Contactos_model.dpk | 4 +- .../Contactos/Model/Contactos_model.dproj | 24 +- .../Model/Data/uIDataModulePacientes.pas | 4 +- .../Model/schContactosClient_Intf.pas | 283 +++++++++++++++- .../Model/schContactosServer_Intf.pas | 311 +++++++++++++++++- .../Modulos/Contactos/Model/uBizContactos.pas | 37 +++ .../Modulos/Contactos/Model/uBizDoctores.pas | 26 ++ .../Contactos/Model/uBizPabellones.pas | 26 ++ .../Contactos/Model/uBizPacientesServer.pas | 4 +- .../Contactos/Plugin/uPluginContactos.dfm | 51 ++- .../Contactos/Plugin/uPluginContactos.pas | 37 ++- .../Contactos/Servidor/srvContactos_Impl.dfm | 126 ++++++- .../Contactos/Views/Contactos_view.dpk | 9 +- .../Contactos/Views/Contactos_view.dproj | 71 ++-- .../Views/uContactosViewRegister.pas | 7 +- .../Contactos/Views/uEditorDoctores.dfm | 178 ++++++++++ .../Contactos/Views/uEditorDoctores.pas | 207 ++++++++++++ .../Contactos/Views/uEditorPabellones.dfm | 171 ++++++++++ .../Contactos/Views/uEditorPabellones.pas | 208 ++++++++++++ .../Contactos/Views/uEditorPacientes.dfm | 1 + .../Modulos/Contactos/Views/uViewPaciente.dfm | 154 ++++++--- .../Modulos/Contactos/Views/uViewPaciente.pas | 122 ++++++- .../Contactos/Views/uViewPacientes.dfm | 39 ++- .../Contactos/Views/uViewPacientes.pas | 56 +++- Source/Servidor/Etiquetas_Server.dproj | 2 +- Source/Servidor/Etiquetas_Server.rc | 10 +- Source/Servidor/Etiquetas_Server.res | Bin 23400 -> 23400 bytes 42 files changed, 2773 insertions(+), 310 deletions(-) create mode 100644 Source/Modulos/Contactos/Controller/View/uIEditorDoctores.pas create mode 100644 Source/Modulos/Contactos/Controller/View/uIEditorPabellones.pas create mode 100644 Source/Modulos/Contactos/Controller/uDoctoresController.pas create mode 100644 Source/Modulos/Contactos/Controller/uPabellonesController.pas create mode 100644 Source/Modulos/Contactos/Model/uBizDoctores.pas create mode 100644 Source/Modulos/Contactos/Model/uBizPabellones.pas create mode 100644 Source/Modulos/Contactos/Views/uEditorDoctores.dfm create mode 100644 Source/Modulos/Contactos/Views/uEditorDoctores.pas create mode 100644 Source/Modulos/Contactos/Views/uEditorPabellones.dfm create mode 100644 Source/Modulos/Contactos/Views/uEditorPabellones.pas diff --git a/Database/scripts/etiquetas.sql b/Database/scripts/etiquetas.sql index 998d5b3..520f134 100644 --- a/Database/scripts/etiquetas.sql +++ b/Database/scripts/etiquetas.sql @@ -101,6 +101,12 @@ SET GENERATOR GEN_ARTICULOS_ID TO 1; CREATE GENERATOR GEN_CATEGORIAS_ID; SET GENERATOR GEN_CATEGORIAS_ID TO 1; +CREATE GENERATOR GEN_DOCTORES_ID; +SET GENERATOR GEN_DOCTORES_ID TO 1; + +CREATE GENERATOR GEN_PABELLONES_ID; +SET GENERATOR GEN_PABELLONES_ID TO 1; + CREATE GENERATOR GEN_CONFIGURACION_ID; SET GENERATOR GEN_CONFIGURACION_ID TO 1; @@ -179,6 +185,15 @@ CREATE TABLE ARTICULOS ( MANO_OBRA TIPO_IMPORTE ); +CREATE TABLE DOCTORES ( + ID TIPO_ID NOT NULL, + DESCRIPCION VARCHAR(255) +); + +CREATE TABLE PABELLONES ( + ID TIPO_ID NOT NULL, + DESCRIPCION VARCHAR(255) +); CREATE TABLE CATEGORIAS ( ID TIPO_ID NOT NULL, @@ -367,7 +382,8 @@ CREATE TABLE PACIENTES_DATOS ( NUMERO_SS VARCHAR(255), FECHA_BAJA DATE, CAUSA_BAJA VARCHAR(255), - PABELLON VARCHAR(255) + PABELLON VARCHAR(255) COLLATE ES_ES, + DOCTOR VARCHAR(255) COLLATE ES_ES ); @@ -578,7 +594,8 @@ CREATE VIEW V_PACIENTES( NUMERO_SS, FECHA_BAJA, CAUSA_BAJA, - PABELLON) + PABELLON, + DOCTOR) AS SELECT V_CONTACTOS.ID, V_CONTACTOS.ID_CATEGORIA, @@ -608,7 +625,8 @@ SELECT V_CONTACTOS.ID, PACIENTES_DATOS.NUMERO_SS, PACIENTES_DATOS.FECHA_BAJA, PACIENTES_DATOS.CAUSA_BAJA, - PACIENTES_DATOS.PABELLON + PACIENTES_DATOS.PABELLON, + PACIENTES_DATOS.DOCTOR FROM V_CONTACTOS INNER JOIN PACIENTES_DATOS ON (PACIENTES_DATOS.ID_PACIENTE = V_CONTACTOS.ID) @@ -621,6 +639,8 @@ WHERE V_CONTACTOS.ID_CATEGORIA = 4 ALTER TABLE ARTICULOS ADD CONSTRAINT PK_ARTICULOS PRIMARY KEY (ID); ALTER TABLE CATEGORIAS ADD CONSTRAINT PK_CATEGORIAS PRIMARY KEY (ID); +ALTER TABLE DOCTORES ADD CONSTRAINT PK_DOCTORES PRIMARY KEY (ID); +ALTER TABLE PABELLONES ADD CONSTRAINT PK_PABELLONES PRIMARY KEY (ID); ALTER TABLE CONFIGURACION ADD CONSTRAINT PK_CONFIGURACION PRIMARY KEY (ID); ALTER TABLE CONTACTOS ADD CONSTRAINT PK_CONTACTOS PRIMARY KEY (ID); ALTER TABLE CONTACTOS_CATEGORIAS ADD CONSTRAINT PK_CONTACTOS_CATEGORIAS PRIMARY KEY (ID_CONTACTO, ID_CATEGORIA); diff --git a/Source/ApplicationBase/Empresas/Views/uEditorEmpresa.dfm b/Source/ApplicationBase/Empresas/Views/uEditorEmpresa.dfm index d8a4ca9..dc260b7 100644 --- a/Source/ApplicationBase/Empresas/Views/uEditorEmpresa.dfm +++ b/Source/ApplicationBase/Empresas/Views/uEditorEmpresa.dfm @@ -17,6 +17,38 @@ inherited fEditorEmpresa: TfEditorEmpresa ExplicitWidth = 674 inherited Image1: TImage Left = 541 + Picture.Data = { + 0B546478504E47496D61676589504E470D0A1A0A0000000D4948445200000018 + 000000180806000000E0773DF8000000017352474200AECE1CE9000000046741 + 4D410000B18F0BFC6105000000206348524D00007A26000080840000FA000000 + 80E8000075300000EA6000003A98000017709CBA513C00000009704859730000 + 17110000171101CA26F33F0000033549444154484BD595FB4F536718C7DD7FA1 + 3FCEEA964ACB1832F0366457334CBC206284C6A843132F2C5B9CC934C4B0856C + D3A0035922A0D6726B6DC2458A23FBC188E8A6162908E5626D8B3DB420B72220 + A228E6E33927A1823D4513E5074FF2F492369FCFF779DE73DEF70360DE9C5E92 + 602E6B4EE1F274A497AADA36E6A26608C42F81EBD9133FC28D23DC2ED36133A7 + E069344EFF39F07972F2391313938C8F3F6574EC090F46C6191C1AA37770944F + D7EC91FEF7B283E9045F7D069D1792692A4CA036F75B6AB2BFC371CB3C43321B + BCBB6F38B440B87E88BB65C97498B7537F66339773D662F93D8ED2742D5EC715 + 5932053F60788C5275F50C290BC6FA6DD82B52B09E4D10E149B2A0E95C12D682 + 0D5CFC630575A6B4005C692C5272097ECFE757160CBA2BB86DDA44A321893B62 + 079ECA5D0895DFE33AAFA3459F40F99FD181998F8C2AA7973A727A06420B5C96 + 147C965DF4D5ECA5A77A3742C50E5190427B6122552713187B348104F70F3FA2 + DFFF90FBFD23787B1FE0E9F6D3D93528C33BDC7DCA82119F957B353FC9506FE5 + 4E84F2EDB8CD3A1C255B68C85FCFE5B2E36F046FBD7B3FF4227BAFE7E1326F93 + 533B4DC9DC294EC2AEDFC0BFD98938ECF5AF4D2EC19B3BBA430B5A856BFC63D4 + D1A04FA459BF8986827558C4DB546F3888DDD536EB58A6E0B636AFB2E0AAF73F + E2CB37A2F95B4DC689755C32FE4851DE36B68A77902AF3237697FE40B3DB1998 + B9EEE74294AABE450816788605F6D71C447B6615AA222D51D951E45E3AC681B2 + 34D4F9E1A80BA3519F5846AA611F75ADB6190B2A256F6AF7D160EFE266B387FF + 1B3B8305558E6A56E6C5139EF7056A5334AAE2257C762A86F0B391A84C5AC28A + 57A0C9896341FA87A416EDC3D1D9AF985EEAE8EA2D57B0E094AD808547971291 + F3359A73ABF8D81CC5C2A23054A5627A630CDAD3AB89C85AC3FCC38BF9FCD897 + B43B7B6971F4042597E0B55667B0A0A2C34264562C6199B17C92FB9538AA5834 + 8695B24C9B1F47C45FDFB028239AF9BF881D94A4C9F0506BA028901E7DABDB46 + AA712F11BFC5A0C98824EC57B1A4F72362A52F252A6B392575D5B32697E08A82 + 57B7DBE9FB8A4B189067FEBAB14CC11505D3F7F2B7852B0AA403E25D57E0C079 + AF0FFD1710958E1DD5F715C50000000049454E44AE426082} ExplicitLeft = 607 end inherited lblDesbloquear: TcxLabel diff --git a/Source/ApplicationBase/Empresas/Views/uEditorEmpresa.pas b/Source/ApplicationBase/Empresas/Views/uEditorEmpresa.pas index 561834c..3699450 100644 --- a/Source/ApplicationBase/Empresas/Views/uEditorEmpresa.pas +++ b/Source/ApplicationBase/Empresas/Views/uEditorEmpresa.pas @@ -13,7 +13,7 @@ uses JvAppStorage, JvAppRegistryStorage, JvFormPlacement, JvComponentBase, uViewEmpresa, uIEditorEmpresa, uEmpresasController, dxLayoutLookAndFeels, JvExComCtrls, JvStatusBar, uViewDetallesGenerico, uViewDatosBancarios, - uDAInterfaces, cxControls, cxContainer, cxEdit, cxLabel; + uDAInterfaces, cxControls, cxContainer, cxEdit, cxLabel, dxGDIPlusClasses; type TfEditorEmpresa = class(TfEditorDBItem, IEditorEmpresa) diff --git a/Source/Cliente/Etiquetas.RES b/Source/Cliente/Etiquetas.RES index 4bc60bfabebac719caf24f055a39b5da5aed5d31..b0c16981a5ac30469e8a1c296ad7785ee9774519 100644 GIT binary patch delta 42 vcmbQTkz>k6j)oS-Eljt>IGGt37#M+=dHQ29rjv}u)7OeK%?47Q5=`Cz2gD0j delta 42 ucmbQTkz>k6j)oS-Eljt>I2nL|5kyRXEXH(_(O~*oai-afM$Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1000FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.0.2.0EtiquetasEtiquetas1.0.2.0Etiquetas.dprFalse +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1030FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.0.3.0EtiquetasEtiquetas1.0.3.0Etiquetas.dprFalse diff --git a/Source/Cliente/Etiquetas.rc b/Source/Cliente/Etiquetas.rc index ab0bf89..bfdf2b2 100644 --- a/Source/Cliente/Etiquetas.rc +++ b/Source/Cliente/Etiquetas.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo farmacia\Resources\Iconos\Etiquetas.ico" 1 VERSIONINFO -FILEVERSION 1,0,0,0 -PRODUCTVERSION 1,0,0,0 +FILEVERSION 1,0,3,0 +PRODUCTVERSION 1,0,3,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "1.0.0.0\0" + VALUE "FileVersion", "1.0.3.0\0" VALUE "InternalName", "Etiquetas\0" VALUE "ProductName", "Etiquetas\0" - VALUE "ProductVersion", "1.0.2.0\0" + VALUE "ProductVersion", "1.0.3.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/uPantallaPrincipal.dfm b/Source/Cliente/uPantallaPrincipal.dfm index f297f26..560e173 100644 --- a/Source/Cliente/uPantallaPrincipal.dfm +++ b/Source/Cliente/uPantallaPrincipal.dfm @@ -317,6 +317,29 @@ object fPantallaPrincipal: TfPantallaPrincipal end object ModulesSmallImageList: TPngImageList PngImages = < + item + PngImage.Data = { + 89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF + 610000000970485973000017120000171201679FD252000001EC4944415478DA + A5934B6813511486BF541B88CD26620DA262A51BDB8520158308D5852055B01B + A3E8CEBD2E7CE063512852D09D2E82E04604AB1B5D4451B059D8A6010D84D842 + 5B6B6B1A8D414A4C9B18EB4C27F3F466D41943ED4233309C3BDC39DFFFDF9F7B + 3C9665D1C8E379323CD510C1061C3DD0697F48C531BEE7A7EDB57F6B072DADBB + 9C1F4DE154D74D34DD70DE43272FB9805AF3975484E56F1A856289C2D23CFB4F + 44D8D4BE17DD30B932A8D629B7358D70F7C1D39F8023FBB6917B35C0D78F590C + 43EC5A06954A8505A5C4B1CB2947F14F07D158D205F48436F03E761E640FEB7C + 3ED660204B3263B9597A2F24ED866B8F59DD414F28C8E7443FDE6A55A883AAA9 + 28F232F3FA7ABA8EDFAC53FEBD1E1A4DBB805A0685370F91E65E0880084BD358 + 9255CCB65EDAF784571E413378F97ABC1E90C8C6C88EDC6687E9150EAAA415D8 + BCFB14DD9D875734D76A2235E102B674A85C1CEEA3B498E374F020A666727F21 + 4E662ECFDBAB19BBB9EFD6B3BA0C423B37BA80A4F188E733A32881327EA91991 + 22924FA7B9E427373B45FADCB4A3ACFD72929E78E702EE1506C8E68B18AD0AEA + 5A595C2F44A02D3495BD7CF8344EF2CC24D7EFC4567770361EA65C2EFCF5AA06 + 0241A2E1215BD5302DBB9AA24ECE645C4077D77606A3F17F9E0307D07F23F2FF + C3D4E838FF008E7263BE13CA147C0000000049454E44AE426082} + Name = 'PngImage2' + Background = clWindow + end item PngImage.Data = { 89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF @@ -371,6 +394,40 @@ object fPantallaPrincipal: TfPantallaPrincipal Height = 24 Width = 24 PngImages = < + item + PngImage.Data = { + 89504E470D0A1A0A0000000D4948445200000018000000180806000000E0773D + F80000000970485973000017120000171201679FD2520000033B4944415478DA + DD957F68565518C73F77EF0FDFBDB9B94DC1214D5BB2FD61A3B0399236D66424 + 96A32874A1329D2D322C7F24686C0D539318FE964419E29F6AFF5810D982821C + BA0D57292846A4AD36B7D770BEEFF6FEBA7BEF3DF7DEB773A72EDFDE3BD71FEE + 1F0F3CDC7378CEF97E9EE73CE79CAB24934926B3298F07E0EB73BF4E0AE5B5AA + 79CA18400EC61C86162270F93043033D986692E9454B99337F459A80695AA37E + FB6B58D6BDF1DDFE2BAB3EE2D277479D01033FED440FFC4E389C60381263C474 + 31B7BC9EE205B5FF4BDCFED6AC6E7406F47535A1057AE5242FD1689C585C9516 + 27AA06A9ACFB9C278B5F1A136F3A2D1CB766D3E2115E5FFB713A203E78893F2F + 1C401D1A91C571CBA9493C2E055DE80C066F93F55429E5CB0F3D34F251B392BC + D9D09C0E08F67C457FF7492CCD853FD38FCFEB41C142681AAAAA72FD763F351F + 768E8A08C364D797CEC57DAF2A46EDBAEDCE80E16B67F0E1C7E3F64821032104 + 42D7D125E47AD8A2BAE1F4B8D15B7666327A43F657AEDF910E880C7413BAF205 + 198961321419BB5C681806868444E30922D32B295DBC7E42717B5CB761977391 + FBBB5AD16E76CAED37B17DA66167A13310715358BD8D1905CF4C286E5BFDE6DD + CE806B7D17E8ED68656622814716591882802AB893534259453D3373674F286E + FBDED9F2593AE07C7F072DDDFBE9BBF51BCBF4222AF29F261009D13674836EF3 + 0ED5854B787FE106F29E98312AD47CF01BC7226F5C5DC5BAAD2DA980E7E64F65 + 5FE711DA035DA8DE30B9A129AC29A9E5AFE19B7C1B6C079F0F821994E79552B7 + E06D0AB2E7A4446E9FAA0733FBA0716F2A80593DECF9F118514610D3E2E8468C + BC58169A5710F70B7C46164AC84B70B097A5C5AFB2B5E2133E3DDAE698C1BB6F + 95B3A9797F2A2090DDC1DE1F5AC9F6E5626427107E699ABC702E175E251377DC + 872BECE3EF500F453905B4BE71EAA1176DCBF603A90033FF0F769FDD879600F7 + 340F56A620E936E569525074372ED5432C1C269618A4A6A4868D658DEC39FEBD + 63060DCB5F4C07BCFC4211576F5DE5F8C513FC7CE3171991B0B5EDD7027999A5 + 2964E678D95CD6C4B3F9A5E3467EBFA5011695CD1D77D1442FE77FC51D0195CF + 173E327147C08E96238FFA87F62F6032DBA403FE011B7940FEE55D65A3000000 + 0049454E44AE426082} + Name = 'PngImage2' + Background = clWindow + end item PngImage.Data = { 89504E470D0A1A0A0000000D4948445200000018000000180806000000E0773D diff --git a/Source/Modulos/Contactos/Controller/Contactos_controller.dpk b/Source/Modulos/Contactos/Controller/Contactos_controller.dpk index 51c6443..318c11a 100644 --- a/Source/Modulos/Contactos/Controller/Contactos_controller.dpk +++ b/Source/Modulos/Contactos/Controller/Contactos_controller.dpk @@ -38,7 +38,17 @@ requires vclx, vclactnband, designide, - ccpackD11; + ccpackD11, + dbrtl, + cxLibraryD11, + dxThemeD11, + dxGDIPlusD11, + dxCoreD11, + RemObjects_Core_D11, + DataAbstract_Core_D11, + vcldb, + dsnap, + adortl; contains uContactosController in 'uContactosController.pas', @@ -58,6 +68,10 @@ contains uPersonalContactoController in 'uPersonalContactoController.pas', uIEditorDireccionContacto in 'View\uIEditorDireccionContacto.pas', uIEditorDatoBancarioContacto in 'View\uIEditorDatoBancarioContacto.pas', - uIEditorPersonalContacto in 'View\uIEditorPersonalContacto.pas'; + uIEditorPersonalContacto in 'View\uIEditorPersonalContacto.pas', + uDoctoresController in 'uDoctoresController.pas', + uIEditorDoctores in 'View\uIEditorDoctores.pas', + uPabellonesController in 'uPabellonesController.pas', + uIEditorPabellones in 'View\uIEditorPabellones.pas'; end. diff --git a/Source/Modulos/Contactos/Controller/Contactos_controller.dproj b/Source/Modulos/Contactos/Controller/Contactos_controller.dproj index eeb6bda..1cfcb11 100644 --- a/Source/Modulos/Contactos/Controller/Contactos_controller.dproj +++ b/Source/Modulos/Contactos/Controller/Contactos_controller.dproj @@ -54,6 +54,15 @@ + + + + + + + + + @@ -74,33 +83,47 @@ + + + + + + + + + + + + + + diff --git a/Source/Modulos/Contactos/Controller/View/uIEditorDoctores.pas b/Source/Modulos/Contactos/Controller/View/uIEditorDoctores.pas new file mode 100644 index 0000000..e29100a --- /dev/null +++ b/Source/Modulos/Contactos/Controller/View/uIEditorDoctores.pas @@ -0,0 +1,23 @@ +unit uIEditorDoctores; + +interface + +uses + uEditorDBBase, uBizDoctores, uDoctoresController; + +type + IEditorDoctores = interface(IEditorDBBase) + ['{E4FD5FEA-9771-40FD-AC69-600BE859ECCE}'] + function GetDoctores: IBizDoctor; + procedure SetDoctores(const Value: IBizDoctor); + property Doctores: IBizDoctor read GetDoctores write SetDoctores; + + function GetController : IDoctoresController; + procedure SetController (const Value : IDoctoresController); + property Controller : IDoctoresController read GetController write SetController; + end; + + +implementation + +end. diff --git a/Source/Modulos/Contactos/Controller/View/uIEditorPabellones.pas b/Source/Modulos/Contactos/Controller/View/uIEditorPabellones.pas new file mode 100644 index 0000000..90b0121 --- /dev/null +++ b/Source/Modulos/Contactos/Controller/View/uIEditorPabellones.pas @@ -0,0 +1,23 @@ +unit uIEditorPabellones; + +interface + +uses + uEditorDBBase, uBizPabellones, uPabellonesController; + +type + IEditorPabellones = interface(IEditorDBBase) + ['{022A7745-22FA-4BD4-A913-6990B3886F96}'] + function GetPabellones: IBizPabellon; + procedure SetPabellones(const Value: IBizPabellon); + property Pabellones: IBizPabellon read GetPabellones write SetPabellones; + + function GetController : IPabellonesController; + procedure SetController (const Value : IPabellonesController); + property Controller : IPabellonesController read GetController write SetController; + end; + + +implementation + +end. diff --git a/Source/Modulos/Contactos/Controller/uDoctoresController.pas b/Source/Modulos/Contactos/Controller/uDoctoresController.pas new file mode 100644 index 0000000..77de0fd --- /dev/null +++ b/Source/Modulos/Contactos/Controller/uDoctoresController.pas @@ -0,0 +1,219 @@ +unit uDoctoresController; + +interface + + +uses + Classes, SysUtils, uDADataTable, uEditorDBItem, + uIDataModulePacientes, uBizDoctores, uControllerBase; + +type + IDoctoresController = interface(IControllerBase) + ['{9466E214-61F1-4ACB-8432-52C946363D2A}'] + function BuscarTodos: IBizDoctor; + procedure VerTodos(ADoctores: IBizDoctor); + procedure Anadir(ADoctores : IBizDoctor); + function Eliminar(ADoctores : IBizDoctor): Boolean; + function Guardar(ADoctores : IBizDoctor): Boolean; + procedure DescartarCambios(ADoctores : IBizDoctor); + function Localizar(ADoctores: IBizDoctor; ADescripcion:String): Boolean; + function DarListaDoctores: TStringList; + end; + + TDoctoresController = class(TControllerBase, IDoctoresController) + protected + FDataModule : IDataModulePacientes; + procedure RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); override; + function CreateEditor(const AName : String; const IID: TGUID; out Intf): Boolean; + function ValidarDoctor(ADoctores: IBizDoctor): Boolean; + procedure AsignarDataModule; virtual; + public + constructor Create; override; + destructor Destroy; override; + + function Eliminar(ADoctores : IBizDoctor): Boolean; + function Guardar(ADoctores : IBizDoctor): Boolean; + procedure DescartarCambios(ADoctores : IBizDoctor); virtual; + procedure Anadir(ADoctores : IBizDoctor); + function BuscarTodos: IBizDoctor; + procedure VerTodos(ADoctores: IBizDoctor); + function Localizar(ADoctores: IBizDoctor; ADescripcion:String): Boolean; + function DarListaDoctores: TStringList; + end; + +implementation + +uses + cxControls, DB, uEditorRegistryUtils, + uIEditorDoctores, uDataModulePacientes, + uDAInterfaces, uDataTableUtils, + uDateUtils, uROTypes, DateUtils, Controls, Windows, schContactosClient_Intf; + +{ TDoctoresController } + +procedure TDoctoresController.Anadir(ADoctores: IBizDoctor); +begin + ADoctores.Insert; +end; + +procedure TDoctoresController.AsignarDataModule; +begin + FDataModule := TDataModulePacientes.Create(Nil); +end; + +function TDoctoresController.BuscarTodos: IBizDoctor; +begin + Result := FDataModule.GetDoctores; +end; + +constructor TDoctoresController.Create; +begin + inherited; + AsignarDataModule; +end; + +function TDoctoresController.CreateEditor(const AName: String; const IID: TGUID; out Intf): Boolean; +begin + Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf); +end; + +function TDoctoresController.DarListaDoctores: TStringList; +var + ADoctores: IBizDoctor; +begin + ADoctores := BuscarTodos; + ADoctores.DataTable.Active := True; + Result := TStringList.Create; + try + with Result do + begin + ADoctores.DataTable.First; + while not ADoctores.DataTable.EOF do + begin + Add(ADoctores.DESCRIPCION); + ADoctores.DataTable.Next; + end; + end; + finally + ADoctores := NIL; + end; +end; + +procedure TDoctoresController.DescartarCambios(ADoctores: IBizDoctor); +begin + if not Assigned(ADoctores) then + raise Exception.Create ('Doctores no asignado'); + + ShowHourglassCursor; + try + if (ADoctores.State in dsEditModes) then + ADoctores.Cancel; + + ADoctores.DataTable.CancelUpdates; + finally + HideHourglassCursor; + end; +end; + +destructor TDoctoresController.Destroy; +begin + FDataModule := Nil; + inherited; +end; + +function TDoctoresController.ValidarDoctor(ADoctores: IBizDoctor): Boolean; +begin + if not Assigned(ADoctores) then + raise Exception.Create ('Doctores no asignada'); + + if (ADoctores.DataTable.State in dsEditModes) then + ADoctores.DataTable.Post; + + if Length(ADoctores.DESCRIPCION) = 0 then + raise Exception.Create('Debe indicar al menos nombre del doctor.'); + + Result := True; +end; + +procedure TDoctoresController.VerTodos(ADoctores: IBizDoctor); +var + AEditor : IEditorDoctores; +begin + AEditor := NIL; + + CreateEditor('EditorDoctores', IEditorDoctores, AEditor); + if Assigned(AEditor) then + try + AEditor.Controller := Self; //OJO ORDEN MUY IMPORTANTE + AEditor.Doctores := ADoctores; + AEditor.ShowModal; + finally + AEditor.Release; + AEditor := NIL; + end; +end; + +function TDoctoresController.Eliminar(ADoctores: IBizDoctor): Boolean; +begin + if not Assigned(ADoctores) then + raise Exception.Create ('ADoctores no asignada'); + + ShowHourglassCursor; + try + if (ADoctores.State in dsEditModes) then + ADoctores.Cancel; + + ADoctores.Delete; + ADoctores.DataTable.ApplyUpdates; + HideHourglassCursor; + Result := True; + finally + HideHourglassCursor; + end; +end; + +procedure TDoctoresController.RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); +begin + inherited; +// +end; + +function TDoctoresController.Guardar(ADoctores: IBizDoctor): Boolean; +begin + Result := False; + + if ValidarDoctor(ADoctores) then + begin + ShowHourglassCursor; + try + if (ADoctores.DataTable.State in dsEditModes) then + ADoctores.DataTable.Post; + + ADoctores.DataTable.ApplyUpdates; + + Result := True; + finally + HideHourglassCursor; + end; + end; +end; + +function TDoctoresController.Localizar(ADoctores: IBizDoctor; ADescripcion: String): Boolean; +begin + Result := True; + ShowHourglassCursor; + try + with ADoctores.DataTable do + begin + DisableControls; + First; + if not Locate(fld_DoctoresDESCRIPCION, ADescripcion, []) then + Result := False; + EnableControls; + end; + finally + HideHourglassCursor; + end; +end; + +end. diff --git a/Source/Modulos/Contactos/Controller/uPabellonesController.pas b/Source/Modulos/Contactos/Controller/uPabellonesController.pas new file mode 100644 index 0000000..2a03ac7 --- /dev/null +++ b/Source/Modulos/Contactos/Controller/uPabellonesController.pas @@ -0,0 +1,219 @@ +unit uPabellonesController; + +interface + + +uses + Classes, SysUtils, uDADataTable, uEditorDBItem, + uIDataModulePacientes, uBizPabellones, uControllerBase; + +type + IPabellonesController = interface(IControllerBase) + ['{DF1530A1-EB37-4DBB-8888-EBE1E06D4141}'] + function BuscarTodos: IBizPabellon; + procedure VerTodos(APabellones: IBizPabellon); + procedure Anadir(APabellones : IBizPabellon); + function Eliminar(APabellones : IBizPabellon): Boolean; + function Guardar(APabellones : IBizPabellon): Boolean; + procedure DescartarCambios(APabellones : IBizPabellon); + function Localizar(APabellones: IBizPabellon; ADescripcion:String): Boolean; + function DarListaPabellones: TStringList; + end; + + TPabellonesController = class(TControllerBase, IPabellonesController) + protected + FDataModule : IDataModulePacientes; + procedure RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); override; + function CreateEditor(const AName : String; const IID: TGUID; out Intf): Boolean; + function ValidarPabellon(APabellones: IBizPabellon): Boolean; + procedure AsignarDataModule; virtual; + public + constructor Create; override; + destructor Destroy; override; + + function Eliminar(APabellones : IBizPabellon): Boolean; + function Guardar(APabellones : IBizPabellon): Boolean; + procedure DescartarCambios(APabellones : IBizPabellon); virtual; + procedure Anadir(APabellones : IBizPabellon); + function BuscarTodos: IBizPabellon; + procedure VerTodos(APabellones: IBizPabellon); + function Localizar(APabellones: IBizPabellon; ADescripcion:String): Boolean; + function DarListaPabellones: TStringList; + end; + +implementation + +uses + cxControls, DB, uEditorRegistryUtils, + uIEditorPabellones, uDataModulePacientes, + uDAInterfaces, uDataTableUtils, + uDateUtils, uROTypes, DateUtils, Controls, Windows, schContactosClient_Intf; + +{ TPabellonesController } + +procedure TPabellonesController.Anadir(APabellones: IBizPabellon); +begin + APabellones.Insert; +end; + +procedure TPabellonesController.AsignarDataModule; +begin + FDataModule := TDataModulePacientes.Create(Nil); +end; + +function TPabellonesController.BuscarTodos: IBizPabellon; +begin + Result := FDataModule.GetPabellones; +end; + +constructor TPabellonesController.Create; +begin + inherited; + AsignarDataModule; +end; + +function TPabellonesController.CreateEditor(const AName: String; const IID: TGUID; out Intf): Boolean; +begin + Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf); +end; + +function TPabellonesController.DarListaPabellones: TStringList; +var + APabellones: IBizPabellon; +begin + APabellones := BuscarTodos; + APabellones.DataTable.Active := True; + Result := TStringList.Create; + try + with Result do + begin + APabellones.DataTable.First; + while not APabellones.DataTable.EOF do + begin + Add(APabellones.DESCRIPCION); + APabellones.DataTable.Next; + end; + end; + finally + APabellones := NIL; + end; +end; + +procedure TPabellonesController.DescartarCambios(APabellones: IBizPabellon); +begin + if not Assigned(APabellones) then + raise Exception.Create ('Pabellones no asignado'); + + ShowHourglassCursor; + try + if (APabellones.State in dsEditModes) then + APabellones.Cancel; + + APabellones.DataTable.CancelUpdates; + finally + HideHourglassCursor; + end; +end; + +destructor TPabellonesController.Destroy; +begin + FDataModule := Nil; + inherited; +end; + +function TPabellonesController.ValidarPabellon(APabellones: IBizPabellon): Boolean; +begin + if not Assigned(APabellones) then + raise Exception.Create ('Pabellones no asignada'); + + if (APabellones.DataTable.State in dsEditModes) then + APabellones.DataTable.Post; + + if Length(APabellones.DESCRIPCION) = 0 then + raise Exception.Create('Debe indicar al menos nombre del pabellón.'); + + Result := True; +end; + +procedure TPabellonesController.VerTodos(APabellones: IBizPabellon); +var + AEditor : IEditorPabellones; +begin + AEditor := NIL; + + CreateEditor('EditorPabellones', IEditorPabellones, AEditor); + if Assigned(AEditor) then + try + AEditor.Controller := Self; //OJO ORDEN MUY IMPORTANTE + AEditor.Pabellones := APabellones; + AEditor.ShowModal; + finally + AEditor.Release; + AEditor := NIL; + end; +end; + +function TPabellonesController.Eliminar(APabellones: IBizPabellon): Boolean; +begin + if not Assigned(APabellones) then + raise Exception.Create ('APabellones no asignada'); + + ShowHourglassCursor; + try + if (APabellones.State in dsEditModes) then + APabellones.Cancel; + + APabellones.Delete; + APabellones.DataTable.ApplyUpdates; + HideHourglassCursor; + Result := True; + finally + HideHourglassCursor; + end; +end; + +procedure TPabellonesController.RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); +begin + inherited; +// +end; + +function TPabellonesController.Guardar(APabellones: IBizPabellon): Boolean; +begin + Result := False; + + if ValidarPabellon(APabellones) then + begin + ShowHourglassCursor; + try + if (APabellones.DataTable.State in dsEditModes) then + APabellones.DataTable.Post; + + APabellones.DataTable.ApplyUpdates; + + Result := True; + finally + HideHourglassCursor; + end; + end; +end; + +function TPabellonesController.Localizar(APabellones: IBizPabellon; ADescripcion: String): Boolean; +begin + Result := True; + ShowHourglassCursor; + try + with APabellones.DataTable do + begin + DisableControls; + First; + if not Locate(fld_PabellonesDESCRIPCION, ADescripcion, []) then + Result := False; + EnableControls; + end; + finally + HideHourglassCursor; + end; +end; + +end. diff --git a/Source/Modulos/Contactos/Data/uDataModulePacientes.dfm b/Source/Modulos/Contactos/Data/uDataModulePacientes.dfm index 0f9abee..244978a 100644 --- a/Source/Modulos/Contactos/Data/uDataModulePacientes.dfm +++ b/Source/Modulos/Contactos/Data/uDataModulePacientes.dfm @@ -1,164 +1,6 @@ inherited DataModulePacientes: TDataModulePacientes Height = 302 Width = 543 - inherited tbl_Contactos: TDAMemDataTable - Fields = < - item - Name = 'ID' - DataType = datAutoInc - GeneratorName = 'GEN_CONTACTOS_ID' - ServerAutoRefresh = True - DictionaryEntry = 'Contactos_ID' - InPrimaryKey = True - end - item - Name = 'ID_CATEGORIA' - DataType = datInteger - end - item - Name = 'NIF_CIF' - DataType = datString - Size = 15 - DisplayLabel = 'NIF/CIF' - DictionaryEntry = 'Contactos_NIF_CIF' - end - item - Name = 'NOMBRE' - DataType = datString - Size = 255 - Required = True - DisplayLabel = 'Nombre' - DictionaryEntry = 'Contactos_NOMBRE' - end - item - Name = 'PERSONA_CONTACTO' - DataType = datString - Size = 255 - DisplayLabel = 'Persona de contacto' - DictionaryEntry = 'Contactos_PERSONA_CONTACTO' - end - item - Name = 'CALLE' - DataType = datString - Size = 255 - DisplayLabel = 'Direcci'#243'n' - DictionaryEntry = 'Contactos_CALLE' - end - item - Name = 'POBLACION' - DataType = datString - Size = 255 - DisplayLabel = 'Poblaci'#243'n' - DictionaryEntry = 'Contactos_POBLACION' - end - item - Name = 'PROVINCIA' - DataType = datString - Size = 255 - DisplayLabel = 'Provincia' - DictionaryEntry = 'Contactos_PROVINCIA' - end - item - Name = 'CODIGO_POSTAL' - DataType = datString - Size = 10 - DisplayLabel = 'C'#243'digo postal' - DictionaryEntry = 'Contactos_CODIGO_POSTAL' - end - item - Name = 'TELEFONO_1' - DataType = datString - Size = 25 - DisplayLabel = 'Tlf. trabajo' - DictionaryEntry = 'Contactos_TELEFONO_1' - end - item - Name = 'TELEFONO_2' - DataType = datString - Size = 25 - DisplayLabel = 'Tlf. particular' - DictionaryEntry = 'Contactos_TELEFONO_2' - end - item - Name = 'MOVIL_1' - DataType = datString - Size = 25 - DisplayLabel = 'M'#243'vil' - DictionaryEntry = 'Contactos_MOVIL_1' - end - item - Name = 'MOVIL_2' - DataType = datString - Size = 25 - DictionaryEntry = 'Contactos_MOVIL_2' - end - item - Name = 'FAX' - DataType = datString - Size = 25 - DisplayLabel = 'Fax' - DictionaryEntry = 'Contactos_FAX' - end - item - Name = 'EMAIL_1' - DataType = datString - Size = 255 - DisplayLabel = 'E-mail trabajo' - DictionaryEntry = 'Contactos_EMAIL_1' - end - item - Name = 'EMAIL_2' - DataType = datString - Size = 255 - DisplayLabel = 'E-mail particular' - DictionaryEntry = 'Contactos_EMAIL_2' - end - item - Name = 'PAGINA_WEB' - DataType = datString - Size = 255 - DisplayLabel = 'Web' - DictionaryEntry = 'Contactos_PAGINA_WEB' - end - item - Name = 'NOTAS' - DataType = datMemo - BlobType = dabtMemo - DisplayLabel = 'Observaciones' - DictionaryEntry = 'Contactos_NOTAS' - end - item - Name = 'FECHA_ALTA' - DataType = datDateTime - DisplayLabel = 'Fecha de alta' - DictionaryEntry = 'Contactos_FECHA_ALTA' - end - item - Name = 'FECHA_MODIFICACION' - DataType = datDateTime - DisplayLabel = 'Fecha de modificaci'#243'n' - DictionaryEntry = 'Contactos_FECHA_MODIFICACION' - end - item - Name = 'USUARIO' - DataType = datString - Size = 20 - DisplayLabel = 'Usuario' - DictionaryEntry = 'Contactos_USUARIO' - end - item - Name = 'ID_EMPRESA' - DataType = datInteger - end - item - Name = 'REFERENCIA' - DataType = datString - Size = 255 - DisplayLabel = 'Referencia' - ServerAutoRefresh = True - DictionaryEntry = 'Contactos_REFERENCIA' - end> - end inherited ds_Contactos: TDADataSource DataSet = tbl_Contactos.Dataset end @@ -365,6 +207,11 @@ inherited DataModulePacientes: TDataModulePacientes Size = 255 DisplayLabel = 'Pabell'#243'n' DictionaryEntry = 'Pacientes_PABELLON' + end + item + Name = 'DOCTOR' + DataType = datString + Size = 255 end> Params = <> StreamingOptions = [soDisableEventsWhileStreaming] @@ -381,4 +228,68 @@ inherited DataModulePacientes: TDataModulePacientes Left = 296 Top = 232 end + object tbl_Doctores: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ID' + DataType = datAutoInc + GeneratorName = 'GEN_DOCTORES_ID' + Required = True + DictionaryEntry = 'Doctores_ID' + InPrimaryKey = True + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 255 + DisplayLabel = 'Doctores_DESCRIPCION' + DictionaryEntry = 'Doctores_DESCRIPCION' + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rda_Contactos + LogicalName = 'Doctores' + IndexDefs = <> + Left = 392 + Top = 224 + end + object ds_Doctores: TDADataSource + DataSet = tbl_Doctores.Dataset + DataTable = tbl_Doctores + Left = 392 + Top = 152 + end + object tbl_Pabellones: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ID' + DataType = datAutoInc + GeneratorName = 'GEN_PABELLONES_ID' + Required = True + DictionaryEntry = 'Pabellones_ID' + InPrimaryKey = True + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 255 + DisplayLabel = 'Pabellones_DESCRIPCION' + DictionaryEntry = 'Pabellones_DESCRIPCION' + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rda_Contactos + LogicalName = 'Pabellones' + IndexDefs = <> + Left = 464 + Top = 224 + end + object ds_Pabellones: TDADataSource + DataSet = tbl_Pabellones.Dataset + DataTable = tbl_Pabellones + Left = 464 + Top = 152 + end end diff --git a/Source/Modulos/Contactos/Data/uDataModulePacientes.pas b/Source/Modulos/Contactos/Data/uDataModulePacientes.pas index a66c850..e6bbbeb 100644 --- a/Source/Modulos/Contactos/Data/uDataModulePacientes.pas +++ b/Source/Modulos/Contactos/Data/uDataModulePacientes.pas @@ -9,17 +9,23 @@ uses uROClient, uROBinMessage, uROWinInetHttpChannel, uROTypes, uIDataModulePacientes, uBizContactos, uDADesigntimeCall, uIDataModuleFichasPacienteReport, uDAInterfaces, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer, - uDARemoteDataAdapter, uIntegerListUtils; + uDARemoteDataAdapter, uIntegerListUtils, uBizDoctores, uBizPabellones; type TDataModulePacientes = class(TDataModuleContactos, IDataModulePacientes, IDataModuleFichasPacienteReport) tbl_Pacientes: TDAMemDataTable; ds_Pacientes: TDADataSource; + tbl_Doctores: TDAMemDataTable; + ds_Doctores: TDADataSource; + tbl_Pabellones: TDAMemDataTable; + ds_Pabellones: TDADataSource; protected public function GetItem(const ID : Integer) : IBizPaciente; function NewItem : IBizPaciente; function GetItems : IBizPaciente; + function GetDoctores : IBizDoctor; + function GetPabellones : IBizPabellon; // Report function GetReport(const ListaID: TIntegerList): Binary; @@ -36,6 +42,20 @@ uses { TDataModuleVendedores } +function TDataModulePacientes.GetDoctores: IBizDoctor; +var + ADoctor : TDAMemDataTable; +begin + ShowHourglassCursor; + try + ADoctor := CloneDataTable(tbl_Doctores); + ADoctor.BusinessRulesID := BIZ_CLIENT_DOCTORES; + Result := (ADoctor as IBizDoctor); + finally + HideHourglassCursor; + end; +end; + function TDataModulePacientes.GetItem(const ID: Integer): IBizPaciente; var Condicion: TDAWhereExpression; @@ -80,6 +100,20 @@ begin end; end; +function TDataModulePacientes.GetPabellones: IBizPabellon; +var + APabellon : TDAMemDataTable; +begin + ShowHourglassCursor; + try + APabellon := CloneDataTable(tbl_Pabellones); + APabellon.BusinessRulesID := BIZ_CLIENT_PABELLONES; + Result := (APabellon as IBizPabellon); + finally + HideHourglassCursor; + end; +end; + function TDataModulePacientes.GetReport(const ListaID: TIntegerList): Binary; var AParam : TIntegerArray; diff --git a/Source/Modulos/Contactos/Model/Contactos_model.dpk b/Source/Modulos/Contactos/Model/Contactos_model.dpk index 60edbe6..cccd09e 100644 --- a/Source/Modulos/Contactos/Model/Contactos_model.dpk +++ b/Source/Modulos/Contactos/Model/Contactos_model.dpk @@ -46,6 +46,8 @@ contains schContactosClient_Intf in 'schContactosClient_Intf.pas', uBizContactosPersonal in 'uBizContactosPersonal.pas', uIDataModulePacientes in 'Data\uIDataModulePacientes.pas', - uIDataModuleFichasPacienteReport in 'Data\uIDataModuleFichasPacienteReport.pas'; + uIDataModuleFichasPacienteReport in 'Data\uIDataModuleFichasPacienteReport.pas', + uBizDoctores in 'uBizDoctores.pas', + uBizPabellones in 'uBizPabellones.pas'; end. diff --git a/Source/Modulos/Contactos/Model/Contactos_model.dproj b/Source/Modulos/Contactos/Model/Contactos_model.dproj index 0b324b5..02ebd60 100644 --- a/Source/Modulos/Contactos/Model/Contactos_model.dproj +++ b/Source/Modulos/Contactos/Model/Contactos_model.dproj @@ -49,15 +49,10 @@ MainSource - - - - - - - - - + + + + @@ -67,14 +62,21 @@ - - + + + + + + + + +