asp.net 导入excel文件

  

前台页面:

 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="b2ccarriersimport.aspx.cs" Inherits="web.financeimport.b2ccarriersimport" %>

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<link href="/css/default.css" rel="stylesheet" type="text/css" />
<link href="/css/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="/js/jquery.ui.datepicker.js"></script>
<script src="/js/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/common.js?r=20140613"></script>
</head>
<body>
<form id="form1" runat="server">
<div class="container">
<div class="content">
<div class="cPanel pbg">
<div class="detailPanel" style="padding: 0">
<table cellpadding="0" cellspacing="0" class="oderAdmin">
<tr>
<td colspan="2">
B2C航司导入
</td>
</tr>
<tr>
<th>
</th>
<td>
<asp:FileUpload ID="file" runat="server" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button
ID="btnok" CssClass="button button-primary" runat="server" Text="导入航司报表" OnClick="btnok_Click" />
</td>
</tr>
<tr>
<th>
</th>
<td style="color: Red">
注意:文件名必须是XXX-XXX-X这样的类型组合【不允许使用其它的相隔符】-(目前可导入账单包括【<span style="color: Green"> SZX348-KY;SZX348-KY-R;SZX348-ZH;SZX348-ZH-R</span>】)
</td>
</tr>
<tr><th></th><td><asp:Label style="color:Red;font-size:xx-large" ID="lbmessage" runat="server" Text="请选择您要导入的航司文件"></asp:Label></td></tr>
</table>
</div><div style="display:none"><asp:Button
ID="Button1" CssClass="button button-primary"
runat="server" Text="匹配数据" onclick="Button1_Click" /></div>
</div>
</div>
<div class="clr">
</div>
</div>
</form>
</body>
</html>

后台页面:

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using web.code;
using MySql.Data.MySqlClient;
using System.Threading;
using webframework.model;
using webframework.bll; namespace web.financeimport
{
public partial class b2ccarriersimport : System.Web.UI.Page
{
private bllFI_repsource_excel bll = new bllFI_repsource_excel();
private static DataTable dt = new DataTable();
private static string FI_Aircode = "";
private static string FI_Office = "";
private static string EndFlag = "";
protected void Page_Load(object sender, EventArgs e)
{ } protected void btnok_Click(object sender, EventArgs e)
{
if (file.HasFile)
{
bool fileOK = false;
if (!string.IsNullOrEmpty(FI_Aircode)) FI_Aircode = "";
if (!string.IsNullOrEmpty(FI_Office)) FI_Office = "";
if (!string.IsNullOrEmpty(EndFlag)) EndFlag = "";
if (dt != null || dt.Rows.Count > ) dt.Clear();
String fileExtension = Path.GetExtension(file.FileName).ToLower();
string qianzhui = Path.GetFileNameWithoutExtension(file.FileName);
FI_Aircode = qianzhui.Split('-')[].ToUpper();
FI_Office = qianzhui.Split('-')[].ToUpper();
EndFlag = qianzhui.Split('-').Length == ? qianzhui.Split('-')[].ToUpper() : "";
String[] allowedExtensions = { ".xls", ".xlsx", ".csv", ".CSV" };
for (int i = ; i < allowedExtensions.Length; i++)
{
if (fileExtension == allowedExtensions[i])
{
fileOK = true;
}
}
if (fileOK)
{
string path = Server.MapPath("~/Temp/");
if (!System.IO.Directory.Exists(path))
{
System.IO.Directory.CreateDirectory(path);
}
try
{
path = path + file.FileName;
file.SaveAs(path);
if (!AnaylerXls(path, fileExtension, FI_Aircode, FI_Office, EndFlag))
{
Alert("报表解析失败");
}
}
catch (Exception ex)
{
Alert("程序出错:" + ex.TargetSite + "==[" + ex.Message + "]");
}
}
else
{
Alert("文件格式错误,只支持xls/xlsx/csv");
}
}
else
{
Alert("请选择文件");
}
} private bool AnaylerXls(string path, String filetype, string FI_Aircode, string FI_Office, string EndFlag)
{
if (dt == null) dt = new DataTable();
if (filetype.Contains("xlsx"))
{
#region<<<<
#endregion
}
else if (filetype.Contains("xls"))
{
#region<<<
if (FI_Aircode.Contains("ZH"))
{
if (string.IsNullOrEmpty(EndFlag))
dt = ExcelHelper.GetExcelDataAsTableNPOI(path, "订单号");
else
dt = ExcelHelper.GetExcelDataAsTableNPOI(path, "订单编号");
}
if (FI_Aircode.Contains("KY"))
{
if (string.IsNullOrEmpty(EndFlag))
dt = ExcelHelper.GetExcelDataAsTableNPOI(path, "订单号");
else
dt = ExcelHelper.GetExcelDataAsTableNPOI(path, "订单编号");
}
else
{ }
#endregion
}
else
{
#region<<<< .zip svc格式
if (FI_Office.Contains("HFDZC"))
{
//dt = CSVUtil.getCsvDataBy(path, "序号");
}
else
{
//dt = CSVUtil.getCsvDataBy(path, "流水号");
}
#endregion
}
System.IO.File.Delete(path);
if (dt.Rows.Count > )
{
lbmessage.Text = "正在解析航司数据。。。,请勿关闭页面!";
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "success", "$(\"#Button1\").click();", true);
}
else
{
Alert("您选择的文件报表中没有数据");
}
return true;
} protected void Alert(string str)
{
lbmessage.Text = str;
//this.Page.ClientScript.RegisterStartupScript(this.GetType(), "success", "alert('" + str + "');", true);
}
private void InsertCarrierR(DataTable dt, string FI_Aircode, string FI_Office, string EndFlag)
{
DataTable newdt = CreateRepsource();
MySql.Data.MySqlClient.MySqlConnection conn = new MySqlConnection(webframework.common.Config.CONMYSQL_172_16_6_4_READ);
try
{
int connum = ;
DateTime nowtime = DateTime.Now;
foreach (DataRow dr in dt.Rows)
{
#region<<<数据入库
DataRow newdr = newdt.NewRow();
string tikeno = dr["票号"].ToString();
if (string.IsNullOrEmpty(tikeno))
continue;
newdr["FI_Eticket"] = dr["票号"].ToString().Replace("-", "").Trim(); newdr["FI_Aircode"] = FI_Aircode.Trim();
newdr["FI_Price"] = decimal.Parse(dr["原票金额"].ToString());
newdr["FI_Tax"] = decimal.Parse(dr["原票机场税"].ToString());
newdr["FI_Agenfee"] = ;
newdr["FI_Rate"] = ;
newdr["FI_Amount1"] = decimal.Parse(dr["订单支付金额"].ToString());
newdr["FI_Amount2"] = 0M; newdr["FI_DateIss"] = DateTime.Parse(dr["订单支付日期"].ToString());
newdr["FI_Pnr"] = dr["PNR编号"].ToString().Trim();
newdr["FI_Vendor"] = dr["退票旅行社编号"].ToString().Trim();
newdr["FI_Vnumber"] = dr["退票旅行社名称"].ToString().Trim();
newdr["FI_Orderno"] = dr["订单编号"].ToString().Trim();
newdr["FI_Paybank"] = dr["订单支付银行"].ToString().Trim();
newdr["FI_Bankno"] = dr["原支付平台流水号"].ToString().Replace("'", "").Trim();
newdr["FI_office"] = FI_Office;
newdr["FI_Cpnr"] = "";
newdr["FI_Jobno"] = "";
newdr["FI_Buyno"] = "";
newdr["FI_DataTyp"] = "B2B";
newdr["FI_Flag"] = "";
newdr["FI_OpMan"] = "F018";
newdr["FI_OpTime"] = DateTime.Now;
string sql = "SELECT o.orderState, o.outDate,j.startCity,j.reachCity,j.takeoffDate,j.seat,j.flightNo,jp.pnr,p.name,p.ptype FROM t_order o LEFT JOIN t_journey j ON o.id=j.orderId LEFT JOIN t_journeypassenger jp ON j.id=jp.journeyId LEFT JOIN t_passenger p ON jp.passengerId=p.id WHERE jp.tktNo1='{0}' ";
DataTable ordt = webframework.common.MySqlHelper.ExecuteDataTable(conn, CommandType.Text,
string.Format(sql, tikeno.Trim()), null);
if (ordt.Rows.Count > )
{ newdr["FI_toman"] = ordt.Rows[]["name"].ToString();
newdr["FI_mantype"] = ordt.Rows[]["ptype"].ToString() == "" ? "ADT" : "CHD"; newdr["FI_State"] = GetOrderStateDesc(ordt.Rows[]["orderState"].ToString());
newdr["FI_Voyage"] = ordt.Rows[]["startCity"].ToString().Trim() + "-" + ordt.Rows[]["reachCity"].ToString().Trim();
newdr["FI_Flight"] = ordt.Rows[]["flightNo"].ToString().Trim();
newdr["FI_Space"] = ordt.Rows[]["seat"].ToString().Trim();
newdr["FI_Dateto2"] = DateTime.Parse("1900-01-01");
newdr["FI_Dateto1"] = DateTime.Parse(ordt.Rows[]["takeoffDate"].ToString());
}
newdt.Rows.Add(newdr); #endregion
if (connum != && connum % == )
{
conn.Close();
}
connum++;
}
SqlHelper.BulkCopy("Initial Catalog=LHETWINDB;Data Source=(local);uid=sa;pwd=123", "FI_repsource", newdt, newdt.Rows.Count);
//SqlHelper.BulkCopy(webframework.common.Config.CONSQL_611_LHETWINDB, "FI_repsource", newdt, newdt.Rows.Count);
Alert("[" + FI_Office + "-" + FI_Aircode + (string.IsNullOrEmpty(EndFlag) ? "" : "-" + EndFlag) + "]导入航司成功[" + newdt.Rows.Count + "],耗时[" + (int)(DateTime.Now - nowtime).TotalSeconds + "]秒");
}
catch (Exception ex)
{
Alert("[" + FI_Office + "-" + FI_Aircode + (string.IsNullOrEmpty(EndFlag) ? "" : "-" + EndFlag) + "]报表导入数据报错:" + ex.Message);
}
finally
{
if (conn != null) conn.Dispose();
}
}
private void InsertCarrier(DataTable dt, string FI_Aircode, string FI_Office)
{
DataTable newdt = CreateRepsource();
MySql.Data.MySqlClient.MySqlConnection conn = new MySqlConnection(webframework.common.Config.CONMYSQL_172_16_6_4_READ);
try
{
int connum = ;
int count = ;
DateTime nowtime = DateTime.Now;
foreach (DataRow dr in dt.Rows)
{
#region<<<数据入库 string tikeno = dr["起始票号"].ToString();
string tikenoend = dr["终止票号"].ToString();
if (string.IsNullOrEmpty(tikeno))
continue;
if (tikeno != tikenoend)
{
string sql = @"SELECT o.outDate,o.orderNo,o.orderFrom,o.shopName,jp.tktNo1
FROM t_order o LEFT JOIN t_journey j
ON o.id=j.orderId LEFT JOIN t_journeypassenger jp
ON j.id=jp.journeyId WHERE o.orderNo=(
SELECT o.orderNo
FROM t_order o LEFT JOIN t_journey j
ON o.id=j.orderId LEFT JOIN t_journeypassenger jp
ON j.id=jp.journeyId WHERE jp.tktNo1='{0}'
) ";
DataTable ordt = webframework.common.MySqlHelper.ExecuteDataTable(conn, CommandType.Text,
string.Format(sql, tikeno.Trim()), null);
count = ordt.Rows.Count;
}
else
count = ; for (int i = ; i <= count; i++)
{
DataRow newdr = newdt.NewRow();
newdr["FI_Eticket"] = dr["起始票号"].ToString().Replace("-", "").Trim();
newdr["FI_State"] = dr["订单状态"].ToString().Trim();
newdr["FI_Aircode"] = FI_Aircode.Trim();
newdr["FI_Price"] = decimal.Parse(dr["票价"].ToString()) / count;
newdr["FI_Tax"] = decimal.Parse(dr["机建费"].ToString()) / count;
newdr["FI_Agenfee"] = ;
newdr["FI_Rate"] = ;
newdr["FI_Amount1"] = decimal.Parse(dr["支付金额"].ToString()) / count;
newdr["FI_Amount2"] = 0M;
newdr["FI_Voyage"] = dr["起飞城市1"].ToString().Trim() + "-" + dr["目的城市1"].ToString().Trim();
newdr["FI_Flight"] = dr["航班号1"].ToString().Trim();
newdr["FI_Space"] = dr["舱位1"].ToString().Trim();
newdr["FI_Dateto2"] = DateTime.Parse("1900-01-01");
newdr["FI_Dateto1"] = DateTime.Parse(dr["乘机日期1"].ToString());
newdr["FI_DateIss"] = DateTime.Parse(dr["出票日期"].ToString());
newdr["FI_Pnr"] = dr["PNR"].ToString().Trim();
newdr["FI_Vendor"] = dr["代理人号"].ToString().Trim();
newdr["FI_Vnumber"] = dr["操作人"].ToString().Trim();
newdr["FI_Orderno"] = dr["订单号"].ToString().Trim();
newdr["FI_Paybank"] = dr["支付银行"].ToString().Trim();
if (FI_Aircode == "KY")
{
newdr["FI_Bankno"] = dr["支付记帐号"].ToString().Replace("'", "").Trim();
}
else if (FI_Aircode == "ZH")
{
newdr["FI_Bankno"] = dr["支付平台流水号"].ToString().Replace("'", "").Trim();
} newdr["FI_office"] = FI_Office;
newdr["FI_Cpnr"] = "";
newdr["FI_Jobno"] = "";
newdr["FI_Buyno"] = "";
newdr["FI_DataTyp"] = "B2B";
newdr["FI_Flag"] = "";
newdr["FI_OpMan"] = "F013";
newdr["FI_OpTime"] = DateTime.Now;
string sql = @"SELECT p.name,p.ptype FROM
t_journeypassenger jp LEFT JOIN t_passenger p
ON jp.passengerId=p.id WHERE jp.tktNo1='{0}' ";
DataTable ordt = webframework.common.MySqlHelper.ExecuteDataTable(conn, CommandType.Text,
string.Format(sql, tikeno.Trim()), null);
if (ordt.Rows.Count > )
{
newdr["FI_toman"] = ordt.Rows[]["name"].ToString();
newdr["FI_mantype"] = ordt.Rows[]["ptype"].ToString() == "" ? "ADT" : "CHD";
}
newdt.Rows.Add(newdr);
}
#endregion
if (connum != && connum % == )
{
conn.Close();
}
connum++;
}
SqlHelper.BulkCopy("Initial Catalog=LHETWINDB;Data Source=(local);uid=sa;pwd=123", "FI_repsource", newdt, newdt.Rows.Count); //SqlHelper.BulkCopy(webframework.common.Config.CONSQL_611_LHETWINDB, "FI_repsource", newdt, newdt.Rows.Count);
Alert("[" + FI_Office + "-" + FI_Aircode + (string.IsNullOrEmpty(EndFlag) ? "" : "-" + EndFlag) + "]导入航司成功[" + newdt.Rows.Count + "],耗时[" + (int)(DateTime.Now - nowtime).TotalSeconds + "]秒");
}
catch (Exception ex)
{
Alert("[" + FI_Office + "-" + FI_Aircode + (string.IsNullOrEmpty(EndFlag) ? "" : "-" + EndFlag) + "]报表导入数据报错:" + ex.Message);
}
finally
{
if (conn != null) conn.Dispose();
}
} private void InsertCarrierRTemp(DataTable dt, string FI_Aircode, string FI_Office, string EndFlag)
{
List<modelFI_repsource_excel> list = new List<modelFI_repsource_excel>();
try
{
DateTime nowtime = DateTime.Now;
foreach (DataRow dr in dt.Rows)
{
//string tikeno = dr["票号"].ToString();
//if (string.IsNullOrEmpty(tikeno))
// continue;
string pnr = dr["PNR编号"].ToString().Trim();
if (string.IsNullOrEmpty(pnr))
continue;
modelFI_repsource_excel m = new modelFI_repsource_excel();
#region model赋值
m.FI_Eticket = dr["票号"].ToString().Replace("-", "").Trim();
m.FI_Aircode = FI_Aircode.Trim();
m.FI_Price = decimal.Parse(dr["原票金额"].ToString());
m.FI_Tax = decimal.Parse(dr["原票机场税"].ToString());
m.FI_Agenfee = ;
m.FI_Rate = ;
m.FI_Amount1 = decimal.Parse(dr["订单支付金额"].ToString());
m.FI_Amount2 = 0M;
m.FI_DateIss = DateTime.Parse(dr["订单支付日期"].ToString());
m.FI_Pnr = dr["PNR编号"].ToString().Trim();
m.FI_Vendor = dr["退票旅行社编号"].ToString().Trim();
m.FI_Vnumber = dr["退票旅行社名称"].ToString().Trim();
m.FI_Orderno = dr["订单编号"].ToString().Trim();
m.FI_Paybank = dr["订单支付银行"].ToString().Trim();
if (FI_Aircode == "KY")
{
m.FI_Bankno = dr["订单支付记帐号"].ToString().Replace("'", "").Trim();
}
else if (FI_Aircode == "ZH")
{
m.FI_Bankno = dr["原支付平台流水号"].ToString().Replace("'", "").Trim();
} m.FI_office = FI_Office;
//m.FI_Cpnr = "";
//m.FI_Jobno = "";
//m.FI_Buyno = "";
m.FI_DataTyp = "B2B";
//m.FI_Flag= 22;
//m.FI_OpMan= "F018";
m.FI_OpTime = DateTime.Now;
//m.FI_toman = "";
//m.FI_mantype = "";
//m.FI_State = "";
//m.FI_Voyage = "";
//m.FI_Flight = "";
//m.FI_Space = "";
m.FI_Dateto2 = DateTime.Parse("1900-01-01");
//m.FI_Dateto1 = null;
#endregion
list.Add(m);
}
string msg = "";
var count = bll.InsertList(list, webframework.common.Config.CONSQL_611_LHETWINDB, ref msg);
Alert("[" + FI_Office + "-" + FI_Aircode + (string.IsNullOrEmpty(EndFlag) ? "" : "-" + EndFlag) + "]导入航司成功[" + msg + "],耗时[" + (int)(DateTime.Now - nowtime).TotalSeconds + "]秒");
}
catch (Exception ex)
{
Alert("[" + FI_Office + "-" + FI_Aircode + (string.IsNullOrEmpty(EndFlag) ? "" : "-" + EndFlag) + "]报表导入数据报错:" + ex.Message);
}
}
private void InsertCarrierTemp(DataTable dt, string FI_Aircode, string FI_Office)
{
List<modelFI_repsource_excel> list = new List<modelFI_repsource_excel>();
try
{
DateTime nowtime = DateTime.Now;
foreach (DataRow dr in dt.Rows)
{ //string tikeno = dr["起始票号"].ToString();
//string tikenoend = dr["终止票号"].ToString();
//if (string.IsNullOrEmpty(tikeno))
// continue;
string pnr = dr["PNR"].ToString().Trim();
if (string.IsNullOrEmpty(pnr))
continue;
modelFI_repsource_excel m = new modelFI_repsource_excel();
#region model赋值
m.FI_Eticket = dr["起始票号"].ToString().Replace("-", "").Trim();
m.FI_State = dr["订单状态"].ToString().Trim();
m.FI_Aircode = FI_Aircode.Trim();
m.FI_Price = decimal.Parse(dr["票价"].ToString());
m.FI_Tax = decimal.Parse(dr["机建费"].ToString());
m.FI_Agenfee = ;
m.FI_Rate = ;
m.FI_Amount1 = decimal.Parse(dr["支付金额"].ToString());
m.FI_Amount2 = 0M;
m.FI_Voyage = dr["起飞城市1"].ToString().Trim() + "-" + dr["目的城市1"].ToString().Trim();
m.FI_Flight = dr["航班号1"].ToString().Trim();
m.FI_Space = dr["舱位1"].ToString().Trim();
m.FI_Dateto2 = DateTime.Parse("1900-01-01");
m.FI_Dateto1 = DateTime.Parse(dr["乘机日期1"].ToString());
m.FI_DateIss = DateTime.Parse(dr["出票日期"].ToString());
m.FI_Pnr = dr["PNR"].ToString().Trim();
m.FI_Vendor = dr["代理人号"].ToString().Trim();
m.FI_Vnumber = dr["操作人"].ToString().Trim();
m.FI_Orderno = dr["订单号"].ToString().Trim();
m.FI_Paybank = dr["支付银行"].ToString().Trim();
if (FI_Aircode == "KY")
{
m.FI_Bankno = dr["支付记帐号"].ToString().Replace("'", "").Trim();
}
else if (FI_Aircode == "ZH")
{
m.FI_Bankno = dr["支付平台流水号"].ToString().Replace("'", "").Trim();
} m.FI_office = FI_Office;
//m.FI_Cpnr = "";
//m.FI_Jobno = "";
//m.FI_Buyno = "";
m.FI_DataTyp = "B2B";
//m.FI_Flag = 0;
//m.FI_OpMan = "";
m.FI_OpTime = DateTime.Now;
#endregion
list.Add(m);
}
string msg = "";
var count = bll.InsertList(list, webframework.common.Config.CONSQL_611_LHETWINDB,ref msg);
Alert("[" + FI_Office + "-" + FI_Aircode + (string.IsNullOrEmpty(EndFlag) ? "" : "-" + EndFlag) + "]导入航司成功[" + msg + "],耗时[" + (int)(DateTime.Now - nowtime).TotalSeconds + "]秒");
}
catch (Exception ex)
{
Alert("[" + FI_Office + "-" + FI_Aircode + (string.IsNullOrEmpty(EndFlag) ? "" : "-" + EndFlag) + "]报表导入数据报错:" + ex.Message);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (dt == null || dt.Rows.Count == ) return;
if (FI_Office.Equals("AAA111") && (FI_Aircode.Equals("KY") || FI_Aircode.Equals("ZH")))
{
if (string.IsNullOrEmpty(EndFlag))
InsertCarrierTemp(dt, FI_Aircode, FI_Office);
else
InsertCarrierRTemp(dt, FI_Aircode, FI_Office, EndFlag);
}
else
{ }
} private DataTable CreateRepsource()
{
DataTable dt = new DataTable();
dt.Columns.Add("FI_Eticket", typeof(System.String));
dt.Columns.Add("FI_State", typeof(System.String));
dt.Columns.Add("FI_Aircode", typeof(System.String));
dt.Columns.Add("FI_Price", typeof(System.Decimal));
dt.Columns.Add("FI_Tax", typeof(System.Decimal));
dt.Columns.Add("FI_Agenfee", typeof(System.Decimal));
dt.Columns.Add("FI_Rate", typeof(System.Decimal));
dt.Columns.Add("FI_Amount1", typeof(System.Decimal));
dt.Columns.Add("FI_Amount2", typeof(System.Decimal));
dt.Columns.Add("FI_Voyage", typeof(System.String));
dt.Columns.Add("FI_Flight", typeof(System.String));
dt.Columns.Add("FI_Space", typeof(System.String));
dt.Columns.Add("FI_DateIss", typeof(System.DateTime));
dt.Columns.Add("FI_Dateto1", typeof(System.DateTime));
dt.Columns.Add("FI_Pnr", typeof(System.String));
dt.Columns.Add("FI_Vendor", typeof(System.String));
dt.Columns.Add("FI_Vnumber", typeof(System.String));
dt.Columns.Add("FI_Orderno", typeof(System.String));
dt.Columns.Add("FI_Paybank", typeof(System.String));
dt.Columns.Add("FI_Bankno", typeof(System.String));
dt.Columns.Add("FI_office", typeof(System.String));
dt.Columns.Add("FI_Cpnr", typeof(System.String));
dt.Columns.Add("FI_toman", typeof(System.String));
dt.Columns.Add("FI_Jobno", typeof(System.String));
dt.Columns.Add("FI_Buyno", typeof(System.String));
dt.Columns.Add("FI_Dateto2", typeof(System.DateTime));
dt.Columns.Add("FI_mantype", typeof(System.String));
dt.Columns.Add("FI_DataTyp", typeof(System.String));
dt.Columns.Add("FI_Flag", typeof(System.Int32));
dt.Columns.Add("FI_OpMan", typeof(System.String));
dt.Columns.Add("FI_OpTime", typeof(System.DateTime));
return dt;
} /// <summary>
///
/// </summary>
/// <param name="orderstate">订单状态(0未出票1已出票2已取消3已改签4已退款5出票失败6出票中9已退票10.二次出票)(dtom)</param>
/// <returns></returns>
private string GetOrderStateDesc(string orderstate)
{
string result = "";
switch (orderstate)
{
case "":
result = "未出票";
break;
case "":
result = "已出票";
break;
case "":
result = "已取消";
break;
case "":
result = "已改签";
break;
case "":
result = "已退款";
break;
case "":
result = "出票失败";
break;
case "":
result = "出票中";
break;
case "":
result = "已退票";
break;
case "":
result = "二次出票";
break;
default:
break;
}
return result;
}
}
}
上一篇:使用pdf.js显示pdf文件


下一篇:Win10正式版激活方法有哪些?如何激活Win10?