赋值

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. python中变量

    在Python中,变量的概念基本上和初中代数的方程变量是一致的. 例如,对于方程式 y=x*x ,x就是变量.当x=2时,计算结果是4,当x=5时,计算结果是25. 只是在计算机程序中,变量不仅可以是 ...

  2. Code for the Homework1 改进

    #include <iostream> #include <vector> #include "shape.h" //using namespace std ...

  3. 1047: [HAOI2007]理想的正方形 - BZOJ

    Description 有一个a*b的整数组成的矩阵,现请你从中找出一个n*n的正方形区域,使得该区域所有数中的最大值和最小值的差最小.Input 第一行为3个整数,分别表示a,b,n的值第二行至第a ...

  4. 2038: [2009国家集训队]小Z的袜子(hose) - BZOJ

    Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿.终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z把这N只 ...

  5. springMVC+MyBatis+Spring 整合(3)

    spring mvc 与mybatis 的整合. 加入配置文件: spring-mybaits.xml <?xml version="1.0" encoding=" ...

  6. tomcat启动报错:Unsupported major.minor version 51.0

    myeclipse中添加项目后,发现项目启动时报错:Unsupported major.minor version 51.0 因为tomcat使用的jdk版本不支持你项目的jdk版本,需要你在myec ...

  7. [转载]c# winform 获取当前程序运行根目录

    // 获取程序的基目录. System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径. System.Diagnostics.Process.G ...

  8. 为什么样本方差(sample variance)的分母是 n-1?

    为什么样本方差(sample variance)的分母是 n-1? (補充一句哦,題主問的方差 estimator 通常用 moments 方法估計.如果用的是 ML 方法,請不要多想不是你們想的那樣 ...

  9. css3属性整理

    浏览器内核:主流内容主要有Mozilla(熟悉的有Firefox,Flock等浏览器).WebKit(熟悉的有Safari.Chrome等浏览器).Opera(Opera浏览器).Trident(讨厌 ...

  10. Android的三种网络通信方式

    Android平台有三种网络接口可以使用,他们分别是:java.net.*(标准Java接口).Org.apache接口和Android.net.*(Android网络接口).下面分别介绍这些接口的功 ...