格式化字符串时,遇到空字符不能格式化。

 1.string类型格式string类型。

                            cuscodenew = cusaccount.Element("cuscodenew").Value,
                            accdate = string.IsNullOrEmpty(cusaccount.Element("accdate").Value.ToString()) ? "" : DataTypeHelper.GetDateTime(cusaccount.Element("accdate").Value).ToString("dd-MM-yyyy"),
                            billcode = cusaccount.Element("billcode").Value,
                            cno = cusaccount.Element("cno").Value,
                            description = cusaccount.Element("description").Value,
                            payin = DataTypeHelper.GetDecimal(cusaccount.Element("payin").Value,0).ToString("N"),
                            ccp = DataTypeHelper.GetDecimal(cusaccount.Element("ccp").Value,0).ToString("N"),
                            camount =DataTypeHelper.GetDecimal(cusaccount.Element("camount").Value,0).ToString("N"),
                            dif = DataTypeHelper.GetDecimal(cusaccount.Element("dif").Value,0).ToString("N"),
                            totalbalance = DataTypeHelper.GetDecimal(cusaccount.Element("totalbalance").Value,0).ToString("N")

 

 

posted @ 2014-03-26 12:02  飞翔.  阅读(247)  评论(0编辑  收藏  举报