1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665: 666: 667: 668: 669: 670: 671: 672: 673: 674: 675: 676: 677: 678: 679: 680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690: 691: 692: 693: 694: 695: 696: 697: 698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714: 715: 716: 717: 718: 719: 720: 721: 722: 723: 724: 725: 726: 727: 728: 729: 730: 731: 732: 733: 734: 735: 736: 737: 738: 739: 740: 741: 742: 743: 744: 745: 746: 747: 748: 749: 750: 751: 752: 753: 754: 755: 756: 757: 758: 759: 760: 761: 762: 763: 764: 765: 766: 767: 768: 769: 770: 771: 772: 773: 774: 775: 776: 777: 778: 779: 780: 781: 782: 783: 784: 785: 786: 787: 788: 789: 790: 791: 792: 793: 794: 795: 796: 797: 798: 799: 800: 801: 802: 803: 804: 805: 806: 807: 808: 809: 810: 811: 812: 813: 814: 815: 816: 817: 818: 819: 820: 821: 822: 823: 824: 825: 826: 827: 828: 829: 830: 831: 832: 833: 834: 835: 836: 837: 838: 839: 840: 841: 842: 843: 844: 845: 846: 847: 848: 849: 850: 851: 852: 853: 854: 855: 856: 857: 858: 859: 860: 861: 862: 863: 864: 865: 866: 867: 868: 869: 870: 871: 872: 873: 874: 875: 876: 877: 878: 879: 880: 881: 882: 883: 884: 885: 886: 887: 888: 889: 890: 891: 892: 893: 894: 895: 896: 897: 898: 899: 900: 901: 902: 903: 904: 905: 906: 907: 908: 909: 910: 911: 912: 913: 914: 915: 916: 917: 918: 919: 920: 921: 922: 923: 924: 925: 926: 927: 928: 929: 930: 931: 932: 933: 934: 935: 936: 937: 938: 939: 940: 941: 942: 943: 944: 945: 946: 947: 948: 949: 950: 951: 952: 953: 954: 955: 956: 957: 958: 959: 960: 961: 962: 963: 964: 965: 966: 967: 968: 969: 970: 971: 972: 973: 974: 975: 976: 977: 978: 979: 980: 981: 982: 983: 984: 985: 986: 987: 988: 989: 990: 991: 992: 993: 994: 995: 996: 997: 998: 999: 1000: 1001: 1002: 1003: 1004: 1005: 1006: 1007: 1008: 1009: 1010: 1011: 1012: 1013: 1014: 1015: 1016: 1017: 1018: 1019: 1020: 1021: 1022: 1023: 1024: 1025: 1026: 1027: 1028: 1029: 1030: 1031: 1032: 1033: 1034: 1035: 1036: 1037: 1038: 1039: 1040: 1041: 1042: 1043: 1044: 1045: 1046: 1047: 1048: 1049: 1050: 1051: 1052: 1053: 1054: 1055: 1056: 1057: 1058: 1059: 1060: 1061: 1062: 1063: 1064: 1065: 1066: 1067: 1068: 1069: 1070: 1071: 1072: 1073: 1074: 1075: 1076: 1077: 1078: 1079: 1080: 1081: 1082: 1083: 1084: 1085: 1086: 1087: 1088: 1089: 1090: 1091: 1092: 1093: 1094: 1095: 1096: 1097: 1098: 1099: 1100: 1101: 1102: 1103: 1104: 1105: 1106: 1107: 1108: 1109: 1110: 1111: 1112: 1113: 1114: 1115: 1116: 1117: 1118: 1119: 1120: 1121: 1122: 1123: 1124: 1125: 1126: 1127: 1128: 1129: 1130: 1131: 1132: 1133: 1134: 1135: 1136: 1137: 1138: 1139: 1140: 1141: 1142: 1143: 1144: 1145: 1146: 1147: 1148: 1149: 1150: 1151: 1152: 1153: 1154: 1155: 1156: 1157: 1158: 1159: 1160: 1161: 1162: 1163: 1164: 1165: 1166: 1167: 1168: 1169: 1170: 1171: 1172: 1173: 1174: 1175: 1176: 1177: 1178: 1179: 1180: 1181: 1182: 1183: 1184: 1185: 1186: 1187: 1188: 1189: 1190: 1191: 1192: 1193: 1194: 1195: 1196: 1197: 1198: 1199: 1200: 1201: 1202: 1203: 1204: 1205: 1206: 1207: 1208: 1209: 1210: 1211: 1212: 1213: 1214: 1215: 1216: 1217: 1218: 1219: 1220: 1221: 1222: 1223: 1224: 1225: 1226: 1227: 1228: 1229: 1230: 1231: 1232: 1233: 1234: 1235: 1236: 1237: 1238: 1239: 1240: 1241: 1242: 1243: 1244: 1245: 1246: 1247: 1248: 1249: 1250: 1251: 1252: 1253: 1254: 1255: 1256: 1257: 1258: 1259: 1260: 1261: 1262: 1263: 1264: 1265: 1266: 1267: 1268: 1269: 1270: 1271: 1272: 1273: 1274: 1275: 1276: 1277: 1278: 1279: 1280: 1281: 1282: 1283: 1284: 1285: 1286: 1287: 1288: 1289: 1290: 1291: 1292: 1293: 1294: 1295: 1296: 1297: 1298: 1299: 1300: 1301: 1302: 1303: 1304: 1305: 1306: 1307: 1308: 1309: 1310: 1311: 1312: 1313: 1314: 1315: 1316: 1317: 1318: 1319: 1320: 1321: 1322: 1323: 1324: 1325: 1326: 1327: 1328: 1329: 1330: 1331: 1332: 1333: 1334: 1335: 1336: 1337: 1338: 1339: 1340: 1341: 1342: 1343: 1344: 1345: 1346: 1347: 1348: 1349: 1350: 1351: 1352: 1353: 1354: 1355: 1356: 1357: 1358: 1359: 1360: 1361: 1362: 1363: 1364: 1365: 1366: 1367: 1368: 1369: 1370: 1371: 1372: 1373: 1374: 1375: 1376: 1377: 1378: 1379: 1380: 1381: 1382: 1383: 1384: 1385: 1386: 1387: 1388: 1389: 1390: 1391: 1392: 1393: 1394: 1395: 1396: 1397: 1398: 1399: 1400: 1401: 1402: 1403: 1404: 1405: 1406: 1407: 1408: 1409: 1410: 1411: 1412: 1413: 1414: 1415: 1416: 1417: 1418: 1419: 1420: 1421: 1422: 1423: 1424: 1425: 1426: 1427: 1428: 1429: 1430: 1431: 1432: 1433: 1434: 1435: 1436: 1437: 1438: 1439: 1440: 1441: 1442: 1443: 1444: 1445: 1446: 1447: 1448: 1449: 1450: 1451: 1452: 1453: 1454: 1455: 1456: 1457: 1458: 1459: 1460: 1461: 1462: 1463: 1464: 1465: 1466: 1467: 1468: 1469: 1470: 1471: 1472: 1473: 1474: 1475: 1476: 1477: 1478: 1479: 1480: 1481: 1482: 1483: 1484: 1485: 1486: 1487: 1488: 1489: 1490: 1491: 1492: 1493: 1494: 1495: 1496: 1497: 1498: 1499: 1500: 1501: 1502: 1503: 1504: 1505: 1506: 1507: 1508: 1509: 1510: 1511: 1512: 1513: 1514: 1515: 1516: 1517: 1518: 1519: 1520: 1521: 1522: 1523: 1524: 1525: 1526: 1527: 1528: 1529: 1530: 1531: 1532: 1533: 1534: 1535: 1536: 1537: 1538: 1539: 1540: 1541: 1542: 1543: 1544: 1545: 1546: 1547: 1548: 1549: 1550: 1551: 1552: 1553: 1554: 1555: 1556: 1557: 1558: 1559: 1560: 1561: 1562: 1563: 1564: 1565: 1566: 1567: 1568: 1569: 1570: 1571: 1572: 1573: 1574: 1575: 1576: 1577: 1578: 1579: 1580: 1581: 1582: 1583: 1584: 1585: 1586: 1587: 1588: 1589: 1590: 1591: 1592: 1593: 1594: 1595: 1596: 1597: 1598: 1599: 1600: 1601: 1602: 1603: 1604: 1605: 1606: 1607: 1608: 1609: 1610: 1611: 1612: 1613: 1614: 1615: 1616: 1617: 1618: 1619: 1620: 1621: 1622: 1623: 1624: 1625: 1626: 1627: 1628: 1629: 1630: 1631: 1632: 1633: 1634: 1635: 1636: 1637: 1638: 1639: 1640: 1641: 1642: 1643: 1644: 1645: 1646: 1647:
| unit Main_Unit;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, jpeg, ExtCtrls, StdCtrls, RpDefine, RpRave, Buttons, RpCon, RpConDS, DB, Grids, DBGrids, DBClient, RpBase, RpSystem, RpFiler, RpRenderPrinter, RpRender, RpRenderCanvas, RpRenderPreview, ComCtrls, DBTables, IniFiles, logging;
type TMain_Window = class(TForm) Image1: TImage; Image3: TImage; Image4: TImage; Image5: TImage; Image6: TImage; Image7: TImage; Image8: TImage; Image9: TImage; Image10: TImage; TitleBar_Label: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5k: TLabel; Label6: TLabel; Label7: TLabel; Site_TitleLine: TLabel; Label9: TLabel; Image17: TImage; Image12: TImage; Image13: TImage; Image14: TImage; Image15: TImage; Label8: TLabel; Label10: TLabel; Label11: TLabel; Label5: TLabel; Image11: TImage; Label12: TLabel; Neue: TLabel; Label13: TLabel; Label15: TLabel; Image16: TImage; ErrorMessage: TPanel; Image18: TImage; SpeedButton1: TSpeedButton; ErrorText: TLabel; DataSource1: TDataSource; ClientDataSet1: TClientDataSet; ClientDataSet2: TClientDataSet; ClientDataSet3: TClientDataSet; ClientDataSet4: TClientDataSet; ClientDataSet5: TClientDataSet; ClientDataSet6: TClientDataSet; ClientDataSet7: TClientDataSet; ClientDataSet1EinheitenID: TAutoIncField; ClientDataSet1Einheit_Name: TStringField; ClientDataSet1Einheit_HALNr: TStringField; ClientDataSet2HauptabschnittID: TAutoIncField; ClientDataSet2Hauptabschnitt_Nummer: TIntegerField; ClientDataSet2Hauptabschnitt_Bezeichnung: TStringField; ClientDataSet3PersonID: TAutoIncField; ClientDataSet3Person_Dienstgrad: TStringField; ClientDataSet3Person_Vorname: TStringField; ClientDataSet3Person_Nachname: TStringField; ClientDataSet4MaterialArtID: TAutoIncField; ClientDataSet4MaterialArt_Bezeichnung: TStringField; ClientDataSet4MaterialArt_VersNr: TStringField; ClientDataSet4MaterialArt_BZE: TStringField; ClientDataSet4MaterialArt_Hersteller: TStringField; ClientDataSet4MaterialArt_AnlBlAAN: TStringField; ClientDataSet5MaterialID: TAutoIncField; ClientDataSet5MaterialArtID: TIntegerField; ClientDataSet5Material_Werksnummer: TStringField; ClientDataSet6MALID: TAutoIncField; ClientDataSet6PersonID: TIntegerField; ClientDataSet6MAL_AusgabeDatum: TDateField; ClientDataSet6MAL_RueckgabeDatum: TDateField; ClientDataSet6MAL_Anzahl: TIntegerField; ClientDataSet7MVGID: TAutoIncField; ClientDataSet7MVG_Bezeichnung: TStringField; ClientDataSet7MVG_VersNr: TStringField; ClientDataSet7MVG_Anzahl: TIntegerField; ClientDataSet7MVG_BZE: TStringField; ClientDataSet7MVG_Lagerort: TStringField; ClientDataSet7MVG_Bemerkung: TStringField; ClientDataSet3HauptabschnittID: TIntegerField; ClientDataSet3Person_Hauptabschnitt: TIntegerField; ClientDataSet2EinheitenID: TIntegerField; ClientDataSet2Hauptabschnitt_Einheit: TStringField; Image2: TImage; ClientDataSet6MAL_PersonVorname: TStringField; ClientDataSet6MAL_PersonDG: TStringField; ClientDataSet6MAL_PersonNachname: TStringField; ClientDataSet6MAL_PersonHA: TIntegerField; ClientDataSet3Person_Einheit: TStringField; ClientDataSet6MAL_PersonEinheit: TStringField; ClientDataSet5Material_MaterialArt: TStringField; AboutPanel1: TPanel; ClientDataSet6MaterialArt_ID: TIntegerField; ClientDataSet6MaterialArt_Bezeichnung: TStringField; ClientDataSet6MaterialArt_VersNr: TStringField; ClientDataSet6MaterialArt_BZE: TStringField; ClientDataSet6MaterialWerksNr: TStringField; Config_Panel1: TPanel; Label14: TLabel; SpeedButton2: TSpeedButton; SelectMALPersonPanel: TPanel; Label16: TLabel; SpeedButton3: TSpeedButton; SpeedButton4: TSpeedButton; ComboBox1: TComboBox; Label17: TLabel; Label21: TLabel; Label22: TLabel; Label20: TLabel; Label18: TLabel; Label19: TLabel; Bevel1: TBevel; Label23: TLabel; CheckBox1: TCheckBox; FoundForPrint: TStringGrid; ReadyForPrint: TStringGrid; SpeedButton5: TSpeedButton; SpeedButton6: TSpeedButton; SpeedButton7: TSpeedButton; SpeedButton8: TSpeedButton; Bevel2: TBevel; DBContent: TStringGrid; Bevel3: TBevel; Label24: TLabel; Edit1: TEdit; Edit2: TEdit; Benu: TLabel; Label25: TLabel; Label26: TLabel; Edit3: TEdit; SpeedButton9: TSpeedButton; Label27: TLabel; Bevel4: TBevel; Label28: TLabel; SpeedButton10: TSpeedButton; SpeedButton11: TSpeedButton; ComboBox2: TComboBox; RichEdit1: TRichEdit; procedure RichEdit1SelectionChange(Sender: TObject); procedure SpeedButton10Click(Sender: TObject); procedure SpeedButton9Click(Sender: TObject); procedure SpeedButton8Click(Sender: TObject); procedure ReadyForPrintSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); procedure FoundForPrintSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); procedure SpeedButton5Click(Sender: TObject); procedure SpeedButton7Click(Sender: TObject); procedure SpeedButton6Click(Sender: TObject); procedure ComboBox1Change(Sender: TObject); Procedure CheckBox1Click(Sender: TObject); procedure SpeedButton3Click(Sender: TObject); procedure SpeedButton4Click(Sender: TObject); procedure TitleBar_LabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure TitleBar_LabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure SpeedButton2Click(Sender: TObject); procedure Image14Click(Sender: TObject); procedure Label15Click(Sender: TObject); procedure Label13Click(Sender: TObject); procedure NeueClick(Sender: TObject); procedure Label12Click(Sender: TObject); procedure Label11Click(Sender: TObject); procedure Label8Click(Sender: TObject); procedure Label10Click(Sender: TObject); procedure Image12Click(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure Image16Click(Sender: TObject); procedure Image16MouseLeave(Sender: TObject); procedure Image16MouseEnter(Sender: TObject); procedure Label5MouseLeave(Sender: TObject); procedure Label5MouseEnter(Sender: TObject); procedure Label5Click(Sender: TObject); procedure Label8MouseLeave(Sender: TObject); procedure Label8MouseEnter(Sender: TObject); procedure Image15MouseLeave(Sender: TObject); procedure Image15MouseEnter(Sender: TObject); procedure Image15Click(Sender: TObject); procedure Image14MouseLeave(Sender: TObject); procedure Image14MouseEnter(Sender: TObject); procedure Image13MouseEnter(Sender: TObject); procedure Image13MouseLeave(Sender: TObject); procedure Image12MouseLeave(Sender: TObject); procedure Image12MouseEnter(Sender: TObject); procedure Image17MouseLeave(Sender: TObject); procedure Image17MouseEnter(Sender: TObject); procedure Image13Click(Sender: TObject); procedure Image17Click(Sender: TObject); procedure Label4Click(Sender: TObject); procedure Label3Click(Sender: TObject); procedure Label2Click(Sender: TObject); procedure Label1Click(Sender: TObject); procedure Label4MouseEnter(Sender: TObject); procedure Label4MouseLeave(Sender: TObject); procedure Label3MouseLeave(Sender: TObject); procedure Label3MouseEnter(Sender: TObject); procedure Label2MouseEnter(Sender: TObject); procedure Label2MouseLeave(Sender: TObject); procedure Label1MouseLeave(Sender: TObject); procedure Label1MouseEnter(Sender: TObject); procedure TitleBar_LabelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure FormCreate(Sender: TObject); procedure Image6Click(Sender: TObject); procedure Image6MouseLeave(Sender: TObject); procedure Image6MouseEnter(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure UpdateDBContent(ID: Integer); function LoadImg(highlight: Boolean; Img: TImage) : Boolean; function SetTab(TabID: Integer): Boolean; function UpdateReport(): Integer; function RaiseErrorWindow(i_err: Integer): Boolean; function SwitchComponentState(b_toState: Boolean;s_Objekt: String): Boolean; function createDatabase_DataSet(s_Datas: String):Boolean; function InitializeSelectorPanel(): Boolean; function LoadDBContent(ID: Integer): Integer; function f_DataCrypt(aString: String):String; function f_DataEncrypt(aString: String):String;
private public end;
var Main_Window: TMain_Window; i_xOld, i_yOld,i_SeitenAnzahl,i_RowCount,i_x,i_y,PersID,i_SelRowa,i_SelRowb: Integer ; numberOlds : Integer = 0; MoveAllow: Boolean = False; selend: Boolean = False; ProgrammDir: String; UseraddLog: TLog; UseraddLogData: TLogData; a_Name: array[0..6] of String; a_PrintData: array [0..255,0..16] of String; a_toPrint: array [0..255,0..16] of String; a_print : array of String; i_RowsPerPage: Integer = 13; implementation
uses Login_Unit, Unit1, Unit2;
{$R *.dfm}
function TMain_Window.f_DataCrypt(aString: String):String; var s,s_Pal: String; i: Integer; begin s:=aString; showmessage(s); for i:=1 to length(s) do s[i]:=char(23 Xor Ord(s[i])); s_Pal:=''; for I := Length(s) downto 1 do s_Pal := s_Pal + s[i]; Result:=s_Pal; end;
function TMain_Window.f_DataEncrypt(aString: String):String; var s,s_Pal: String; i: Integer; begin s:=aString; for i:=1 to length(s) do s[i]:=char(23 Xor ord(s[i])); s_Pal:=''; for I := Length(s) downto 1 do s_Pal := s_Pal + s[i]; showmessage(s_Pal); Result:=s_Pal; end;
function TMain_Window.LoadDBContent(ID: Integer): Integer; var i_RowsInList,db_x,db_y : Integer; begin i_RowsInList := 0; for db_x := 0 to DBContent.RowCount - 1 do for db_y := 0 to DBContent.ColCount - 1 do DBContent.Cells[db_y,db_x] := ''; DBContent.RowCount := 2;
With DBContent do begin case ID of 1 : begin db_y := ColCount - 1; db_x := 0; ClientDataSet1.First; Cells[0,0] := 'Einheit Name'; Cells[1,0] := 'HAL Nummer';
while not ClientDataSet1.Eof do begin Inc(db_x,1); if db_x > RowCount - 1 then RowCount := RowCount + 1; Cells[0,db_x] := ClientDataSet1Einheit_Name.Value; Cells[1,db_x] := ClientDataSet1Einheit_HALNr.Value; ClientDataSet1.Next; end; end; 2 : begin db_y := ColCount - 1; db_x := 0; ClientDataSet2.First; Cells[0,0] := 'Hauptabschnitt'; Cells[1,0] := 'Beschreibung'; Cells[2,0] := 'Einheit';
while not ClientDataSet2.Eof do begin Inc(db_x,1); if db_x > RowCount - 1 then RowCount := RowCount + 1; Cells[0,db_x] := IntToStr(ClientDataSet2Hauptabschnitt_Nummer.Value); Cells[1,db_x] := ClientDataSet2Hauptabschnitt_Bezeichnung.Value; Cells[2,db_x] := ClientDataSet2Hauptabschnitt_Einheit.Value; ClientDataSet2.Next; end; end; 3 : begin db_y := ColCount - 1; db_x := 0; ClientDataSet3.First; Cells[0,0] := 'Dienstgrad'; Cells[1,0] := 'Vorname'; Cells[2,0] := 'Nachname'; Cells[3,0] := 'Hauptabschnitt'; Cells[4,0] := 'Einheit';
while not ClientDataSet3.Eof do begin Inc(db_x,1); if db_x > RowCount - 1 then RowCount := RowCount + 1; Cells[0,db_x] := ClientDataSet3Person_Dienstgrad.Value; Cells[1,db_x] := ClientDataSet3Person_Vorname.Value; Cells[2,db_x] := ClientDataSet3Person_Nachname.Value; if ClientDataSet3Person_Hauptabschnitt.Value = 0 then Cells[3,db_x] := 'Schiffsführung' else Cells[3,db_x] := IntToStr(ClientDataSet3Person_Hauptabschnitt.Value);
Cells[4,db_x] := ClientDataSet3Person_Einheit.Value; ClientDataSet3.Next; end; end; 4 : begin db_y := ColCount - 1; db_x := 0; ClientDataSet4.First; Cells[0,0] := 'VersNr'; Cells[1,0] := 'VersBez'; Cells[2,0] := 'BZE'; Cells[3,0] := 'Hersteller'; Cells[4,0] := 'AnlBlAAN';
while not ClientDataSet4.Eof do begin Inc(db_x,1); if db_x > RowCount - 1 then RowCount := RowCount + 1; Cells[0,db_x] := ClientDataSet4MaterialArt_VersNr.Value; Cells[1,db_x] := ClientDataSet4MaterialArt_Bezeichnung.Value; Cells[2,db_x] := ClientDataSet4MaterialArt_BZE.Value; Cells[3,db_x] := ClientDataSet4MaterialArt_Hersteller.Value; Cells[4,db_x] := ClientDataSet4MaterialArt_AnlBlAAN.Value; ClientDataSet4.Next; end; end; 5 : begin db_y := ColCount - 1; db_x := 0; ClientDataSet5.First; Cells[0,0] := 'VersBez'; Cells[1,0] := 'Werknummer';
while not ClientDataSet5.Eof do begin Inc(db_x,1); if db_x > RowCount - 1 then RowCount := RowCount + 1; Cells[0,db_x] := ClientDataSet5Material_MaterialArt.Value; Cells[1,db_x] := ClientDataSet5Material_Werksnummer.Value; ClientDataSet5.Next; end; end; 6 : begin db_y := ColCount - 1; db_x := 0; ClientDataSet6.First; Cells[0,0] := 'Dienstgrad'; Cells[1,0] := 'Vorname'; Cells[2,0] := 'Nachname'; Cells[3,0] := 'VersNr'; Cells[4,0] := 'VersBez'; Cells[5,0] := 'BZE'; Cells[6,0] := 'Menge'; Cells[7,0] := 'WerkNr'; Cells[8,0] := 'Ausgabe'; Cells[9,0] := 'Rückgabe';
while not ClientDataSet6.Eof do begin Inc(db_x,1); if db_x > RowCount - 1 then RowCount := RowCount + 1; Cells[0,db_x] := ClientDataSet6MAL_PersonDG.Value; Cells[1,db_x] := ClientDataSet6MAL_PersonVorname.Value; Cells[2,db_x] := ClientDataSet6MAL_PersonNachname.Value; Cells[3,db_x] := ClientDataSet6MaterialArt_VersNr.Value; Cells[4,db_x] := ClientDataSet6MaterialArt_Bezeichnung.Value; Cells[5,db_x] := ClientDataSet6MaterialArt_BZE.Value; Cells[6,db_x] := IntToStr(ClientDataSet6MAL_Anzahl.Value); Cells[7,db_x] := ClientDataSet6MaterialWerksNr.Value; if not ClientDataSet6MAL_AusgabeDatum.IsNull then Cells[8,db_x] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value) else Cells[8,db_x] := ''; if not ClientDataSet6MAL_RueckgabeDatum.IsNull then Cells[9,db_x] := DateToStr(ClientDataSet6MAL_RueckgabeDatum.Value) else Cells[9,db_x] := ''; ClientDataSet6.Next; end; end; 7 : begin db_y := ColCount - 1; db_x := 0; ClientDataSet7.First; Cells[0,0] := 'VersNr'; Cells[1,0] := 'VersBez'; Cells[2,0] := 'BZE'; Cells[3,0] := 'Menge'; Cells[4,0] := 'Lagerort'; Cells[5,0] := 'Beschreibung';
while not ClientDataSet7.Eof do begin Inc(db_x,1); if db_x > RowCount - 1 then RowCount := RowCount + 1; Cells[0,db_x] := ClientDataSet7MVG_VersNr.Value; Cells[1,db_x] := ClientDataSet7MVG_Bezeichnung.Value; Cells[2,db_x] := ClientDataSet7MVG_BZE.Value; Cells[3,db_x] := IntToStr(ClientDataSet7MVG_Anzahl.Value); Cells[4,db_x] := ClientDataSet7MVG_Lagerort.Value; Cells[5,db_x] := ClientDataSet7MVG_Bemerkung.Value; ClientDataSet7.Next; end; end; end; end; end;
procedure TMain_Window.UpdateDBContent(ID: Integer); begin With DBContent do begin case ID of 1 : begin ColCount := 2; ColWidths[0] := 200; ColWidths[1] := 200; end; 2 : begin ColCount := 3; ColWidths[0] := 100; ColWidths[1] := 300; ColWidths[2] := 200; end; 3 : begin ColCount := 5; ColWidths[0] := 100; ColWidths[1] := 100; ColWidths[2] := 100; ColWidths[3] := 100; ColWidths[4] := 200; end; 4 : begin ColCount := 5; ColWidths[0] := 200; ColWidths[1] := 200; ColWidths[2] := 70; ColWidths[3] := 100; ColWidths[4] := 150; end; 5 : begin ColCount := 2; ColWidths[0] := 200; ColWidths[1] := 200; end; 6 : begin ColCount := 10; ColWidths[0] := 80; ColWidths[1] := 100; ColWidths[2] := 100; ColWidths[3] := 100; ColWidths[4] := 150; ColWidths[5] := 40; ColWidths[6] := 40; ColWidths[7] := 100; ColWidths[8] := 90; ColWidths[9] := 90; end; 7 : begin ColCount := 6; ColWidths[0] := 100; ColWidths[1] := 100; ColWidths[2] := 70; ColWidths[3] := 70; ColWidths[4] := 80; ColWidths[5] := 300; end; end; end; LoadDBContent(ID); end;
function TMain_Window.InitializeSelectorPanel(): Boolean; begin Result:=False; ComboBox1.Items.Clear; ClientDataSet3.First; while not ClientDataSet3.Eof do begin ComboBox1.Items.Add(ClientDataSet3Person_Nachname.Value); ClientDataSet3.Next; end; if ComboBox1.Items.Count > 0 then begin ComboBox1.ItemIndex:=0; Result:=True; end else begin Result:=False; RaiseErrorWindow(3); end; With (FoundForPrint) do begin ColCount := 9; ColWidths[0]:= 20; ColWidths[1]:= 100; ColWidths[2]:= 125; ColWidths[3]:= 40; ColWidths[4]:= 50; ColWidths[5]:= 100; ColWidths[6]:= 104; ColWidths[7]:= 70; ColWidths[8]:= 70; Cells[0,0] := 'ID'; Cells[1,0] := 'VersNr'; Cells[2,0] := 'VersBez'; Cells[3,0] := 'BZE'; Cells[4,0] := 'Menge'; Cells[5,0] := 'AnlBlAAN'; Cells[6,0] := 'WerkNr'; Cells[7,0]:= 'Ausgabe'; Cells[8,0] := 'Rückgabe'; end; With (ReadyForPrint) do begin ColCount := 9; ColWidths[0]:= 20; ColWidths[1]:= 100; ColWidths[2]:= 125; ColWidths[3]:= 40; ColWidths[4]:= 50; ColWidths[5]:= 100; ColWidths[6]:= 104; ColWidths[7]:= 70; ColWidths[8]:= 70; Cells[0,0] := 'ID'; Cells[1,0] := 'VersNr'; Cells[2,0] := 'VersBez'; Cells[3,0] := 'BZE'; Cells[4,0] := 'Menge'; Cells[5,0] := 'AnlBlAAN'; Cells[6,0] := 'WerkNr'; Cells[7,0]:= 'Ausgabe'; Cells[8,0] := 'Rückgabe'; end; end;
procedure TMain_Window.CheckBox1Click(Sender: TObject); begin ComboBox1Change(Sender); end;
procedure TMain_Window.ComboBox1Change(Sender: TObject); var Nmbr,I,x,y,i_FoundedRows: Integer; o_ChkBox: array [0..255] of TCheckBox; xa,ya: Integer; begin
ClientDataSet3.First; while not ClientDataSet3.Eof do begin if ClientDataSet3Person_Nachname.Value=ComboBox1.Text then begin PersID := ClientDataSet3PersonID.Value; a_Name[0] := '1'; a_Name[1] := '1'; a_Name[2] := ClientDataSet3Person_Einheit.Value; if ClientDataSet3Person_Hauptabschnitt.Value=0 then a_Name[3]:='Schiffsführung' else a_Name[3] := IntToStr(ClientDataSet3Person_Hauptabschnitt.Value); a_Name[4] := ClientDataSet3Person_Dienstgrad.Value; a_Name[5] := ClientDataSet3Person_Nachname.Value; a_Name[6] := ClientDataSet3Person_Vorname.Value; Label20.Caption:='Dienstgrad : '+ClientDataSet3Person_Dienstgrad.Value; Label18.Caption:='Name : '+ClientDataSet3Person_Nachname.Value; Label19.Caption:='Vorname : '+ClientDataSet3Person_Vorname.Value; Label21.Caption:='Hauptabschnitt : '+IntToStr(ClientDataSet3Person_Hauptabschnitt.Value); Label22.Caption:='Einheit : '+ClientDataSet3Person_Einheit.Value; end; ClientDataSet3.Next; end; ClientDataSet6.First; With FoundForPrint do begin for i_FoundedRows := 1 to RowCount - 1 do for Nmbr := 0 to 8 do begin Cells[Nmbr,i_FoundedRows] := ''; end; RowCount := 2; end; With ReadyForPrint do begin for i_FoundedRows := 1 to RowCount - 1 do for Nmbr := 0 to 8 do begin Cells[Nmbr,i_FoundedRows] := ''; end; RowCount := 2; end; Nmbr:= 0; i_FoundedRows := 0; for xa := 0 to 255 do for ya := 0 to 16 do a_PrintData[xa,ya] := ''; while not ClientDataSet6.Eof do begin if ClientDataSet6PersonID.Value = PersID then begin if CheckBox1.Checked then begin if ClientDataSet6MAL_RueckgabeDatum.IsNull then begin With FoundForPrint do begin i_FoundedRows := i_FoundedRows + 1; if i_FoundedRows > FoundForPrint.RowCount -1 then FoundForPrint.RowCount := FoundForPrint.RowCount + 1; Cells[0,i_FoundedRows] := IntToStr(ClientDataSet6MALID.Value); Cells[1,i_FoundedRows] := ClientDataSet6MaterialArt_VersNr.Value; Cells[2,i_FoundedRows] := ClientDataSet6MaterialArt_Bezeichnung.Value; Cells[3,i_FoundedRows] := ClientDataSet6MaterialArt_BZE.Value; Cells[4,i_FoundedRows] := IntToStr(ClientDataSet6MAL_Anzahl.Value); Cells[5,i_FoundedRows] := ''; Cells[6,i_FoundedRows] := ClientDataSet6MaterialWerksNr.Value; Cells[7,i_FoundedRows] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value); Cells[8,i_FoundedRows] := ''; end; end; end else begin With FoundForPrint do begin i_FoundedRows := i_FoundedRows + 1; if i_FoundedRows > FoundForPrint.RowCount -1 then FoundForPrint.RowCount := FoundForPrint.RowCount + 1; Cells[0,i_FoundedRows] := IntToStr(ClientDataSet6MALID.Value); Cells[1,i_FoundedRows] := ClientDataSet6MaterialArt_VersNr.Value; Cells[2,i_FoundedRows] := ClientDataSet6MaterialArt_Bezeichnung.Value; Cells[3,i_FoundedRows] := ClientDataSet6MaterialArt_BZE.Value; Cells[4,i_FoundedRows] := IntToStr(ClientDataSet6MAL_Anzahl.Value); Cells[5,i_FoundedRows] := ''; Cells[6,i_FoundedRows] := ClientDataSet6MaterialWerksNr.Value; Cells[7,i_FoundedRows] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value); if not ClientDataSet6MAL_RueckgabeDatum.IsNull then Cells[8,i_FoundedRows] := DateToStr(ClientDataSet6MAL_RueckgabeDatum.Value) else Cells[8,i_FoundedRows] := ''; end; end; end; ClientDataSet6.Next; end; ReadyForPrint.RowCount := FoundForPrint.RowCount; end;
function TMain_Window.createDatabase_DataSet(s_Datas: String):Boolean; begin if s_Datas = 'Einheit' then UpdateDBContent(1) else if s_Datas = 'HA' then UpdateDBContent(2) else if s_Datas = 'Person' then UpdateDBContent(3) else if s_Datas = 'MaterialArt' then UpdateDBContent(4) else if s_Datas = 'Material' then UpdateDBContent(5) else if s_Datas = 'MAL' then UpdateDBContent(6) else if s_Datas = 'MVG' then UpdateDBContent(7); if AboutPanel1.Visible then AboutPanel1.Visible := False; if not DBContent.Visible then DBContent.Visible := True;
end;
function TMain_Window.SwitchComponentState(b_toState: Boolean; s_Objekt : String): Boolean; var I: Integer; s_Objekt2: String; begin
for I := 0 to ComponentCount - 1 do begin if Components[i] is TLabel then if (Components[i] as TLabel).Parent <> (FindComponent(s_Objekt) AS TPanel) then (Components[i] as TLabel).Enabled := b_toState; if Components[i] is TSpeedButton then if (Components[i] as TSpeedButton).Parent <> (FindComponent(s_Objekt) AS TPanel) then (Components[i] as TSpeedButton).Enabled := b_toState; if Components[i] is TButton then if (Components[i] as TButton).Parent <> (FindComponent(s_Objekt) AS TPanel) then (Components[i] as TButton).Enabled := b_toState; if Components[i] is TImage then if (Components[i] as TImage).Parent <> (FindComponent(s_Objekt) AS TPanel) then (Components[i] as TImage).Enabled := b_toState; if Components[i] is TDBGrid then if (Components[i] as TDBGrid).Parent <> (FindComponent(s_Objekt) AS TPanel) then (Components[i] as TDBGrid).Enabled := b_toState; if Components[i] is TStringGrid then if (Components[i] as TStringGrid).Parent <> (FindComponent(s_Objekt) AS TPanel) then (Components[i] as TStringGrid).Enabled := b_toState;
end; image6.enabled:=True; end;
function TMain_Window.RaiseErrorWindow(i_err: Integer): Boolean; var s_err: String; i: Integer; begin SwitchComponentState(True,'SelectMALPersonPanel'); SwitchComponentState(False,'ErrorMessage'); case i_err of 0 : s_err:= 'Die Eingabe ist ungültig!'+sLineBreak+'Sie dürfen nur zugelassene Zeichen verwenden!'; 1 : s_err:= 'Sie haben keine Materialausgaben ausgewählt. '+sLineBreak+'Es ist nicht möglich eine Liste aus 0 Seiten zu drucken!'+sLineBreak+'Wählen Sie Materialausgaben aus und versuchen Sie es erneut!'; 2 : s_err:= 'Reportdatei wurde nicht gefunden!'+sLineBreak+'Wenden Sie sich an den Administrator, damit dieser den Report wiederherstellen kann!'; 3 : s_err:= 'Es befinden sich keine Datensätze zur Verarbeitung in der Datenbank!'+sLineBreak+'Bitte fügen Sie Datensätze ein und wiederholen Sie den Vorgang!'; 4 : s_err:= 'Initialisierung fehlgeschlagen.'+sLineBreak+'Versuchen Sie es bitte erneut oder informieren Sie das zuständige IT-Personal!'; 5 : s_err:= 'Ungültige Eingabe!'+sLineBreak+'Sie haben versucht eine Leere Zeile zu verschieben.'+sLineBreak+'Dieser Vorgang ist ungültig!'; 6 : s_err:= 'Ungültige Eingabe!'+sLineBreak+'Weder Passwort noch Benutzername dürfen leer bleiben.'+sLineBreak+'Bitte geben Sie alle nötigen Daten ein!'; 7 : s_err:= 'Falsche Eingabe!'+sLineBreak+'Die angegebenen Passwörter stimmen nciht überein!'; 8 : s_err:= 'Ungültiger Benutzername!'+sLineBreak+'Der gewünschte Benutzername existiert bereits!'; 9 : s_err:= 'Benutzer erfolgreich angelegt!'; 10: s_err:= 'Bitte wählen Sie eine Logdatei aus der Liste aus!'; else s_err:= 'unbekannter Fehler ist aufgetreten. Wenden Sie sich bitte an Ihren Administrator!'; end; ErrorText.Caption := s_err; ErrorMessage.Left := 360; ErrorMessage.Top := 175; ErrorMessage.Show; end;
procedure TMain_Window.ReadyForPrintSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); begin if ReadyForPrint.Cells[0,ARow] = '' then i_SelRowb := 1 else i_SelRowb := ARow; end;
procedure TMain_Window.RichEdit1SelectionChange(Sender: TObject); begin if selend then RichEdit1.SelLength:=0; end;
function TMain_Window.UpdateReport(): Integer; var x,y,i_Field: Integer; b_isFilled: Boolean; begin for x:= 0 to 255 do for y := 0 to 16 do a_toPrint[x,y] := '';
i_SeitenAnzahl := 0; i_RowCount := 0; for x:= 0 to 255 do begin b_isFilled := False; for y := 0 to 16 do begin if a_PrintData[x,y] <> '' then b_isFilled:= True; end; if b_isFilled then begin i_RowCount := i_RowCount + 1; for i_Field := 0 to 16 do a_toPrint[i_RowCount-1,i_Field] := a_PrintData[x,i_Field]; end; end; if i_RowCount > 0 then begin i_SeitenAnzahl := round(i_RowCount div i_RowsPerPage); if (i_RowCount mod i_RowsPerPage) > 0 then i_SeitenAnzahl:= i_SeitenAnzahl + 1;
end else i_SeitenAnzahl:=0;
if i_SeitenAnzahl > 0 then begin for x := 0 to i_RowCount - 1 do for y := 0 to 16 do a_toPrint[x,y] := a_PrintData[x,y]; end else RaiseErrorWindow(1);
result:= i_SeitenAnzahl; end;
function TMain_Window.SetTab(TabID: Integer): Boolean; var I: Integer; begin for I := 1 to 5 do begin if (I <> TabID) then begin
(FindComponent('Image'+ IntToStr(6 + I)) AS TImage).Top := 92; (FindComponent('Label'+ IntToStr(I)) AS TLabel).Top := 92;
end else begin
(FindComponent('Image'+ IntToStr(6 + I)) AS TImage).Top := 101; (FindComponent('Label'+ IntToStr(I)) AS TLabel).Top := 101; Site_TitleLine.Caption := (FindComponent('Label'+ IntToStr(I)) AS TLabel).Caption
end; end; if TabID<>5 then if not DBContent.Visible then DBContent.Visible:=True; if TabID = 5 then if DBContent.Visible then DBContent.Visible:=False;
if not DBContent.Visible then AboutPanel1.Visible:=True else AboutPanel1.Visible:=False;
LoadImg(false,image7); LoadImg(false,image8); LoadImg(false,image9); LoadImg(false,image10); LoadImg(false,image11); end;
procedure TMain_Window.SpeedButton10Click(Sender: TObject); var s_log : String; begin s_log:= ComboBox2.Text; if StrLower(PChar(s_log)) = 'anmeldevorgänge' then s_log:='access.log' else if StrLower(PChar(s_log)) = 'benutzerverwaltung' then s_log:='useradd.log' else s_log:=''; if (s_log <> '') then begin Application.CreateForm(TForm2, Form2); Form2.Show; Form2.showitems(ProgrammDir+'Logs\',s_log); end else RaiseErrorWindow(10); end;
procedure TMain_Window.SpeedButton1Click(Sender: TObject); begin SwitchComponentState(True,'ErrorMessage'); ErrorMessage.Hide; if SelectMALPersonPanel.Visible then SwitchComponentState(False,'SelectMALPersonPanel') else if Config_Panel1.Visible then SwitchComponentState(False,'config_panel1');
end;
procedure TMain_Window.SpeedButton2Click(Sender: TObject); begin SwitchComponentState(true,'Config_Panel1'); if not DBContent.Visible then DBContent.Visible:=True; Config_Panel1.Hide; end;
procedure TMain_Window.SpeedButton3Click(Sender: TObject); var i_Pages,i_Row,i_aRowCount,o,v,i,a_Page,i_aRow: Integer; begin i_Pages := UpdateReport(); i_Row := 0; if i_RowCount < i_RowsPerPage+1 then i_aRowCount:= i_RowCount else i_aRowCount := i_RowsPerPage; v:=0; ClientDataSet3.First; for I := 1 to i_Pages do begin Form1.SetMainSets(I,i_Pages,a_Name[2],a_Name[3],a_Name[4],a_Name[5],a_Name[6]); for i_Row:= 0 to i_aRowCount - 1 do begin i_aRow := I * i_RowsPerPage - i_RowsPerPage + i_Row; Form1.SetTextOnLine(i_aRow + 1,a_toPrint[i_aRow,1],a_toPrint[i_aRow,2],a_toPrint[i_aRow,3],a_toPrint[i_aRow,4],a_toPrint[i_aRow,5],a_toPrint[i_aRow,6],a_toPrint[i_aRow,7],a_toPrint[i_aRow,8]) end; Form1.NewPage; end; SpeedButton4Click(Sender); Form1.Show; end;
procedure TMain_Window.SpeedButton4Click(Sender: TObject); begin if not DBContent.Visible then DBContent.Visible:=True; SwitchComponentState(true,'SelectMALPersonPanel'); SelectMALPersonPanel.Hide; end;
procedure TMain_Window.SpeedButton5Click(Sender: TObject); var xa,ya,i_Row, I: Integer; Last: Boolean; begin ya := 0; xa := 0; Last := False; while not (Last) OR (xa > 255) do begin if a_PrintData[xa,0] = '' then begin ya := xa; Last := True; end; Inc(xa,1); end; Last := False; for I := 0 to ReadyForPrint.RowCount - 1 do if (ReadyForPrint.Cells[0,I] = '') AND not Last then begin Last := True; i_Row := I; end; if FoundForPrint.Cells[0,i_SelRowa] <> '' then begin for I := 0 to 8 do begin ReadyForPrint.Cells[I,i_Row] := FoundForPrint.Cells[I,i_SelRowa]; a_PrintData[ya,I] := FoundForPrint.Cells[I,i_SelRowa]; FoundForPrint.Cells[I,i_SelRowa] := ''; end; for ya := i_SelRowa to FoundForPrint.RowCount - 2 do for I := 0 to 8 do begin FoundForPrint.Cells[I,ya] := FoundForPrint.Cells[I,ya + 1]; FoundForPrint.Cells[I,ya + 1] := ''; end; Last := False; for i_Row := 1 to FoundForPrint.RowCount - 1 do if not (Last) AND (FoundForPrint.Cells[0,i_Row] = FoundForPrint.Cells[0,i_Row - 1]) AND (FoundForPrint.Cells[0,i_Row] <> '') then ya := i_Row; for I := 0 to 8 do FoundForPrint.Cells[I,i_Row] := '';
end else RaiseErrorWindow(5); end;
procedure TMain_Window.SpeedButton6Click(Sender: TObject); var xa,ya,i_FoundedRows: Integer; begin i_FoundedRows := 0; With FoundForPrint do begin for ya := 1 to RowCount - 1 do for xa := 0 to 8 do begin Cells[xa,ya] := ''; end; RowCount := 2; end; for xa := 0 to 255 do for ya := 0 to 16 do a_PrintData[xa,ya] := ''; xa := 0; ClientDataSet6.First; while not ClientDataSet6.Eof do begin if ClientDataSet6PersonID.Value = PersID then begin if CheckBox1.Checked then begin if ClientDataSet6MAL_RueckgabeDatum.IsNull then begin With ReadyForPrint do begin i_FoundedRows := i_FoundedRows + 1; if i_FoundedRows > ReadyForPrint.RowCount -1 then ReadyForPrint.RowCount := ReadyForPrint.RowCount + 1; Cells[0,i_FoundedRows] := IntToStr(ClientDataSet6MALID.Value); Cells[1,i_FoundedRows] := ClientDataSet6MaterialArt_VersNr.Value; Cells[2,i_FoundedRows] := ClientDataSet6MaterialArt_Bezeichnung.Value; Cells[3,i_FoundedRows] := ClientDataSet6MaterialArt_BZE.Value; Cells[4,i_FoundedRows] := IntToStr(ClientDataSet6MAL_Anzahl.Value); Cells[5,i_FoundedRows] := ''; Cells[6,i_FoundedRows] := ClientDataSet6MaterialWerksNr.Value; Cells[7,i_FoundedRows] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value); Cells[8,i_FoundedRows] := ''; end; a_PrintData[xa,0] := IntToStr(ClientDataSet6MALID.Value); a_PrintData[xa,1] := ClientDataSet6MaterialArt_VersNr.Value; a_PrintData[xa,2] := ClientDataSet6MaterialArt_Bezeichnung.Value; a_PrintData[xa,3] := ClientDataSet6MaterialArt_BZE.Value; a_PrintData[xa,4] := IntToStr(ClientDataSet6MAL_Anzahl.Value); a_PrintData[xa,5] := ''; a_PrintData[xa,6] := ClientDataSet6MaterialWerksNr.Value; a_PrintData[xa,7] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value); if not ClientDataSet6MAL_RueckgabeDatum.IsNull then a_PrintData[xa,8] := DateToStr(ClientDataSet6MAL_RueckgabeDatum.Value) else a_PrintData[xa,9] := ''; xa := xa + 1; end; end else begin With ReadyForPrint do begin i_FoundedRows := i_FoundedRows + 1; if i_FoundedRows > ReadyForPrint.RowCount -1 then ReadyForPrint.RowCount := ReadyForPrint.RowCount + 1; Cells[0,i_FoundedRows] := IntToStr(ClientDataSet6MALID.Value); Cells[1,i_FoundedRows] := ClientDataSet6MaterialArt_VersNr.Value; Cells[2,i_FoundedRows] := ClientDataSet6MaterialArt_Bezeichnung.Value; Cells[3,i_FoundedRows] := ClientDataSet6MaterialArt_BZE.Value; Cells[4,i_FoundedRows] := IntToStr(ClientDataSet6MAL_Anzahl.Value); Cells[5,i_FoundedRows] := ''; Cells[6,i_FoundedRows] := ClientDataSet6MaterialWerksNr.Value; Cells[7,i_FoundedRows] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value); if not ClientDataSet6MAL_RueckgabeDatum.IsNull then Cells[8,i_FoundedRows] := DateToStr(ClientDataSet6MAL_RueckgabeDatum.Value) else Cells[8,i_FoundedRows] := ''; end; a_PrintData[xa,0] := IntToStr(ClientDataSet6MALID.Value); a_PrintData[xa,1] := ClientDataSet6MaterialArt_VersNr.Value; a_PrintData[xa,2] := ClientDataSet6MaterialArt_Bezeichnung.Value; a_PrintData[xa,3] := ClientDataSet6MaterialArt_BZE.Value; a_PrintData[xa,4] := IntToStr(ClientDataSet6MAL_Anzahl.Value); a_PrintData[xa,5] := ''; a_PrintData[xa,6] := ClientDataSet6MaterialWerksNr.Value; a_PrintData[xa,7] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value); if not ClientDataSet6MAL_RueckgabeDatum.IsNull then a_PrintData[xa,8] := DateToStr(ClientDataSet6MAL_RueckgabeDatum.Value) else a_PrintData[xa,9] := ''; xa := xa + 1; end; end; ClientDataSet6.Next; end; FoundForPrint.RowCount := ReadyForPrint.RowCount; end;
procedure TMain_Window.SpeedButton7Click(Sender: TObject); var xa,ya,i_FoundedRows: Integer; begin With ReadyForPrint do begin for ya := 1 to RowCount - 1 do for xa := 0 to 8 do begin Cells[xa,ya] := ''; end; RowCount := 2; end; for xa := 0 to 255 do for ya := 0 to 16 do a_PrintData[xa,ya] := ''; ClientDataSet6.First; while not ClientDataSet6.Eof do begin if ClientDataSet6PersonID.Value = PersID then begin if CheckBox1.Checked then begin if ClientDataSet6MAL_RueckgabeDatum.IsNull then begin With FoundForPrint do begin i_FoundedRows := i_FoundedRows + 1; if i_FoundedRows > FoundForPrint.RowCount -1 then FoundForPrint.RowCount := FoundForPrint.RowCount + 1; Cells[0,i_FoundedRows] := IntToStr(ClientDataSet6MALID.Value); Cells[1,i_FoundedRows] := ClientDataSet6MaterialArt_VersNr.Value; Cells[2,i_FoundedRows] := ClientDataSet6MaterialArt_Bezeichnung.Value; Cells[3,i_FoundedRows] := ClientDataSet6MaterialArt_BZE.Value; Cells[4,i_FoundedRows] := IntToStr(ClientDataSet6MAL_Anzahl.Value); Cells[5,i_FoundedRows] := ''; Cells[6,i_FoundedRows] := ClientDataSet6MaterialWerksNr.Value; Cells[7,i_FoundedRows] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value); Cells[8,i_FoundedRows] := ''; end; end; end else begin With FoundForPrint do begin i_FoundedRows := i_FoundedRows + 1; if i_FoundedRows > FoundForPrint.RowCount -1 then FoundForPrint.RowCount := FoundForPrint.RowCount + 1; Cells[0,i_FoundedRows] := IntToStr(ClientDataSet6MALID.Value); Cells[1,i_FoundedRows] := ClientDataSet6MaterialArt_VersNr.Value; Cells[2,i_FoundedRows] := ClientDataSet6MaterialArt_Bezeichnung.Value; Cells[3,i_FoundedRows] := ClientDataSet6MaterialArt_BZE.Value; Cells[4,i_FoundedRows] := IntToStr(ClientDataSet6MAL_Anzahl.Value); Cells[5,i_FoundedRows] := ''; Cells[6,i_FoundedRows] := ClientDataSet6MaterialWerksNr.Value; Cells[7,i_FoundedRows] := DateToStr(ClientDataSet6MAL_AusgabeDatum.Value); if not ClientDataSet6MAL_RueckgabeDatum.IsNull then Cells[8,i_FoundedRows] := DateToStr(ClientDataSet6MAL_RueckgabeDatum.Value) else Cells[8,i_FoundedRows] := ''; end; end; end; ClientDataSet6.Next; end; ReadyForPrint.RowCount := FoundForPrint.RowCount; end;
procedure TMain_Window.SpeedButton8Click(Sender: TObject); var xa,ya,i_Row,i_ArrRow: Integer; b_isLast: Boolean; begin b_isLast := False; xa := 0; ya := 0; while not (b_isLast) OR (xa > 255) do begin if FoundForPrint.Cells[0,xa] = '' then begin b_isLast := True; i_Row := xa; end; Inc(xa,1); end; b_isLast := False; for xa := 0 to 255 do if (a_PrintData[xa,0] = ReadyForPrint.Cells[0,i_SelRowb]) AND not b_isLast then begin i_ArrRow := xa; b_isLast := True; end; if ReadyForPrint.Cells[0,i_SelRowb] <> '' then begin for ya := 0 to 8 do begin FoundForPrint.Cells[ya,i_Row] := ReadyForPrint.Cells[ya,i_SelRowb]; ReadyForPrint.Cells[ya,i_SelRowb] := ''; end; for xa := i_SelRowb to ReadyForPrint.RowCount - 2 do begin for ya := 0 to 8 do begin ReadyForPrint.Cells[ya,xa] := ReadyForPrint.Cells[ya,xa + 1]; ReadyForPrint.Cells[ya,xa + 1] := ''; a_PrintData[i_ArrRow,ya] := ''; end; end; b_isLast := False; for xa := i_ArrRow to 254 do begin for ya := 0 to 8 do begin a_PrintData[xa,ya] := a_PrintData[xa + 1,ya]; a_PrintData[xa + 1,ya] := ''; end; end; end else RaiseErrorWindow(5); end;
function StringMD5(str: string): string; stdcall; external 'md5lib.dll';
procedure TMain_Window.SpeedButton9Click(Sender: TObject); var t_ini: TIniFile; s_Name, s_Pass : String; begin UseraddLog:= TLog.Create('useradd.log',ProgrammDir+'Logs\'); With UseraddLogData do begin User := Label27.Caption; Timestamp := Now; HeadLine:= 'Nutzerverwaltung'; end; if not (Edit1.Text='') AND not (Edit2.Text='') then begin if Edit2.Text = Edit3.Text then begin Try t_ini := TIniFile.Create(ProgrammDir+'Data\c_Users.itc'); s_Name := Edit1.Text; s_Name := StrLower(PChar(s_Name)); s_Name := StringMD5(s_Name); s_Pass := StringMD5(Edit2.Text); if t_Ini.ValueExists('TMainLoginDatas',s_Name) then begin RaiseErrorWindow(8); With UseraddLogData do begin Short := 'Fehlgeschlagen'; Long := 'Der Benutzer "'+Edit1.Text+'" existiert bereits!'; end; end else begin t_Ini.WriteString('TMainLoginDatas',s_Name,s_Pass); With UseraddLogData do begin Short := 'Erfolgreich'; Long := 'Der Benutzer "'+Edit1.Text+'" wurde erfolgreich angelegt!'; end; RaiseErrorWindow(9); end; finally t_Ini.Free; end; end else begin RaiseErrorWindow(7); With UseraddLogData do begin Short := 'Fehlgeschlagen'; Long := 'Der Benutzer "'+Edit1.Text+'" konnte nicht angelegt werden, da die Passwörter nicht übereinstimmten!'; end; end; end else begin RaiseErrorWindow(6); With UseraddLogData do begin Short := 'Fehlgeschlagen'; Long := 'Mindestens ein Feld war nicht ausgefüllt!'; end; end; try UseraddLogData.Index := UseraddLog.NextLine; UseraddLog.add(UseraddLogData); finally UseraddLog.Destroy; end; Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit1.SetFocus; end;
function TMain_Window.LoadImg(highlight: Boolean; img: TImage): Boolean; begin if (highlight) OR (img.Top = 101) then img.picture.bitmap.handle:=LoadBitMap(HInstance, 'TAB_HIGHLIGHTED') else Img.picture.bitmap.handle:=LoadBitMap(HInstance, 'TAB_UNHIGHLIGHTED');
end;
procedure TMain_Window.NeueClick(Sender: TObject); begin Site_TitleLine.Caption:= 'Material'; createDatabase_DataSet('Material'); SetTab(2); end;
procedure TMain_Window.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin Login_Window.Close; end;
procedure TMain_Window.FormCreate(Sender: TObject); var s_Search: PChar; begin i_xOld := -9999; i_yOld := -9999; Main_Window.DoubleBuffered:=True; Image17.picture.bitmap.handle:=LoadBitMap(HInstance, 'LOCK_BIG_1'); Image12.picture.bitmap.handle:=LoadBitMap(HInstance, 'SAVE_BIG_1'); Image13.picture.bitmap.handle:=LoadBitMap(HInstance, 'CLOSE_BIG_1'); image14.picture.bitmap.handle:=LoadBitMap(HInstance, 'CONFIG_BIG_1'); image15.picture.bitmap.handle:=LoadBitMap(HInstance, 'MINIMIZE_SMALL_1'); image16.picture.bitmap.handle:=LoadBitMap(HInstance, 'PRINT_BIG_1'); SetTab(1); ClientDataSet1.LoadFromFile(Programmdir+'Data\Einheiten.cds'); ClientDataSet2.LoadFromFile(Programmdir+'Data\Hauptabschnitte.cds'); ClientDataSet3.LoadFromFile(Programmdir+'Data\Personen.cds'); ClientDataSet4.LoadFromFile(Programmdir+'Data\MaterialArt.cds'); ClientDataSet5.LoadFromFile(Programmdir+'Data\Material.cds'); ClientDataSet6.LoadFromFile(Programmdir+'Data\MAL.cds'); ClientDataSet7.LoadFromFile(Programmdir+'Data\MVG.cds'); createDatabase_DataSet('Personen'); ProgrammDir := ExtractFilePath(ParamStr(0)); if not (AnsiLastChar(ProgrammDir) = '\') then ProgrammDir := ProgrammDir + '\'; if not DirectoryExists(Programmdir+'Data\') then ForceDirectories(Programmdir+'Data\'); } createDatabase_DataSet('Person'); Config_Panel1.Top := 172; AboutPanel1.Top := 172; SelectMALPersonPanel.Top := 64; With RichEdit1 do begin s_Search:='Support@DaKirsche-online.de'; SelStart:=FindText(s_Search,0,Length(Richedit1.text),[stMatchCase]); SelLength:=Length(s_Search); SelAttributes.Color:=clBlue; SelAttributes.Style:=[fsbold]; s_Search:='IT-Bestandslistenverwaltung'; SelStart:=FindText(s_Search,0,Length(Richedit1.text),[stMatchCase]); SelLength:=Length(s_Search); SelAttributes.Color:=clBlack; SelAttributes.Style:=[fsbold]; s_Search:='Version 2.1.3'; SelStart:=FindText(s_Search,0,Length(Richedit1.text),[stMatchCase]); SelLength:=Length(s_Search); SelAttributes.Color:=clBlack; SelAttributes.Style:=[fsbold]; s_Search:='Ebenso ist ein Druck auf einer Formularvorlage der dienstlichen "MAL-Vordrucke" möglich.'; SelStart:=FindText(s_Search,0,Length(Richedit1.text),[stMatchCase]); SelLength:=Length(s_Search); SelAttributes.Color:=clBlack; SelAttributes.Style:=[fsunderline]; s_Search:='"MAL-Vordrucke"'; SelStart:=FindText(s_Search,0,Length(Richedit1.text),[stMatchCase]); SelLength:=Length(s_Search); SelAttributes.Color:=clBlack; SelAttributes.Style:=[fsunderline,fsBold]; selend:=True; end; end;
procedure TMain_Window.FoundForPrintSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); begin if FoundForPrint.Cells[0,ARow] = '' then i_SelRowa := 1 else i_SelRowa := ARow; end;
procedure TMain_Window.Image17Click(Sender: TObject); begin Main_Window.Hide; Login_Window.Show; end;
procedure TMain_Window.Image17MouseEnter(Sender: TObject); begin Image17.picture.bitmap.handle:=LoadBitMap(HInstance, 'LOCK_BIG_2'); end;
procedure TMain_Window.Image17MouseLeave(Sender: TObject); begin Image17.picture.bitmap.handle:=LoadBitMap(HInstance, 'LOCK_BIG_1'); end;
procedure TMain_Window.Image12Click(Sender: TObject); begin ClientDataSet1.SaveToFile(Programmdir+'Data\Einheiten.cds',dfbinary); ClientDataSet2.SaveToFile(Programmdir+'Data\Hauptabschnitte.cds',dfbinary); ClientDataSet3.SaveToFile(Programmdir+'Data\Personen.cds',dfbinary); ClientDataSet4.SaveToFile(Programmdir+'Data\MaterialArt.cds',dfbinary); ClientDataSet5.SaveToFile(Programmdir+'Data\Material.cds',dfbinary); ClientDataSet6.SaveToFile(Programmdir+'Data\MAL.cds',dfbinary); ClientDataSet7.SaveToFile(Programmdir+'Data\MVG.cds',dfbinary); end;
procedure TMain_Window.Image12MouseEnter(Sender: TObject); begin Image12.picture.bitmap.handle:=LoadBitMap(HInstance, 'SAVE_BIG_2'); end;
procedure TMain_Window.Image12MouseLeave(Sender: TObject); begin Image12.picture.bitmap.handle:=LoadBitMap(HInstance, 'SAVE_BIG_1'); end;
procedure TMain_Window.Image13Click(Sender: TObject); begin Main_Window.Close; Login_Window.Close; end;
procedure TMain_Window.Image13MouseEnter(Sender: TObject); begin Image13.picture.bitmap.handle:=LoadBitMap(HInstance, 'CLOSE_BIG_2'); end;
procedure TMain_Window.Image13MouseLeave(Sender: TObject); begin Image13.picture.bitmap.handle:=LoadBitMap(HInstance, 'CLOSE_BIG_1'); end;
procedure TMain_Window.Image14Click(Sender: TObject); begin SwitchComponentState(false,'Config_Panel1'); Config_Panel1.Show; end;
procedure TMain_Window.Image14MouseEnter(Sender: TObject); begin image14.picture.bitmap.handle:=LoadBitMap(HInstance, 'CONFIG_BIG_2'); end;
procedure TMain_Window.Image14MouseLeave(Sender: TObject); begin image14.picture.bitmap.handle:=LoadBitMap(HInstance, 'CONFIG_BIG_1'); end;
procedure TMain_Window.Image15Click(Sender: TObject); var h:HWnd; begin h:=Main_Window.handle; postmessage(h,WM_SYSCOMMAND,SC_MINIMIZE,0); end;
procedure TMain_Window.Image15MouseEnter(Sender: TObject); begin image15.picture.bitmap.handle:=LoadBitMap(HInstance, 'MINIMIZE_SMALL_2'); end;
procedure TMain_Window.Image15MouseLeave(Sender: TObject); begin image15.picture.bitmap.handle:=LoadBitMap(HInstance, 'MINIMIZE_SMALL_1'); end;
procedure TMain_Window.Image16Click(Sender: TObject); begin if InitializeSelectorPanel then begin ComboBox1Change(Sender); SelectMALPersonPanel.Show; if DBContent.Visible then DBContent.Visible:=False;
SwitchComponentState(false,'SelectMALPersonPanel'); ComboBox1.SetFocus; end else RaiseErrorWindow(4); end;
procedure TMain_Window.Image16MouseEnter(Sender: TObject); begin Image16.picture.bitmap.handle:=LoadBitMap(HInstance, 'Print_BIG_2'); end;
procedure TMain_Window.Image16MouseLeave(Sender: TObject); begin Image16.picture.bitmap.handle:=LoadBitMap(HInstance, 'PRINT_BIG_1'); end;
procedure TMain_Window.Image6Click(Sender: TObject); begin Close; end;
procedure TMain_Window.Image6MouseEnter(Sender: TObject); begin image6.picture.bitmap.handle:=LoadBitMap(HInstance, 'CLOSE_SMALL_2'); end;
procedure TMain_Window.Image6MouseLeave(Sender: TObject); begin image6.picture.bitmap.handle:=LoadBitMap(HInstance, 'CLOSE_SMALL_1'); end;
procedure TMain_Window.Label5Click(Sender: TObject); begin SetTab(5); end;
procedure TMain_Window.Label5MouseEnter(Sender: TObject); begin LoadImg(true,image11); end;
procedure TMain_Window.Label5MouseLeave(Sender: TObject); begin LoadImg(false,image11); end;
procedure TMain_Window.Label10Click(Sender: TObject); begin Site_TitleLine.Caption:= 'Hauptabschnitte'; createDatabase_DataSet('HA'); SetTab(0); end;
procedure TMain_Window.Label11Click(Sender: TObject); begin Site_TitleLine.Caption:= 'Personen'; createDatabase_DataSet('Person'); SetTab(1); end;
procedure TMain_Window.Label12Click(Sender: TObject); begin Site_TitleLine.Caption:= 'Materialarten'; createDatabase_DataSet('MaterialArt'); SetTab(0); end;
procedure TMain_Window.Label13Click(Sender: TObject); begin Site_TitleLine.Caption:= 'Materialausgaben'; createDatabase_DataSet('MAL'); SetTab(3); end;
procedure TMain_Window.Label15Click(Sender: TObject); begin Site_TitleLine.Caption:= 'Mengenverbrauchsgüter'; createDatabase_DataSet('MVG'); SetTab(4); end;
procedure TMain_Window.Label1Click(Sender: TObject); begin SetTab(1); createDatabase_DataSet('Person'); end;
procedure TMain_Window.Label1MouseEnter(Sender: TObject); begin LoadImg(true,image7); end;
procedure TMain_Window.Label1MouseLeave(Sender: TObject); begin LoadImg(false,image7); end;
procedure TMain_Window.Label2Click(Sender: TObject); begin SetTab(2); createDatabase_DataSet('Material'); end;
procedure TMain_Window.Label2MouseEnter(Sender: TObject); begin LoadImg(true,image8); end;
procedure TMain_Window.Label2MouseLeave(Sender: TObject); begin LoadImg(false,image8); end;
procedure TMain_Window.Label3Click(Sender: TObject); begin SetTab(3); createDatabase_DataSet('MAL'); end;
procedure TMain_Window.Label3MouseEnter(Sender: TObject); begin LoadImg(true,image9); end;
procedure TMain_Window.Label3MouseLeave(Sender: TObject); begin LoadImg(false,image9); end;
procedure TMain_Window.Label4Click(Sender: TObject); begin SetTab(4); createDatabase_DataSet('MVG'); end;
procedure TMain_Window.Label4MouseEnter(Sender: TObject); begin LoadImg(true,image10); end;
procedure TMain_Window.Label4MouseLeave(Sender: TObject); begin LoadImg(false,image10); end;
procedure TMain_Window.Label8Click(Sender: TObject); begin Site_TitleLine.Caption:= 'Einheiten'; createDatabase_DataSet('Einheit'); SetTab(0); end;
procedure TMain_Window.Label8MouseEnter(Sender: TObject); begin ((Sender) AS TLabel).Font.Color := claqua; end;
procedure TMain_Window.Label8MouseLeave(Sender: TObject); begin ((Sender) AS TLabel).Font.Color := clblack; end;
procedure TMain_Window.TitleBar_LabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin MoveAllow := True; i_xOld := X; i_yOld := Y; end;
procedure TMain_Window.TitleBar_LabelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if MoveAllow then begin Main_Window.Left:=Main_Window.left + (X)-i_xOld; Main_Window.top:=Main_Window.top + (Y)-i_yOld; end
end;
procedure TMain_Window.TitleBar_LabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin MoveAllow := False; end;
end. |