Convert.ToInt32(string '000000003') 变成了 3
Convert.ToInt32(string '000000003') 变成了 3
但是在查询的时候需要用的是string 这里的convert.toint32 反而起了坏作用,不是所有的时候都要用convert,
public int InvalidEntry(FormCollection collection)
{
int startNumber = Convert.ToInt32(collection["StartNumber"]);
int endNumber = Convert.ToInt32(collection["EndNumber"]);
DateTime refundDate = Convert.ToDateTime(collection["RefundDate"]);
string refundRemark = collection["RefundRemark"];
int number = endNumber - startNumber;
if (number > -)
{
int result = ;
for (int i = startNumber; i <= endNumber; i++)
{
InvoiceInfor invoiceInforerror = this.OMService.GetInvoiceInforDetailByNumber(Convert.ToString(i).PadLeft(, ''));
//1为未开
if (invoiceInforerror.Status == (int)EnumInvoiceInforStatus.NotOpen)
{
invoiceInforerror.Status = (int)EnumInvoiceInforStatus.Invalid;//三为废票
invoiceInforerror.Remark = "该票是废票,缘由:" + refundRemark;
invoiceInforerror.BillingDate = refundDate;
invoiceInforerror.Biller = this.UserContext.LoginInfo.UserName;
invoiceInforerror.RefundMoney = ;
if (this.OMService.SaveInvoiceInfor(invoiceInforerror))
{
//录入废票日志
string context = "录入废票;废票ID:" + invoiceInforerror.ID + ";错票号码:" + invoiceInforerror.Number + ";错票缘由:" + invoiceInforerror.Remark;
this.OMService.SaveOMLog(, "InvoiceInfor", invoiceInforerror.ID, context, this.UserContext.LoginInfo.UserID, this.UserContext.LoginInfo.UserName,);
result = ;
}
else
{
//保存失败
result = ;
}
}
else
{
result = ;
}
}
return result;
}
else
{
//截止号码必须大于或等于起始号码
return ;
} }
Convert.ToInt32(string '000000003') 变成了 3的更多相关文章
- (int),Convert.ToInt32(),Int32.Parse(),Int32.TryParsed()的用法总结
1 (int) 强制转型为整型. 当将long,float,double,decimal等类型转换成int类型时可采用这种方式. double dblNum = 20; int intDblNum = ...
- C#整数三种强制类型转换int、Convert.ToInt32()、int.Parse()、string到object 的区别
1.int适合简单数据类型之间的转换,C#的默认整型是int32(不支持bool型); 2.int.Parse(string sParameter)是个构造函数,参数类型只支持string类型; 3. ...
- Convert.ToInt32()、int.Parse()和(int)三者的区别
Convert.ToInt32将object类类型转换成int类型,如Convert.ToInt32(session["shuzi"]); (int)适合简单数据类型之间的转换: ...
- [No000082]Convert和Parse的区别/Convert.ToInt32()与int.Parse()的区别
(1)这两个方法的最大不同是它们对null值的处理方法: Convert.ToInt32(null)会返回0而不会产生任何异常,但int.Parse(null)则会产生异常. 没搞清楚Convert. ...
- C#中(int)、int.Parse()、int.TryParse()和Convert.ToInt32()的区别
转自:http://www.cnblogs.com/leolis/p/3968943.html 在编程过程中,数据转换是经常要用到的,C#中数据转换的方法很多,拿将目标对象转换为 整型(int)来讲, ...
- C#中(int)、int.Parse()、int.TryParse()和Convert.ToInt32()的区别 <转>
作者:Statmoon 出处:http://leolis.cnblogs.com/ 在编程过程中,数据转换是经常要用到的,C#中数据转换的方法很多,拿将目标对象转换为整型(int)来讲,有四种方法 ...
- Convert.ToInt32()与int.Parse()的区别
Convert.ToInt32()与int.Parse()的区别 (1)这两个方法的最大不同是它们对null值的处理方法: Convert.ToInt32(null)会返回0而不会产生任何异常, ...
- (int)、int.Parse()、int.TryParse()和Convert.ToInt32()的区别
C#中(int).int.Parse().int.TryParse()和Convert.ToInt32()的区别 原文链接:http://www.cnblogs.com/leolis/p/3968 ...
- Convert.ToInt32,int.Parse,int.TryParse,(int)的区别
1 (int)变量名[强制类型转换] 该转换方式主要用于数字类型转换,从int类型到long,float,double,decimal类型,可以使用隐式转换,但是从long类型到int类型就需要使用显 ...
随机推荐
- docker集群——搭建Mesos+Zookeeper+Marathon的Docker管理平台
服务器架构 机器信息: 这里部属的机器为3个Master控制节点,3个slave运行节点,其中: zookeeper.Mesos-master.marathon运行在Master端:Mesos-sla ...
- 网页视频播放方案chimee 组件使用
1.概述 鉴于目前 H5-Video 在 Web 生态环境中存在较大差异化(兼容性)的表现,本文主要介绍使用奇舞团开发chimee 组件进行视频播放的用法. chimee 组件地址: http://c ...
- kinect脸部三维数据特征点标签语义具体说明
非常多零零碎碎的事情,导致非常久没写blog了.face animation的demo做完了也快一个月了.是时候总结总结了. Kinect获得的标识点共用121个.其给的sdk里面也给出了响应的标签. ...
- java自定义注解与反射
java注解与反射一.Java中提供了四种元注解,专门负责注解其他的注解,分别如下 1.@Retention元注解,表示需要在什么级别保存该注释信息(生命周期).可选的RetentionPoicy参数 ...
- linux文本命令
1.find和grep find命令的作用是在目录中根据文件名搜索文件,grep命令的作用是在目录中根据文件内容搜索文件,find和grep的使用权限是所有用户. (1)find命令: find 列出 ...
- C-C Primer Plus阅读笔记
常用头: stdio.h string.h inttypes.h limits.h float.h 1.打印short.long.long long和unsigned #include <std ...
- 纪念我人生中第一个merge into语句
做按组织关系汇总功能时,当数据量特别大,或者汇总组织特别多时,运行效率特别低,于是使用了merge into语句. 代码如下: public void updateInsertData(DataSet ...
- event.returnvalue = false的使用
event.returnvalue false代表不接收事件返回值 <script language="JavaScript"> //Ctrl+s保存 document ...
- redis主从持久化讨论
Redis有两种持久化方式,AOF和RDB,AOF持久化是指追加写命令到aof文件的方式,RDB是指定期保存内存快照到rdb文件的方式. RDB虽然可以通过bgsave指令后台保存快照,但fork() ...
- ping的原理以及ICMP
ping 的原理: ping 程序是用来探测主机到主机之间是否可通信,如果不能ping到某台主机,表明不能和这台主机建立连接. ping 使用的是ICMP协议,它发送icmp回送请求消 ...