?? ordertobarcode.~pas
字號:
unit OrderToBarCode;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, NEOFORM, ExtCtrls, ToolWin, ComCtrls, StdCtrls, Grids, Buttons, DateUtils,
RpBase, RpSystem, RpRave, RpDefine, RpCon, RpConDS, fcdbtreeview,
fcTreeView;
type
TFrmOrderToBarCode = class(TGBKPForm)
Panel1: TPanel;
Panel2: TPanel;
PScrollBoxCenter: TPanel;
Splitter2: TSplitter;
PanelPan: TPanel;
Panel6: TPanel;
Panel7: TPanel;
Label4: TLabel;
Label5: TLabel;
GroupBox2: TGroupBox;
MemoOrderMemo: TMemo;
EdtPanPrincipal: TEdit;
EdtPanAuditing: TEdit;
Panel8: TPanel;
GroupBox1: TGroupBox;
MemoOrderDetail: TMemo;
Panel9: TPanel;
Label1: TLabel;
Label2: TLabel;
Bevel1: TBevel;
Label3: TLabel;
EdtSellPrincipal: TEdit;
EdtPanTab: TEdit;
EdtCustomer: TEdit;
ComboBoxDevName: TComboBox;
StringGridOrder: TStringGrid;
EdtDevName: TEdit;
Panel4: TPanel;
PanelEnge: TPanel;
Panel10: TPanel;
Panel11: TPanel;
Panel12: TPanel;
MemoEngMemo: TMemo;
Label10: TLabel;
Edit9: TEdit;
Label11: TLabel;
EdtOrderID: TEdit;
Panel13: TPanel;
Panel14: TPanel;
Panel15: TPanel;
Panel16: TPanel;
Panel17: TPanel;
Panel18: TPanel;
Label12: TLabel;
EdtEngAudting: TEdit;
Panel19: TPanel;
Panel20: TPanel;
Panel21: TPanel;
Panel22: TPanel;
Panel23: TPanel;
StringGrid1: TStringGrid;
Panel24: TPanel;
StringGrid2: TStringGrid;
Panel25: TPanel;
Panel26: TPanel;
StringGrid3: TStringGrid;
Panel27: TPanel;
Panel28: TPanel;
StringGrid4: TStringGrid;
Panel29: TPanel;
Label13: TLabel;
BitBtnpost: TBitBtn;
BitBtn2: TBitBtn;
BitBtnPrintBarcode: TBitBtn;
ProgressBar1: TProgressBar;
Panel30: TPanel;
MemoRDMemo: TMemo;
Panel31: TPanel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
EdtSpecificPro: TEdit;
EdtApplyDept: TEdit;
EdtProPrincipal: TEdit;
Panel32: TPanel;
Label9: TLabel;
RvDataSetConnectionBarCode: TRvDataSetConnection;
RvProjectBarCode: TRvProject;
RvSystemBarCode: TRvSystem;
Label14: TLabel;
DateTimePickerPostDate: TDateTimePicker;
Panel33: TPanel;
Splitter1: TSplitter;
MemoMemo: TMemo;
fcTreeViewBarCode: TTreeView;
procedure FormCreate(Sender: TObject);
procedure StringGridOrderDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure StringGridOrderSelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
procedure FormResize(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure BitBtnpostClick(Sender: TObject);
procedure ComboBoxDevNameKeyPress(Sender: TObject; var Key: Char);
procedure BitBtnPrintBarcodeClick(Sender: TObject);
procedure EdtOrderIDKeyPress(Sender: TObject; var Key: Char);
private
Canselect: boolean; // :=true
procedure EdtDevNameKeyPressInt(Sender: TObject; var Key: Char);
procedure EdtDevNameKeyPressStr(Sender: TObject; var Key: Char);
function CreateMachineNumberStar(Devnum: dword; postDate: Tdate; orderIDStr: string): string;
function CreateSerialNumberStart(DevNumINT: dword; postDate: tdate; orderIDStr: string): string;
procedure loadBarcodeToTreeView;
{ Private declarations }
public
{ Public declarations }
end;
var
FrmOrderToBarCode: TFrmOrderToBarCode;
implementation
uses PublicFunction, StockDataModel, DB, ADODB, PublicParameter;
{$R *.dfm}
procedure TFrmOrderToBarCode.FormCreate(Sender: TObject);
var i: integer;
begin
inherited;
Label13.Caption := '通' + #10#13 + '用';
DateTimePickerPostDate.Date := date;
EdtDevName.Text := '';
MemoMemo.Lines.Clear;
with StringGridOrder do
begin
ColCount := 4;
RowCount := 31;
ColWidths[0] := 25;
Cells[0, 0] := '序號$$M'; //
cells[1, 0] := '名稱與規格$$M'; //
Cells[2, 0] := '數量$$M'; //
Cells[3, 0] := '配置說明$$M'; //
for i := 1 to StringGridOrder.RowCount - 1 do
begin
Cells[0, i] := inttostr(i);
end;
end;
end;
procedure TFrmOrderToBarCode.StringGridOrderDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
inherited;
gridDrawCell(Sender, ACol, ARow, Rect, State);
end;
procedure TFrmOrderToBarCode.StringGridOrderSelectCell(Sender: TObject;
ACol, ARow: Integer; var CanSelect: Boolean);
var
i: integer;
begin
inherited;
EdtDevName.Visible := false;
comboboxDevName.Visible := false;
MemoMemo.Visible := false;
with StringGridOrder do
begin
if col = 3 then cells[col, row] := MemoMemo.Text;
if col = 2 then cells[col, row] := EdtDevName.text;
if col = 1 then Cells[col, row] := ComboBoxDevName.Text;
end;
if acol = 1 then
begin
ComboBoxDevName.Visible := true;
ComboBoxDevName.Text := StringGridOrder.Cells[acol, arow];
with StringGridOrder.CellRect(acol, arow) do
begin
ComboBoxDevName.Parent := StringGridOrder;
ComboBoxDevName.Top := top;
ComboBoxDevName.Left := left;
ComboBoxDevName.Width := right - left;
ComboBoxDevName.Height := (bottom - top) * (ComboBoxDevName.Items.Count + 1);
ComboBoxDevName.Visible := true;
ComboBoxDevName.SetFocus;
end;
end; //end if acol=0 then
if acol = 2 then
begin
EdtDevName.Visible := true;
if ACol = 2 then EdtDevName.OnKeyPress := EdtDevNameKeyPressInt;
if ACol = 3 then EdtDevName.OnKeyPress := nil; // EdtDevNameKeyPressStr
EdtDevName.Text := StringGridOrder.Cells[acol, arow];
with StringGridOrder.CellRect(acol, arow) do
begin
EdtDevName.Parent := StringGridOrder;
EdtDevName.Top := top + 1;
EdtDevName.Left := left + 1;
EdtDevName.Width := right - left - 2;
EdtDevName.Height := bottom - top - 2;
EdtDevName.SetFocus;
end;
end;
if acol = 3 then
begin
MemoMemo.Visible := true;
MemoMemo.Text := StringGridOrder.Cells[acol, arow];
with StringGridOrder.CellRect(acol, arow) do
begin
MemoMemo.Parent := StringGridOrder;
MemoMemo.Top := top + 1;
MemoMemo.Left := left + 1;
MemoMemo.Width := right - left - 2;
MemoMemo.Height := bottom - top - 2;
MemoMemo.SetFocus;
end;
end;
end;
procedure TFrmOrderToBarCode.FormResize(Sender: TObject);
begin
inherited;
with StringGridOrder do
begin
ColWidths[3] := Width - (ColWidths[0] + ColWidths[1] + ColWidths[2] + BorderWidth + 20);
end;
end;
procedure TFrmOrderToBarCode.FormShow(Sender: TObject);
begin
inherited;
ComboBoxDevName.Items.AddStrings(GetValueToCMB('DeviceType', 'DevName', 'All'));
with StringGridOrder do
begin
ColWidths[3] := Width - (ColWidths[0] + ColWidths[1] + ColWidths[2] + BorderWidth + 20);
end;
end;
procedure TFrmOrderToBarCode.EdtDevNameKeyPressInt(Sender: TObject;
var Key: Char);
begin
inherited;
if (not (Key in ['0'..'9', '.', #8])) then Key := #0;
end;
procedure TFrmOrderToBarCode.EdtDevNameKeyPressStr(Sender: TObject;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -