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 System.Data.SqlClient;
using Common;
using BLL;
namespace CRM.UI
{
public partial class CustomerInformationUpload : System.Web.UI.Page
{
CrmClient crmClient = new CrmClient();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string FullName = FileUpload1.PostedFile.FileName;//获取路径名
if (FullName == "")
{
this.lbl.Text = "请选择excel文件!";
return;
}
FileInfo fi = new FileInfo(FullName);
string name = DateTime.Now.ToString("yyyyMMddHHmmssffff")+"_"+ fi.Name;
string type = fi.Extension;
string SavePath = Server.MapPath("~\Upload\Client") + "\" + name;
this.FileUpload1.PostedFile.SaveAs(SavePath);
string result=crmClient.ExcelToParse(SavePath);