protected void btnImport_Click(object sender, EventArgs e) { try { string serpath = string.Empty; if (DataFilePath.HasFile) { string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\ImportDeliver"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; ImportManager.ImportClaimInfoXls(serpath, ref paramMessage); //base.ImportManager.ImportImportDeliver(serpath, ref paramMessage); this.txtResult.Text = paramMessage; } } } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
protected void btnImport_Click(object sender, EventArgs e) { try { int PlatformTypeId = Convert.ToInt16(ddPlatformTypeId.SelectedValue); if (PlatformTypeId == -1) { base.ShowMessage("平台必须选择!"); return; } string serpath = string.Empty; string fieldName = ""; switch (PlatformTypeId) { case 259: fieldName = "SO"; break; case 251: fieldName = "订单编号"; break; case 383: fieldName = "订单号"; break; case 250: fieldName = "商户订单号"; break; } if (DataFilePath.HasFile) { string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\ImportAlipayStatementData"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; base.ImportManager.ImportAlipaymentData(serpath, ref paramMessage, PlatformTypeId, fieldName); this.txtResult.Text = paramMessage; } } } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
protected void btnImport_Click(object sender, EventArgs e) { try { //店铺id int ProjectId = Convert.ToInt16(this.ddXMProject.SelectedValue.ToString()); int NickId = Convert.ToInt32(this.ddlNick.SelectedValue.ToString()); string Begin = this.txtBeginDate.Value.Trim(); if (ProjectId == -1) { base.ShowMessage("请选择需要导入日销单所属项目!"); return; } if (NickId == -1 || NickId == 99) { base.ShowMessage("请选择需要导入日销售单所属店铺!"); return; } DateTime date = DateTime.Now; if (Begin != "") { if (Begin == "" || !DateTime.TryParse(Begin, out date)) { base.ShowMessage("日期格式不正确!"); return; } } string serpath = string.Empty; if (DataFilePath.HasFile) { string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\XMDailySaleInfo"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; base.ImportManager.ImportDailySaleProductList(serpath, ref paramMessage, NickId, Begin); this.txtResult.Text = paramMessage; } } } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnImport_Click(object sender, EventArgs e) { try { int expressID = !string.IsNullOrEmpty(ddlExpress.SelectedValue) ? int.Parse(ddlExpress.SelectedValue) : 0; //店铺id string Begin = this.txtBeginDate.Value.Trim(); DateTime date = DateTime.Now; if (Begin != "") { if (Begin == "" || !DateTime.TryParse(Begin, out date)) { base.ShowMessage("日期格式不正确!"); return; } } int year = Convert.ToDateTime(Begin).Year; //年份 int month = Convert.ToDateTime(Begin).Month; //月份 string serpath = string.Empty; if (DataFilePath.HasFile) { string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\XMExpress"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; base.ImportManager.ImportExpressList(serpath, ref paramMessage, expressID, year, month); this.txtResult.Text = paramMessage; } } } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
protected void btnImport_Click(object sender, EventArgs e) { try { string serpath = string.Empty; if (DataFilePath.HasFile) { int xMProjectID = int.Parse(ddXMProject.SelectedValue); int wareHoueseID = int.Parse(ddlWareHourses.SelectedValue); //平台类型 // int PlatformTypeId = int.Parse(this.ddPlatformTypeId.SelectedValue); int DeliveryTypeId = Convert.ToInt32(this.ddDeliveryTypeId.SelectedValue.ToString()); //发货单类型Id string DeliveryTypeIdName = this.ddDeliveryTypeId.SelectedItem.ToString(); //发货单类型名称 string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); // string FileName = DataFilePath.FileName.Substring(0, DataFilePath.FileName.Length - (typ.Length + 1)); if (xMProjectID == -1) { base.ShowMessage("请先选择项目!"); return; } if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\ImportLogisticsNumberData"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; base.ImportManager.ImportLogisticsNumberDataFromXls(serpath, DateTime.Now, DeliveryTypeId, DeliveryTypeIdName, ref paramMessage, xMProjectID, wareHoueseID); this.txtResult.Text = paramMessage; } } } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
protected void btnImport_Click(object sender, EventArgs e) { try { int SuppliersId = int.Parse(this.ddSuppliers.Text); //供应商ID string serpath = string.Empty; if (this.ddSuppliers.Text == "-1") { this.txtResult.Text = "供应商必选"; return; } this.btnImport.Enabled = false; if (this.DataFilePath.HasFile) { string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); string FileName = DataFilePath.FileName.Substring(0, DataFilePath.FileName.Length - (typ.Length + 1)); if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\OrderInfoImporting"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; lock (lockobject) { base.ImportManager.ImportBillsXls(serpath, SuppliersId, ref paramMessage); } this.txtResult.Text = paramMessage; } } this.btnImport.Enabled = true; } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
protected void btnImport_Click(object sender, EventArgs e) { try { //string Warehouse = this.ddlWarehouse.SelectedValue.Trim(); //if (Warehouse == "-1") //{ // base.ShowMessage("请先选择仓库!"); // return; //} string serpath = string.Empty; if (DataFilePath.HasFile) { string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\ImportXLMInventory"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; base.ImportManager.ImportXLMInventory(serpath, ref paramMessage); this.txtResult.Text = paramMessage; } } } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
protected void btnImport_Click(object sender, EventArgs e) { try { //店铺id int NickId = Convert.ToInt32(this.ddlNick.SelectedValue.ToString()); string serpath = string.Empty; if (NickId == -1 || NickId == 99) { base.ShowMessage("请选择需要导入销售单所属店铺!"); return; } if (DataFilePath.HasFile) { string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\ImportJDRealTimeInventory"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; base.ImportManager.ImportJDRealTimeInventory(serpath, ref paramMessage, NickId); this.txtResult.Text = paramMessage; } } } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
protected void btnImport_Click(object sender, EventArgs e) { try { //string serpath = string.Empty; //string serpath2 = string.Empty; //if (DataFilePath.HasFile && DataFilePath2.HasFile) //{ ////平台类型 //string PlatformTypeNameId = this.ddPlatformTypeId.SelectedValue.ToString();//平台类型Id //string PlatformTypeName = this.ddPlatformTypeId.SelectedItem.ToString();//平台类型名称 //string NickId = this.ddlNick.SelectedValue.ToString();//平台类型Id //string NickName = this.ddlNick.SelectedItem.ToString(); //string type = this.excelType.SelectedValue.ToString();//excel的类型 //string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); //string FileName = DataFilePath.FileName.Substring(0, DataFilePath.FileName.Length - (typ.Length + 1)); //string typ2 = DataFilePath2.FileName.Substring(DataFilePath2.FileName.LastIndexOf(".") + 1).ToLower(); //string FileName2 = DataFilePath2.FileName.Substring(0, DataFilePath2.FileName.Length - (typ2.Length + 1)); //if (typ == "xls" || typ == "xlsx" || typ2 == "xls" || typ2 == "xlsx") //{ // string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; // string partname2 = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath2.FileName; // string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\PreOrderInfoImporting"; // if (!Directory.Exists(partpath)) // { // Directory.CreateDirectory(partpath); // } // serpath = partpath + "\\" + partname; // serpath2 = partpath + "\\" + partname2; // DataFilePath.SaveAs(serpath); // DataFilePath2.SaveAs(serpath2); // string paramMessage = string.Empty; // //base.ImportManager.ImportPreOrderFromXlsTM(serpath, serpath2, DateTime.Now, System.Convert.ToInt32(PlatformTypeNameId), System.Convert.ToInt32(NickId), PlatformTypeName, FileName, FileName2, ref paramMessage); // this.txtResult.Text = paramMessage; //} //} string serpath = string.Empty; if (DataFilePath.HasFile) { //平台类型 string PlatformTypeNameId = this.ddPlatformTypeId.SelectedValue.ToString(); //平台类型Id string PlatformTypeName = this.ddPlatformTypeId.SelectedItem.ToString(); //平台类型名称 string NickId = this.ddlNick.SelectedValue.ToString(); //平台类型Id string NickName = this.ddlNick.SelectedItem.ToString(); //平台名称 string type = this.excelType.SelectedValue.ToString(); //excel的类型格式 if ((type == "1" && PlatformTypeName != "京东") || (type != "1" && PlatformTypeName != "天猫")) { this.txtResult.Text = "平台类型与导入类型不符!"; return; } string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); string FileName = DataFilePath.FileName.Substring(0, DataFilePath.FileName.Length - (typ.Length + 1)); if ((FileName.IndexOf("京东") != -1 && type != "1") || (FileName.IndexOf("超级店长") != -1 && type != "2") || (FileName.IndexOf("赤兔") != -1 && type != "3")) { this.txtResult.Text = "导入类型与Excel文件不符!"; return; } if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\PreOrderInfoImporting"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; paramMessage = base.ImportManager.ImportPreOrderFromXlsTM(serpath, NickName, FileName, type, int.Parse(PlatformTypeNameId), int.Parse(NickId)); this.txtResult.Text = paramMessage; } //else if (typ == "csv") //{ // string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; // string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\PreOrderInfoImporting"; // if (!Directory.Exists(partpath)) // { // Directory.CreateDirectory(partpath); // } // serpath = partpath + "\\" + partname; // DataFilePath.SaveAs(serpath); // string paramMessage = string.Empty; // if (PlatformTypeNameId == "376") // { // //亚马逊 // base.ImportManager.ImportAmazonOrderDataFromXls(serpath, ref paramMessage); // } // this.txtResult.Text = paramMessage; //} } else { this.txtResult.Text = "请先选择EXCEL文件地址!"; } } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }
protected void btnImport_Click(object sender, EventArgs e) { try { string serpath = string.Empty; string serpath2 = string.Empty; string sourceType = this.ddlSourceType.SelectedValue; this.btnImport.Enabled = false; if (DataFilePath.HasFile && DataFilePath2.HasFile) { //平台类型 // int PlatformTypeId = int.Parse(this.ddPlatformTypeId.SelectedValue); string PlatformTypeNameId = this.ddPlatformTypeId.SelectedValue.ToString(); //平台类型Id string PlatformTypeName = this.ddPlatformTypeId.SelectedItem.ToString(); //平台类型名称 string NickId = this.ddlNick.SelectedValue.ToString(); //平台类型Id string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); string FileName = DataFilePath.FileName.Substring(0, DataFilePath.FileName.Length - (typ.Length + 1)); string typ2 = DataFilePath2.FileName.Substring(DataFilePath2.FileName.LastIndexOf(".") + 1).ToLower(); string FileName2 = DataFilePath2.FileName.Substring(0, DataFilePath2.FileName.Length - (typ2.Length + 1)); if (typ == "xls" || typ == "xlsx" || typ2 == "xls" || typ2 == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partname2 = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath2.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\OrderInfoImporting"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; serpath2 = partpath + "\\" + partname2; DataFilePath.SaveAs(serpath); DataFilePath2.SaveAs(serpath2); string paramMessage = string.Empty; lock (lockobject) { base.ImportManager.ImportOrderFromXlsTM(serpath, serpath2, DateTime.Now, System.Convert.ToInt32(PlatformTypeNameId), System.Convert.ToInt32(NickId), PlatformTypeName, FileName, FileName2, ref paramMessage, sourceType); } this.txtResult.Text = paramMessage; } } else if (DataFilePath.HasFile) { //平台类型 // int PlatformTypeId = int.Parse(this.ddPlatformTypeId.SelectedValue); string PlatformTypeNameId = this.ddPlatformTypeId.SelectedValue.ToString(); //平台类型Id string PlatformTypeName = this.ddPlatformTypeId.SelectedItem.ToString(); //平台类型名称 string NickId = this.ddlNick.SelectedValue.ToString(); //平台类型Id string typ = DataFilePath.FileName.Substring(DataFilePath.FileName.LastIndexOf(".") + 1).ToLower(); string FileName = DataFilePath.FileName.Substring(0, DataFilePath.FileName.Length - (typ.Length + 1)); if (typ == "xls" || typ == "xlsx") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\OrderInfoImporting"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; //this.Page; lock (lockobject) { base.ImportManager.ImportOrderFromXls(serpath, DateTime.Now, System.Convert.ToInt32(PlatformTypeNameId), System.Convert.ToInt32(NickId), PlatformTypeName, FileName, ref paramMessage, sourceType); } this.txtResult.Text = paramMessage; } else if (typ == "csv") { string partname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + DataFilePath.FileName; string partpath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + @"\UpLoad\OrderInfoImporting"; if (!Directory.Exists(partpath)) { Directory.CreateDirectory(partpath); } serpath = partpath + "\\" + partname; DataFilePath.SaveAs(serpath); string paramMessage = string.Empty; if (PlatformTypeNameId == "376") { lock (lockobject) { //亚马逊 base.ImportManager.ImportAmazonOrderDataFromXls(serpath, ref paramMessage, sourceType); } } this.txtResult.Text = paramMessage; } } this.btnImport.Enabled = true; } catch (Exception err) { base.ProcessException(err, false); this.txtResult.Text = err.Message; } }