修改日期控件显示问题
This commit is contained in:
parent
11eea17fa9
commit
f18886276a
|
@ -1920,7 +1920,7 @@ begin
|
|||
else if Controls[i] is TcxDateEdit then
|
||||
begin
|
||||
if not IsEmpty and not fieldByName(mfield).IsNull then
|
||||
TcxDateEdit(Controls[i]).text :=fieldByName(mfield).AsString;
|
||||
TcxDateEdit(Controls[i]).date :=fieldByName(mfield).AsDateTime;
|
||||
end
|
||||
else if Controls[i] is TcxTimeEdit then
|
||||
begin
|
||||
|
@ -4037,5 +4037,137 @@ begin
|
|||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure LSCSHData(ADOQueryTmp: TADOQuery; mParent: TdxLayoutControl; FTag: Integer);
|
||||
var
|
||||
i, idx: Integer;
|
||||
mfield, mfieldCode: string;
|
||||
ma: TA;
|
||||
begin
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
if isEmpty then
|
||||
exit;
|
||||
with mParent do
|
||||
begin
|
||||
for i := 0 to ControlCount - 1 do
|
||||
begin
|
||||
if Controls[i] is TLabel then
|
||||
continue;
|
||||
if Controls[i].Tag <> FTag then
|
||||
continue;
|
||||
mfield := Controls[i].Name;
|
||||
|
||||
if Controls[i] is TEdit then
|
||||
begin
|
||||
if Trim(fieldByName(mfield).AsString) <> '' then
|
||||
TEdit(Controls[i]).Text := Trim(fieldByName(mfield).AsString);
|
||||
end
|
||||
else if Controls[i] is TcxTextEdit then
|
||||
begin
|
||||
if Trim(fieldByName(mfield).AsString) <> '' then
|
||||
TcxTextEdit(Controls[i]).Text := Trim(fieldByName(mfield).AsString);
|
||||
end
|
||||
else if Controls[i] is TRTComboBox then
|
||||
begin
|
||||
idx := TRTComboBox(Controls[i]).IndexOfItem2(Trim(fieldByName(mfield).AsString));
|
||||
TComboBox(Controls[i]).ItemIndex := idx;
|
||||
end
|
||||
else if Controls[i] is TRichEdit then
|
||||
begin
|
||||
if Trim(fieldByName(mfield).AsString) <> '' then
|
||||
TRichEdit(Controls[i]).Text := Trim(fieldByName(mfield).AsString);
|
||||
end
|
||||
else if Controls[i] is TcxRichEdit then
|
||||
begin
|
||||
if Trim(fieldByName(mfield).AsString) <> '' then
|
||||
TcxRichEdit(Controls[i]).Text := Trim(fieldByName(mfield).AsString);
|
||||
end
|
||||
else if Controls[i] is TComboBox then
|
||||
begin
|
||||
if TComboBox(Controls[i]).Items.Count > 0 then
|
||||
begin
|
||||
idx := TComboBox(Controls[i]).Items.IndexOf(Trim(fieldByName(mfield).AsString));
|
||||
end
|
||||
else
|
||||
idx := -1;
|
||||
TComboBox(Controls[i]).ItemIndex := idx;
|
||||
end
|
||||
else if Controls[i] is TcxComboBox then
|
||||
begin
|
||||
if TcxComboBox(Controls[i]).Properties.Items.Count > 0 then
|
||||
begin
|
||||
idx := TcxComboBox(Controls[i]).Properties.Items.IndexOf(Trim(fieldByName(mfield).AsString));
|
||||
end
|
||||
else
|
||||
idx := -1;
|
||||
TcxComboBox(Controls[i]).ItemIndex := idx;
|
||||
end
|
||||
else if Controls[i] is TBtnEditA then
|
||||
begin
|
||||
if Trim(TBtnEditA(Controls[i]).Hint) <> '' then
|
||||
begin
|
||||
TBtnEditA(TBtnEditA(Controls[i])).TxtCode := Trim(fieldByName(mfield).AsString);
|
||||
TBtnEditA(Controls[i]).Text := Trim(fieldByName(Trim(TBtnEditA(Controls[i]).Hint)).AsString);
|
||||
end
|
||||
else
|
||||
begin
|
||||
TBtnEditA(Controls[i]).Text := Trim(fieldByName(mfield).AsString);
|
||||
end;
|
||||
|
||||
end
|
||||
else if Controls[i] is TBtnEditC then
|
||||
begin
|
||||
TBtnEditC(TBtnEditA(Controls[i])).Text := Trim(fieldByName(mfield).AsString);
|
||||
end
|
||||
else if Controls[i] is TDateTimePicker then
|
||||
begin
|
||||
if Trim(fieldByName(mfield).AsString) = '' then
|
||||
begin
|
||||
TDateTimePicker(Controls[i]).Checked := false;
|
||||
end
|
||||
else
|
||||
TDateTimePicker(Controls[i]).DateTime := fieldByName(mfield).AsDateTime;
|
||||
end
|
||||
else if Controls[i] is Tmemo then
|
||||
begin
|
||||
Tmemo(Controls[i]).Text := Trim(fieldByName(mfield).AsString);
|
||||
end
|
||||
else if Controls[i] is Tcxmemo then
|
||||
begin
|
||||
Tcxmemo(Controls[i]).Text := Trim(fieldByName(mfield).AsString);
|
||||
end
|
||||
else if Controls[i] is TcxDateEdit then
|
||||
begin
|
||||
if not isEmpty and not fieldByName(mfield).IsNull then
|
||||
TcxDateEdit(Controls[i]).date := fieldByName(mfield).AsDateTime;
|
||||
end
|
||||
else if Controls[i] is TcxTimeEdit then
|
||||
begin
|
||||
if not isEmpty and (fieldByName(mfield).AsString <> '') then
|
||||
TcxTimeEdit(Controls[i]).Text := fieldByName(mfield).AsString;
|
||||
end
|
||||
else if Controls[i] is TcxCurrencyEdit then
|
||||
begin
|
||||
TcxCurrencyEdit(Controls[i]).Text := fieldByName(mfield).AsString;
|
||||
end
|
||||
else if Controls[i] is TcheckBox then
|
||||
begin
|
||||
TcheckBox(Controls[i]).Checked := fieldByName(mfield).asBoolean;
|
||||
end
|
||||
else if Controls[i] is TcxButtonEdit then
|
||||
begin
|
||||
TcxButtonEdit(Controls[i]).Text := Trim(fieldByName(mfield).AsString);
|
||||
// if TcxButtonEdit(Controls[i]).ParentShowHint = false then
|
||||
// begin
|
||||
// mfieldCode := Trim(Copy(mfield, 1, Length(mfield) - 4));
|
||||
// TcxButtonEdit(Controls[i]).Hint := Trim(fieldByName(mfieldCode).AsString);
|
||||
// end;
|
||||
end;
|
||||
end; // end for
|
||||
end; // end with
|
||||
end; // end for with
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
@ -985,7 +985,7 @@ begin
|
|||
else if Controls[i] is TcxDateEdit then
|
||||
begin
|
||||
if not isEmpty and not fieldByName(mfield).IsNull then
|
||||
TcxDateEdit(Controls[i]).Text := fieldByName(mfield).AsString;
|
||||
TcxDateEdit(Controls[i]).date := fieldByName(mfield).AsDateTime;
|
||||
end
|
||||
else if Controls[i] is TcxTimeEdit then
|
||||
begin
|
||||
|
@ -3523,7 +3523,7 @@ begin
|
|||
else if Controls[i] is TcxDateEdit then
|
||||
begin
|
||||
if not isEmpty and not fieldByName(mfield).IsNull then
|
||||
TcxDateEdit(Controls[i]).Text := fieldByName(mfield).AsString;
|
||||
TcxDateEdit(Controls[i]).date := fieldByName(mfield).AsDateTime;
|
||||
end
|
||||
else if Controls[i] is TcxTimeEdit then
|
||||
begin
|
||||
|
|
Loading…
Reference in New Issue
Block a user