You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

283 lines
9.9 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_op_seae_diffctn;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, BusinessSkinForm, ExtCtrls, StdCtrls, ComCtrls,
DBCtrls,DB, dxExEdtr, dxTL, dxDBCtrl, dxDBGrid, dxCntner, kbmMemTable,
Mask, Grids, DBGrids, cxControls, cxContainer, cxEdit, cxLabel;
type
Tfrm_op_seae_diffctn = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton5: TbsSkinButton;
dsrWebCtn: TDataSource;
dsrCtn: TDataSource;
memtblwebctn: TkbmMemTable;
memtblwebctnShipingBoxNo: TStringField;
memtblwebctn1: TDataSource;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column11: TdxDBGridColumn;
dxDBGrid1Column12: TdxDBGridColumn;
dxDBGrid1Column13: TdxDBGridColumn;
dxDBGrid1Column14: TdxDBGridColumn;
dxDBGrid1Column15: TdxDBGridColumn;
dxDBGrid1Column16: TdxDBGridColumn;
dxDBGrid1Column17: TdxDBGridColumn;
cxLabel1: TcxLabel;
cxLabel2: TcxLabel;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure dxDBGrid1CustomDraw(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
AFocused: Boolean; var ADone: Boolean);
procedure dxDBGrid1Column5CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused,
ANewItemRow: Boolean; var AText: String; var AColor: TColor;
AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
procedure dxDBGrid1Column6CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused,
ANewItemRow: Boolean; var AText: String; var AColor: TColor;
AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
procedure dxDBGrid1Column7CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused,
ANewItemRow: Boolean; var AText: String; var AColor: TColor;
AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
procedure dxDBGrid1Column4CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused,
ANewItemRow: Boolean; var AText: String; var AColor: TColor;
AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
procedure dxDBGrid1Column1CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused,
ANewItemRow: Boolean; var AText: String; var AColor: TColor;
AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
procedure dxDBGrid1Column2CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused,
ANewItemRow: Boolean; var AText: String; var AColor: TColor;
AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
procedure dxDBGrid1Column8CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused,
ANewItemRow: Boolean; var AText: String; var AColor: TColor;
AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
private
{ Private declarations }
procedure setdifcolor ;
function replace(str,s1,s2:string):string;
Function After(Src,S:string ) : string ;
Function Before(Src,S:string):string ;
Function middle( Src,S1,S2:string ) : string ;
public
{ Public declarations }
bsNo:string;
procedure showchgtd(ds1,ds2:TDataSource) ;
procedure Creatememtblctn;
end;
var
frm_op_seae_diffctn: Tfrm_op_seae_diffctn;
implementation
{$R *.dfm}
uses u_main ;
procedure Tfrm_op_seae_diffctn.bsSkinButton5Click(Sender: TObject);
begin
close ;
end;
procedure Tfrm_op_seae_diffctn.setdifcolor;
begin
end;
procedure Tfrm_op_seae_diffctn.showchgtd(ds1, ds2: TDataSource);
begin
dxDBGrid1.DataSource:=memtblwebctn1;
showmodal ;
end;
////////////////////////////////////////////////
Function Tfrm_op_seae_diffctn.After(Src,S:string ) : string ;
begin
end;
//<2F><>ȡ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
Function Tfrm_op_seae_diffctn.Before(Src,S:string):string ;
begin
end;
Function Tfrm_op_seae_diffctn.middle( Src,S1,S2:string ) : string ;
begin
end;
function Tfrm_op_seae_diffctn.replace(str,s1,s2:string):string;
begin
end;
procedure Tfrm_op_seae_diffctn.FormShow(Sender: TObject);
begin
setdifcolor;
end;
procedure Tfrm_op_seae_diffctn.Creatememtblctn;
begin
end;
procedure Tfrm_op_seae_diffctn.dxDBGrid1CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
if trim(uppercase(ANode.Strings[dxDBGrid1Column3.Index]))<>trim(uppercase(ANode.Strings[dxDBGrid1Column12.Index])) then
begin
AFont.Color:=clRed;
exit;
end;
end;
procedure Tfrm_op_seae_diffctn.dxDBGrid1Column5CustomDrawCell(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if dsrCtn.DataSet.Locate('<27><><EFBFBD><EFBFBD>',uppercase(ANode.Strings[dxDBGrid1Column3.Index]),[]) then
begin
if dsrCtn.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger<>StrToFloatdef(ANode.Strings[dxDBGrid1Column5.Index],0) then
begin
AFont.Color:=clRed;
end;
end;
end;
procedure Tfrm_op_seae_diffctn.dxDBGrid1Column6CustomDrawCell(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if dsrCtn.DataSet.Locate('<27><><EFBFBD><EFBFBD>',uppercase(ANode.Strings[dxDBGrid1Column3.Index]),[]) then
begin
if dsrCtn.DataSet.FieldByName('<27><>װ').AsString<>ANode.Strings[dxDBGrid1Column6.Index] then
begin
AFont.Color:=clRed;
end;
end;
end;
procedure Tfrm_op_seae_diffctn.dxDBGrid1Column7CustomDrawCell(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if dsrCtn.DataSet.Locate('<27><><EFBFBD><EFBFBD>',uppercase(ANode.Strings[dxDBGrid1Column3.Index]),[]) then
begin
if FormatFloat('0.000;0.000;0',dsrCtn.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)<>FormatFloat('0.000;0.000;0',StrToFloatdef(ANode.Strings[dxDBGrid1Column7.Index],0)) then
begin
AFont.Color:=clRed;
end;
end;
end;
procedure Tfrm_op_seae_diffctn.dxDBGrid1Column4CustomDrawCell(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if memtblwebctn.FieldByName('Exist').AsString='0' then
begin
AFont.Color:=clRed;
exit;
end
else
if dsrCtn.DataSet.Locate('<27><><EFBFBD><EFBFBD>',uppercase(ANode.Strings[dxDBGrid1Column3.Index]),[]) then
begin
if dsrCtn.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>ANode.Strings[dxDBGrid1Column4.Index] then
begin
AFont.Color:=clRed;
end;
end;
end;
procedure Tfrm_op_seae_diffctn.dxDBGrid1Column1CustomDrawCell(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if memtblwebctn.FieldByName('Exist').AsString='0' then
begin
AFont.Color:=clRed;
exit;
end
else
if dsrCtn.DataSet.Locate('<27><><EFBFBD><EFBFBD>',uppercase(ANode.Strings[dxDBGrid1Column3.Index]),[]) then
begin
if dsrCtn.DataSet.FieldByName('<27>ߴ<EFBFBD>').AsString<>ANode.Strings[dxDBGrid1Column1.Index] then
begin
AFont.Color:=clRed;
end;
end;
end;
procedure Tfrm_op_seae_diffctn.dxDBGrid1Column2CustomDrawCell(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if dsrCtn.DataSet.Locate('<27><><EFBFBD><EFBFBD>',uppercase(ANode.Strings[dxDBGrid1Column3.Index]),[]) then
begin
if dsrCtn.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>ANode.Strings[dxDBGrid1Column2.Index] then
begin
AFont.Color:=clRed;
end;
end;
end;
procedure Tfrm_op_seae_diffctn.dxDBGrid1Column8CustomDrawCell(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if dsrCtn.DataSet.Locate('<27><><EFBFBD><EFBFBD>',uppercase(ANode.Strings[dxDBGrid1Column3.Index]),[]) then
begin
if FormatFloat('0.000;0.000;0',dsrCtn.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)<>FormatFloat('0.000;0.000;0',StrToFloatdef(ANode.Strings[dxDBGrid1Column8.Index],0)) then
begin
AFont.Color:=clRed;
end;
end;
end;
end.