赋值

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. java 构造函数

    1.public className(){}. 2.名称与类名相同,无返回值,无返回类型,void也不行.(就是上边的形式,除了可以有参数). 3.有0个或多个参数. 4.每个类都至少有一个const ...

  2. Lua基础之coroutine(协程)

    概括:1.创建协程2.coroutine的函数3.coroutine的基本流程4.yield对coroutine流程的干预5.resume, function()以及yield之间的参数传递和返回值传 ...

  3. 微软职位内部推荐-Sr DEV Lead, Bing Search Relevance

    微软近期Open的职位: Contact Person: Winnie Wei (wiwe@microsoft.com )Sr DEV Lead, Bing Search RelevanceLocat ...

  4. 在这里总结一些iOS开发中的小技巧,能大大方便我们的开发,持续更新。

    UITableView的Group样式下顶部空白处理 //分组列表头部空白处理 UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0 ...

  5. 过滤菜鸟的iOS面试题-b

    网上已经有很多针对各种知识点的面试题,面试时有些人未必真正理解也能通过背题看上去很懂.我自己总结了4道面试题,好快速的判断这个人是否是一个合格的工程师,欢迎大家点评. 1.struct和class的区 ...

  6. dubbo zookeeper模型

    本文摘自dubbo的官方文档,原文请参见: http://alibaba.github.io/dubbo-doc-static/User+Guide-zh.htm#UserGuide-zh-Zooke ...

  7. python读写配置文件

    #coding:utf-8 import ConfigParser class Conf(): def __init__(self,name): self.name = name self.cp = ...

  8. memmove 和 memcpy的区别

    memcpy和memmove()都是C语言中的库函数,在头文件string.h中,作用是拷贝一定长度的内存的内容,原型分别如下:void *memcpy(void *dst, const void * ...

  9. 【BZOJ 3343 】 分块

    3343: 教主的魔法 Description 教主最近学会了一种神奇的魔法,能够使人长高.于是他准备演示给XMYZ信息组每个英雄看.于是N个英雄们又一次聚集在了一起,这次他们排成了一列,被编号为1. ...

  10. MapReduce编程系列 — 2:计算平均分

    1.项目名称: 2.程序代码: package com.averagescorecount; import java.io.IOException; import java.util.Iterator ...