赋值

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. ios app - 打开系统设置URL

    ios --- 调用系统"设置"里的功能(转) 安装后第一次运行软件时,系统会弹出提示用户是否允许软件获取当前位置,如果用户不允许的话,之后运行时系统不会在弹出提示设置,这点很不方 ...

  2. 使用Sqlserver事务发布实现数据同步

    事务的功能在sqlserver中由来已久,因为最近在做一个数据同步方案,所以有机会再次研究一下它以及快照等,发现还是有很多不错的功能和改进 的.这里以sqlserver2008的事务发布功能为例,对发 ...

  3. (转)Const,Const函数,Const变量,函数后面的Const

    本文转自http://www.cnblogs.com/Fancyboy2004/archive/2008/12/23/1360810.html 看到const 关键字,C++程序员首先想到的可能是co ...

  4. 1187: [HNOI2007]神奇游乐园 - BZOJ

    Description 经历了一段艰辛的旅程后,主人公小P乘坐飞艇返回.在返回的途中,小P发现在漫无边际的沙漠中,有一块狭长的绿地特别显眼.往下仔细一看,才发现这是一个游乐场,专为旅途中疲惫的人设计. ...

  5. linux 添加用户

    1.下面就开始来说怎么添加新用户 我们以添加一个用户名为jorcen的新用户为例来说明,执行下面的命令: # useradd jorcen 2.那么就新用户就添加完成,但是没有任何信息,新用户添加完成 ...

  6. android中的category静态值(转)

    提供将要执行的action的额外信息,一般在隐式地启动activity时需要用到.常见的category如下 CATEGORY_ALTERNATIVE 设置这个activity是否可以被认为是用户正在 ...

  7. Flume学习——BasicChannelSemantics

    public class MemoryChannel extends BasicChannelSemantics public abstract class BasicChannelSemantics ...

  8. c/c++强制类型转换

    转自c/c++强制类型转换 Q:什么是C风格转换?什么是static_cast, dynamic_cast 以及 reinterpret_cast?区别是什么?为什么要注意? A:转换的含义是通过改变 ...

  9. 【leetcode】Permutations II (middle)

    Given a collection of numbers that might contain duplicates, return all possible unique permutations ...

  10. DJANGO输出HIGHCHARTS数据的样例

    XXX,DJANGO ORM里确实有很深的水,需要慢慢理解.. 比如: 获取指定时间段的数据: app.deployversion_set.filter(add_date__range=(date_s ...