赋值

AOrder.LoadSimpleFromFile(sDefineFile);
grdRowFileDefine_PostalCode.Properties.Value := AOrder.OrderCode;
grdRowFileDefine_CardKind.Properties.Value := TMonitor.GetCardKindCHS(AOrder.OrderKind);
grdRowFileDefine_SendUser.Properties.Value := AOrder.SendUser;
grdRowFileDefine_SendEmail.Properties.Value := AOrder.SendEmail;
grdRowFileDefine_SendPhone.Properties.Value := AOrder.SendPhone;
grdRowFileDefine_SendAddress.Properties.Value := AOrder.SendAddress;

procedure SetRowProperties(ARow: TcxEditorRow; AValue: Variant);
begin
AValue := VarToStrDef(AValue, '');
if AValue = '' then
AValue := null;
try
ARow.Properties.Value := AValue;
except
ARow.Properties.Value := null;
end;

{ if ARow.Properties.EditPropertiesClass = TcxDateEditProperties then
begin
dTime := StrToDateTimeDef(AValue, 0);
if dTime = 0 then ARow.Properties.Value := null
else ARow.Properties.Value := dTime;
end
else if VarToStrDef(AValue, '') = '' then
begin
if not ARow.Properties.DataBinding.ValueTypeClass.IsString then
AValue := 0;
end;

try
ARow.Properties.Value := AValue;
finally
end; }
end;

function GetRowProperties(ARow: TcxEditorRow): string;
begin
result := VarToStrDef(ARow.Properties.Value, '');
end;

mySql := 'select * from stCardPlate where iBillID=' + IntToStr(ABillID);
OpenQuery(qryUnit, mySql);
with qryUnit do
begin
if qryUnit.Eof then
begin
(* 默认制版信息 *)
SetRowProperties(vgPlateCRevColor, 'K,C,M,Y');
SetRowProperties(vgPlateCObvColor, 'K,C,M,Y');
SetRowProperties(vgPlateIProof, '1');
SetRowProperties(vgPlateIFilm, '1');
end
else begin
TPrinterpAngel.QueryToVerticalGrid(vgPlate, qryUnit, 'vgPlate');
SetRowProperties(vgPlateCObvColor, FieldByName('cObvColor').AsString);
SetRowProperties(vgPlateCRevColor, FieldByName('cRevColor').AsString);
SetRowProperties(vgPlateIProof, FieldByName('iProof').AsString);
SetRowProperties(vgPlateIFilm, FieldByName('iFilm').AsString);
SetRowProperties(vgPlateCWorkShop, FieldByName('cWorkShop').AsString);
end;
end;
(* 印刷信息 *)
mySql := 'select * from stCardPrint where iBillID=' + IntToStr(ABillID);
OpenQuery(qryUnit, mySql);
with qryUnit do
begin
if qryUnit.Eof then
begin
(* 默认印刷信息 *)
end
else begin
TPrinterpAngel.QueryToVerticalGrid(vgPrint, qryUnit, 'vgPrint');
end;
end;
(* 印刷机型 *)
mySql := 'select id, cbmmc from dzbm where cbmlb = ''生产'' order by id';
OpenQuery(qryUnit, mySql);
while not qryUnit.Eof do
begin
with TcxImageComboBoxProperties(vgPlateCWorkShop.Properties.EditProperties).Items.Add do
begin
Value := qryUnit.FieldByName('cbmmc').AsString;
Description := qryUnit.FieldByName('cbmmc').AsString;
end;
with TcxImageComboBoxProperties(vgPrintCWorkShop.Properties.EditProperties).Items.Add do
begin
Value := qryUnit.FieldByName('cbmmc').AsString;
Description := qryUnit.FieldByName('cbmmc').AsString;
end;
qryUnit.Next;
end;

function TfrmStampCardProduce.DataSave: boolean;
var
sqlList: TStringList;
begin
sqlList := TStringList.Create;
(* 制版 *)
sqlList.Add('if not Exists(select 1 from stcardplate where ibillid=' + IntToStr(FBillID) + ') ' +
' insert into stcardplate(ibillid, dplanComplete, iRevFilm, iObvFilm) ' +
' values(' + IntToStr(FBillID) + ', 0, 0, 0)');
sqlList.Add('Update stcardplate set ' +
' cRevColor=''' + GetRowProperties(vgPlateCRevColor) + '''' +
',cObvColor=''' + GetRowProperties(vgPlateCObvColor) + '''' +
',iProof=' + IntToStr(StrToIntPrint(GetRowProperties(vgPlateIProof))) +
',iFilm=' + IntToStr(StrToIntPrint(GetRowProperties(vgPlateIFilm))) +
',iRevFilm=' + IntToStr(StrToIntPrint(GetRowProperties(vgPlateIRevFilm))) +
',iObvFilm=' + IntToStr(StrToIntPrint(GetRowProperties(vgPlateIObvFilm))) +
',dPlanComplete=''' + FormatDateTime('yyyy-mm-dd', StrToIntPrint(GetRowProperties(vgPlateDPlanComplete))) + '''' +
',CWorkShop=''' + vgPlateCWorkShop.Properties.Value + '''' +
',cMemo=''' + GetRowProperties(vgPlateCMemo) + '''' +
' where ibillID=' + IntToStr(FBillid));

(* 印刷 *)
sqlList.Add('if not Exists(select 1 from stcardPrint where ibillid=' + IntToStr(FBillID) + ') ' +
' insert into stcardPrint(ibillid, dplanComplete, iPaperid, iMachineid)' +
' values(' + IntToStr(FBillID) + ', 0, 0, 0)');
sqlList.Add('Update stcardPrint set ' +
' cRevColor=''' + GetRowProperties(vgPrintCRevColor) + '''' +
',cObvColor=''' + GetRowProperties(vgPrintCObvColor) + '''' +
',cWorkShop=''' + GetRowProperties(vgPrintCWorkShop) + '''' +
',iPaperid=' + IntToStr(StrToIntPrint(GetRowProperties(vgPrintIPaperID))) +
',iPaperConsume=' + IntToStr(StrToIntPrint(GetRowProperties(vgPrintIPaperConsume))) +
',iPaperGross=' + IntToStr(StrToIntPrint(GetRowProperties(vgPrintIPaperGross))) +
',iDelivery=' + IntToStr(StrToIntPrint(GetRowProperties(vgPrintIDelivery))) +
',nEligible=' + IntToStr(StrToIntPrint(GetRowProperties(vgPrintNEligible))) +
',dPlanComplete=''' + FormatDateTime('yyyy-mm-dd', StrToIntPrint(GetRowProperties(vgPrintDPlanComplete))) + '''' +
',cMemo=''' + GetRowProperties(vgPrintCMemo) + '''' +
' where ibillID=' + IntToStr(FBillid));

try
TPrinterpAngel.ExecuteSQLs(sqlList);
finally
sqlList.Free;
end;
result := True;
end;

TcxVerticalGrid 汇总的更多相关文章

  1. 常用 Gulp 插件汇总 —— 基于 Gulp 的前端集成解决方案(三)

    前两篇文章讨论了 Gulp 的安装部署及基本概念,借助于 Gulp 强大的 插件生态 可以完成很多常见的和不常见的任务.本文主要汇总常用的 Gulp 插件及其基本使用,需要读者对 Gulp 有一个基本 ...

  2. 异常处理汇总 ~ 修正果带着你的Net飞奔吧!

    经验库开源地址:https://github.com/dunitian/LoTDotNet 异常处理汇总-服 务 器 http://www.cnblogs.com/dunitian/p/4522983 ...

  3. UWP开发必备:常用数据列表控件汇总比较

    今天是想通过实例将UWP开发常用的数据列表做汇总比较,作为以后项目开发参考.UWP开发必备知识点总结请参照[UWP开发必备以及常用知识点总结]. 本次主要讨论以下控件: GridView:用于显示数据 ...

  4. Oracle手边常用70则脚本知识汇总

    Oracle手边常用70则脚本知识汇总 作者:白宁超 时间:2016年3月4日13:58:36 摘要: 日常使用oracle数据库过程中,常用脚本命令莫不是用户和密码.表空间.多表联合.执行语句等常规 ...

  5. Oracle 数据库知识汇总篇

    Oracle 数据库知识汇总篇(更新中..) 1.安装部署篇 2.管理维护篇 3.数据迁移篇 4.故障处理篇 5.性能调优篇 6.SQL PL/SQL篇 7.考试认证篇 8.原理体系篇 9.架构设计篇 ...

  6. Vertica 数据库知识汇总篇

    Vertica 数据库知识汇总篇(更新中..) 1.Vertica 集群软件部署,各节点硬件性能测试 2.Vertica 创建数据库,创建业务用户测试 3.Vertica 数据库参数调整,资源池分配 ...

  7. 读书笔记汇总 - SQL必知必会(第4版)

    本系列记录并分享学习SQL的过程,主要内容为SQL的基础概念及练习过程. 书目信息 中文名:<SQL必知必会(第4版)> 英文名:<Sams Teach Yourself SQL i ...

  8. 关于DDD的学习资料汇总

    DDD(Domain-Driven Design)领域驱动设计,第一次看到DDD是在学习ABP时,在其中的介绍中看到的.what,DDD是个什么鬼,我不是小白,是大白,没听过.于是乎,度娘查查查,找到 ...

  9. Oracle 列数据聚合方法汇总

    网上流传众多列数据聚合方法,现将各方法整理汇总,以做备忘. wm_concat 该方法来自wmsys下的wm_concat函数,属于Oracle内部函数,返回值类型varchar2,最大字符数4000 ...

随机推荐

  1. Spring Aop实例之xml配置

    AOP的配置方式有2种方式:xml配置和AspectJ注解方式.今天我们就来实践一下xml配置方式. 我采用的jdk代理,所以首先将接口和实现类代码附上 package com.tgb.aop; pu ...

  2. 微软职位内部推荐-Sr SDE-MOD-Beijing

    微软近期Open的职位: JOB TITLE: Senior Software Design EngineerDEPARTMENT: Microsoft Office Division ChinaIM ...

  3. Gnome 插件介绍

    插件:Applications Menuhttps://extensions.gnome.org/extension/6/applications-menu/ TopIconshttps://exte ...

  4. 使用Yeoman搭建 AngularJS 应用 (12) —— 让我们搭建一个网页应用

    原文地址:http://yeoman.io/codelab/local-storage.html 安装Bower程序包 我们使用另一个Angular模块,"angular-local-sto ...

  5. Spring 声明式事务,propagation属性列表及isolation(隔离级别)

    Spring 声明式事务,propagation属性列表 TransactionDefinition接口中定义,共有7种选项可用: PROPAGATION_REQUIRED:支持当前事务,如果当前没有 ...

  6. The 11th Zhejiang Provincial Collegiate Programming Contest->Problem G:G - Ternary Calculation

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3782 题意:把输入的三元运算用计算机运算出来. ;          ci ...

  7. 汇编之FS段寄存器

    FS寄存器指向当前活动线程的TEB结构(线程结构) 偏移  说明 000  指向SEH链指针 004  线程堆栈顶部 008  线程堆栈底部 00C  SubSystemTib 010  FiberD ...

  8. [BEC][hujiang] Lesson04 Unit1:Working life ---Reading + Listening &Grammar & Speaking

    4 1.1 Working life    P10 Reading----The anonymous CV Exercise 3  What should be included in the CV ...

  9. URAL 1012 K-based Numbers. Version 2(DP+高精度)

    题目链接 题意 :与1009一样,不过这个题的数据范围变大. 思路:因为数据范围变大,所以要用大数模拟,用java也行,大数模拟也没什么不过变成二维再做就行了呗.当然也可以先把所有的都进行打表,不过要 ...

  10. android 图片画画板

    canvas.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns: ...