Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /Unit6.pas

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13 - (hide annotations) (download) (as text)
Tue Jul 26 09:17:38 2016 UTC (7 years, 8 months ago) by yamat0jp
File MIME type: text/x-pascal
File size: 3042 byte(s)
だいぶ完成
1 yamat0jp 1 unit Unit6;
2    
3     interface
4    
5     uses
6     Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, Vcl.Controls,
7     IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompEdit,
8     IWVCLComponent, IWBaseLayoutComponent, IWBaseContainerLayout,
9 yamat0jp 2 IWContainerLayout, IWTemplateProcessorHTML, IWCompButton, Vcl.Forms, Unit2,
10 yamat0jp 11 IWCompGrids, IWCompCalendar, IWCompLabel, IWDBGrids;
11 yamat0jp 1
12     type
13     TUserForm = class(TIWAppForm)
14     IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;
15     IWEdit1: TIWEdit;
16     IWEdit2: TIWEdit;
17     IWEdit3: TIWEdit;
18     IWEdit4: TIWEdit;
19     IWEdit5: TIWEdit;
20     IWButton1: TIWButton;
21 yamat0jp 2 IWEdit6: TIWEdit;
22 yamat0jp 8 IWButton2: TIWButton;
23 yamat0jp 1 IWFrame1: TIWFrame1;
24     procedure IWButton1Click(Sender: TObject);
25 yamat0jp 3 procedure IWButton2Click(Sender: TObject);
26 yamat0jp 1 public
27 yamat0jp 13 pay: Boolean;
28 yamat0jp 1 private
29     function Check: Boolean;
30     end;
31    
32     implementation
33    
34     {$R *.dfm}
35    
36 yamat0jp 13 uses Unit3, Unit1, ServerController, Unit7;
37 yamat0jp 1
38     function TUserForm.Check: Boolean;
39     begin
40 yamat0jp 2 result := false;
41 yamat0jp 11 if IWEdit1.Text = '' then
42     begin
43     WebApplication.ShowMessage('�����O������������������');
44     Exit;
45     end;
46 yamat0jp 2 if Length(IWEdit5.Text) < 5 then
47 yamat0jp 1 begin
48 yamat0jp 2 WebApplication.ShowMessage('�T�����������p�X���[�h���g�p������������');
49     Exit;
50     end;
51     if IWEdit5.Text <> IWEdit6.Text then
52     WebApplication.ShowMessage('�p�X���[�h���������v��������')
53 yamat0jp 3 else if DM.FDTable1.Locate('EMAIL', IWEdit3.Text, []) = false then
54 yamat0jp 2 begin
55     result := (IWEdit1.Text <> '') and (IWEdit2.Text <> '') and
56     (IWEdit3.Text <> '') and (IWEdit4.Text <> '');
57 yamat0jp 8 if result = false then
58 yamat0jp 2 WebApplication.ShowMessage('����������������������');
59     end
60     else if DM.FDTable1.FieldByName('EMAIL').AsString <> '' then
61 yamat0jp 1 WebApplication.ShowMessage('e-mail�������o�^������������');
62 yamat0jp 11 if result = false then
63     begin
64     IWEdit5.Text := '';
65     IWEdit6.Text := '';
66     end;
67 yamat0jp 1 end;
68    
69     procedure TUserForm.IWButton1Click(Sender: TObject);
70     begin
71     if Check = true then
72     begin
73 yamat0jp 11 if UserSession.user_number = 0 then
74     begin
75 yamat0jp 3 DM.FDTable1.Last;
76 yamat0jp 7 UserSession.user_number := DM.FDTable1.FieldByName('NUMBER').AsInteger + 1;
77 yamat0jp 3 DM.FDTable1.AppendRecord([IWEdit1.Text, IWEdit3.Text, IWEdit2.Text,
78 yamat0jp 12 IWEdit4.Text, nil, UserSession.hash(IWEdit5.Text), UserSession.user_number, Date]);
79 yamat0jp 11 end
80     else
81 yamat0jp 13 with DM.FDTable1 do
82 yamat0jp 11 begin
83 yamat0jp 13 Edit;
84     FieldByName('NAME').AsString:=IWEdit1.Text;
85     FieldByName('EMAIL').AsString:=IWEdit3.Text;
86     FieldByName('BIRTH').AsString:=IWEdit2.Text;
87     FieldByName('ADDRESS').AsString:=IWEdit4.Text;
88     FieldByName('PASSWORD').AsString:=UserSession.hash(IWEdit5.Text);
89     Post;
90 yamat0jp 11 end;
91     WebApplication.Response.Cookies.AddCookie('user_cookie',UserSession.user_number.ToString,'/',Date+10);
92 yamat0jp 13 if pay = true then
93     TPayForm.Create(WebApplication).Show;
94 yamat0jp 1 Release;
95 yamat0jp 8 IWForm1.Page := false;
96 yamat0jp 2 end;
97 yamat0jp 1 end;
98    
99 yamat0jp 3 procedure TUserForm.IWButton2Click(Sender: TObject);
100 yamat0jp 1 begin
101     Release;
102     end;
103    
104     end.

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26