using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Windows;
using HD.SL.Common.Data.CommonData;
using Telerik.Windows.Controls;
using HD.SL.Common.Controls;
using HD.SL.Common.Data.Operation;
using HD.SL.Common.Data.UI.Validation;
using HD.SL.Common.Asset.ResouceLists;
using System.Windows.Controls;
using System.ComponentModel;
using Infragistics.Documents.Excel;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using HD.SL.RSM.DataAccess.DataModels;
using HD.SVR.RSM.DataAccess.DataModels;
using System.Windows.Browser;
namespace HD.SL.RSM.Config.MetaData
{
public partial class CustomerImport : SecurityPage
{
protected static CustomerImport currentObject;
public static CustomerImport GetInstance()
{
if (currentObject == null)
{
currentObject = new CustomerImport();
currentObject.OnDispose += (sender, e) =>
{
currentObject = null;
};
}
currentObject.InitialPage();
return currentObject;
}
private HD.SVR.RSM.DataAccess.DataServices.DBContext ctxRSM;
private CustomerImport()
{
ctxRSM = new SVR.RSM.DataAccess.DataServices.DBContext();
InitializeComponent();
#region gridViewCustomer 初始化
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.CUSTOMER_ID, "", 120, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.CUSTOMER_NAME, "", 150, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.CUSTOMER_TYPE, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.CUSTOMER_LEVEL, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.AGENT_FLAG, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.SUPPLIER_FLAG, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.ORG_TYPE, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.SOURCE_TYPE, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.OWNER_ID, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.OWNER_NAME, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.PROVINCE_ID, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.PROVINCE_NAME, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.CITY_ID, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.CITY_NAME, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.DISTRICT_ID, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.DISTRICT_NAME, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.DETAIL_ADDRESS, "", 160, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.PARENT_CUSTOMER, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.USE_FLAG, "", 80, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.EF_CHAR1, "社会信用代码", 120, "", true, true);
gridViewCustomer.CreateDataColumnWithBind<RsCustomer>(p => p.REMARK, "", 120, "", true, true);
gridViewCustomer.RegisterCellCopy();
#endregion
this.gridViewCustomer.LoadingRowDetails += gridViewCustomer_LoadingRowDetails;
}
private void gridViewCustomer_LoadingRowDetails(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
{
var customerItem = e.Row.DataContext as RsCustomer;
var rowGridView = e.DetailsElement as RadGridView;
rowGridView.ItemsSource = customerItem.ContactItems;
}
private ObservableCollection<RsCustomer> customerItems;
private ObservableCollection<RsContact> contactItems;
private UploaderWrapper uploaderWrapper;
private Stream currentStream;
private void InitialPage()
{
this.ctxRSM.EntityContainer.Clear();
this.uploaderWrapper = new UploaderWrapper();
customerItems = new ObservableCollection<RsCustomer>();
contactItems = new ObservableCollection<RsContact>();
}
private void btnLoad_Click(object sender, RoutedEventArgs e)
{
customerItems.Clear();
contactItems.Clear();
OpenFileDialog dialog = new OpenFileDialog();
dialog.Multiselect = false;
dialog.Filter = "Excel Files (*.xls, *.xlsx)| *.xls;*.xlsx";
if (dialog.ShowDialog() != true) return;
currentStream = dialog.File.OpenRead();
BackgroundWorker bw = new BackgroundWorker();
bw.WorkerReportsProgress = true;
bw.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
bw.DoWork += new DoWorkEventHandler((obj, args) => ImportExcel(obj, args));
bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
this.busyIndicator.IsBusy = true;
if (!bw.IsBusy) bw.RunWorkerAsync();
}
void bw_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
this.busyIndicator.BusyContent = e.UserState.ToString();
}
void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
this.busyIndicator.IsBusy = false;
FinishCustomerData();
FinishContactItemData();
foreach (var customerItem in customerItems)
{
foreach (var contactItem in contactItems.Where(p => p.CUSTOMER_ID == customerItem.CUSTOMER_ID).OrderBy(p => p.CONTACT_PERSON))
{
customerItem.ContactItems.Add(contactItem);
}
}
this.gridViewCustomer.ItemsSource = customerItems;
}
private async void FinishCustomerData()
{
List<string> provinceNames = new List<string>();
List<string> cityNames = new List<string>();
List<string> districtNames = new List<string>();
foreach (var item in customerItems)
{
if (!string.IsNullOrEmpty(item.PROVINCE_NAME) && !provinceNames.Contains(item.PROVINCE_NAME))
{
provinceNames.Add(item.PROVINCE_NAME);
}
if (!string.IsNullOrEmpty(item.CITY_NAME) && !cityNames.Contains(item.CITY_NAME))
{
cityNames.Add(item.CITY_NAME);
}
if (!string.IsNullOrEmpty(item.DISTRICT_NAME) && !districtNames.Contains(item.DISTRICT_NAME))
{
districtNames.Add(item.DISTRICT_NAME);
}
}
this.busyIndicator.BusyContent = "正在加载数据库中省市县编号";
this.busyIndicator.IsBusy = true;
var getDicProvince = await ctxRSM.GetRsProvinceIdsByNames(provinceNames).AsTask();
var getDicCity = await ctxRSM.GetRsCityIdsByNames(cityNames).AsTask();
var getDicDistrict = await ctxRSM.GetRsDistrictIdsByNames(districtNames).AsTask();
this.busyIndicator.IsBusy = false;
Dictionary<string, string> dicProvince = new Dictionary<string, string>();
Dictionary<string, string> dicCity = new Dictionary<string, string>();
Dictionary<string, string> dicDistrict = new Dictionary<string, string>();
dicProvince = getDicProvince.Value as Dictionary<string, string>;
dicCity = getDicCity.Value as Dictionary<string, string>;
dicDistrict = getDicDistrict.Value as Dictionary<string, string>;
foreach (var customerItem in customerItems)
{
if (!string.IsNullOrEmpty(customerItem.PROVINCE_NAME) && dicProvince.ContainsKey(customerItem.PROVINCE_NAME))
{
customerItem.PROVINCE_ID = dicProvince[customerItem.PROVINCE_NAME];
}
if (!string.IsNullOrEmpty(customerItem.CITY_NAME) && dicCity.ContainsKey(customerItem.CITY_NAME))
{
customerItem.CITY_ID = dicCity[customerItem.CITY_NAME];
}
if (!string.IsNullOrEmpty(customerItem.DISTRICT_NAME) && dicDistrict.ContainsKey(customerItem.DISTRICT_NAME))
{
customerItem.DISTRICT_ID = dicDistrict[customerItem.DISTRICT_NAME];
}
}
}
private async void FinishContactItemData()
{
List<string> provinceNames = new List<string>();
List<string> cityNames = new List<string>();
List<string> districtNames = new List<string>();
foreach (var item in contactItems)
{
if (!string.IsNullOrEmpty(item.PROVINCE_NAME) && !provinceNames.Contains(item.PROVINCE_NAME))
{
provinceNames.Add(item.PROVINCE_NAME);
}
if (!string.IsNullOrEmpty(item.CITY_NAME) && !cityNames.Contains(item.CITY_NAME))
{
cityNames.Add(item.CITY_NAME);
}
if (!string.IsNullOrEmpty(item.DISTRICT_NAME) && !districtNames.Contains(item.DISTRICT_NAME))
{
districtNames.Add(item.DISTRICT_NAME);
}
}
this.busyIndicator.BusyContent = "正在加载数据库中省市县编号";
this.busyIndicator.IsBusy = true;
var getDicProvince = await ctxRSM.GetRsProvinceIdsByNames(provinceNames).AsTask();
var getDicCity = await ctxRSM.GetRsCityIdsByNames(cityNames).AsTask();
var getDicDistrict = await ctxRSM.GetRsDistrictIdsByNames(districtNames).AsTask();
this.busyIndicator.IsBusy = false;
Dictionary<string, string> dicProvince = new Dictionary<string, string>();
Dictionary<string, string> dicCity = new Dictionary<string, string>();
Dictionary<string, string> dicDistrict = new Dictionary<string, string>();
dicProvince = getDicProvince.Value as Dictionary<string, string>;
dicCity = getDicCity.Value as Dictionary<string, string>;
dicDistrict = getDicDistrict.Value as Dictionary<string, string>;
foreach (var contactItem in contactItems)
{
if (!string.IsNullOrEmpty(contactItem.PROVINCE_NAME) && dicProvince.ContainsKey(contactItem.PROVINCE_NAME))
{
contactItem.PROVINCE_ID = dicProvince[contactItem.PROVINCE_NAME];
}
if (!string.IsNullOrEmpty(contactItem.CITY_NAME) && dicCity.ContainsKey(contactItem.CITY_NAME))
{
contactItem.CITY_ID = dicCity[contactItem.CITY_NAME];
}
if (!string.IsNullOrEmpty(contactItem.DISTRICT_NAME) && dicDistrict.ContainsKey(contactItem.DISTRICT_NAME))
{
contactItem.DISTRICT_ID = dicDistrict[contactItem.DISTRICT_NAME];
}
}
}
public void ImportExcel(object sender, DoWorkEventArgs e)
{
BackgroundWorker bw = (sender as BackgroundWorker);
Workbook book = Workbook.Load(currentStream);
//客户信息
int stopFlag = 0;
int rowIndex = 1;
Dictionary<string, string> dicCustomerIds = new System.Collections.Generic.Dictionary<string, string>();
dicCustomerIds.Clear();
if (book.Worksheets.Count < 2) return;
bw.ReportProgress(1, string.Format("开始导入客户信息"));
while (stopFlag < 2)
{
rowIndex = rowIndex + 1;
if (book.Worksheets[0].GetCell("A" + rowIndex.ToString()).Value == null)
{
stopFlag = stopFlag + 1;
continue;
}
else
{
stopFlag = 0;
string customerId = (book.Worksheets[0].GetCell("A" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("A" + rowIndex.ToString()).Value.ToString().Trim();
string customerName = (book.Worksheets[0].GetCell("B" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("B" + rowIndex.ToString()).Value.ToString().Trim();
string customerType = (book.Worksheets[0].GetCell("C" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("C" + rowIndex.ToString()).Value.ToString().Trim();
string customerLevel = (book.Worksheets[0].GetCell("D" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("D" + rowIndex.ToString()).Value.ToString().Trim();
string agentFlag = (book.Worksheets[0].GetCell("E" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("E" + rowIndex.ToString()).Value.ToString().Trim();
string supplierFlag = (book.Worksheets[0].GetCell("F" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("F" + rowIndex.ToString()).Value.ToString().Trim();
string orgType = (book.Worksheets[0].GetCell("G" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("G" + rowIndex.ToString()).Value.ToString().Trim();
string sourceType = (book.Worksheets[0].GetCell("H" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("H" + rowIndex.ToString()).Value.ToString().Trim();
string ownerId = (book.Worksheets[0].GetCell("I" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("I" + rowIndex.ToString()).Value.ToString().Trim();
string provinceName = (book.Worksheets[0].GetCell("J" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("J" + rowIndex.ToString()).Value.ToString().Trim();
string cityName = (book.Worksheets[0].GetCell("K" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("K" + rowIndex.ToString()).Value.ToString().Trim();
string districtName = (book.Worksheets[0].GetCell("L" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("L" + rowIndex.ToString()).Value.ToString().Trim();
string detailAddress = (book.Worksheets[0].GetCell("M" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("M" + rowIndex.ToString()).Value.ToString().Trim();
string parentCustomer = (book.Worksheets[0].GetCell("N" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("N" + rowIndex.ToString()).Value.ToString().Trim();
string useFlag = (book.Worksheets[0].GetCell("O" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("O" + rowIndex.ToString()).Value.ToString().Trim();
string remark = (book.Worksheets[0].GetCell("P" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("P" + rowIndex.ToString()).Value.ToString().Trim();
//社会信用代码
string efChar1 = (book.Worksheets[0].GetCell("Q" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[0].GetCell("Q" + rowIndex.ToString()).Value.ToString().Trim();
if (string.IsNullOrEmpty(customerId)) continue;
RsCustomer customerItem = new RsCustomer();
customerItem.CUSTOMER_ID = GuidGenerator.GetShortGuid();
dicCustomerIds.Add(customerId, customerItem.CUSTOMER_ID);
customerItem.CUSTOMER_NAME = customerName;
customerItem.CUSTOMER_TYPE = customerType;
customerItem.CUSTOMER_LEVEL = customerLevel;
customerItem.AGENT_FLAG = string.IsNullOrWhiteSpace(agentFlag) ? "N" : agentFlag;
customerItem.SUPPLIER_FLAG = string.IsNullOrWhiteSpace(supplierFlag) ? "N" : supplierFlag;
customerItem.ORG_TYPE = orgType;
customerItem.SOURCE_TYPE = sourceType;
customerItem.OWNER_ID = ownerId;
customerItem.PROVINCE_NAME = provinceName;
customerItem.CITY_NAME = cityName;
customerItem.DISTRICT_NAME = districtName;
customerItem.DETAIL_ADDRESS = detailAddress;
customerItem.PARENT_CUSTOMER = parentCustomer;
customerItem.USE_FLAG = string.IsNullOrWhiteSpace(useFlag) ? "Y" : useFlag;
customerItem.EF_CHAR1 = efChar1;
customerItem.REMARK = remark;
this.customerItems.Add(customerItem);
bw.ReportProgress(1, string.Format("已导入{0}行客户信息", this.customerItems.Count.ToString()));
}
}
//联系人信息
stopFlag = 0;
rowIndex = 1;
bw.ReportProgress(1, string.Format("开始导入联系人信息"));
while (stopFlag < 2)
{
rowIndex = rowIndex + 1;
if (book.Worksheets[1].GetCell("A" + rowIndex.ToString()).Value == null)
{
stopFlag = stopFlag + 1;
continue;
}
else
{
stopFlag = 0;
RsContact contactItem = new RsContact();
contactItem.CONTACT_ID = GuidGenerator.GetShortGuid();
string customerId = (book.Worksheets[1].GetCell("A" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("A" + rowIndex.ToString()).Value.ToString().Trim();
if (!dicCustomerIds.ContainsKey(customerId)) continue;
contactItem.CUSTOMER_ID = dicCustomerIds[customerId];
string contactGender = (book.Worksheets[1].GetCell("B" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("B" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_GENDER = contactGender;
string contactPerson = (book.Worksheets[1].GetCell("C" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("C" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_PERSON = contactPerson;
string contactMobile = (book.Worksheets[1].GetCell("D" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("D" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_MOBILE = contactMobile;
string contactRole = (book.Worksheets[1].GetCell("E" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("E" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_ROLE = contactRole;
string contactDuty = (book.Worksheets[1].GetCell("F" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("F" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_DUTY = contactDuty;
//个人喜好
string efChar1 = (book.Worksheets[1].GetCell("G" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("G" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.EF_CHAR1 = efChar1;
string contactBirthday = (book.Worksheets[1].GetCell("H" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("H" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_BIRTHDAY = null;
if (!string.IsNullOrEmpty(contactBirthday))
{
contactBirthday = DateTime.FromOADate(Convert.ToInt32(contactBirthday)).ToString("d");
DateTime contactBirthdayValue;
DateTime.TryParse(contactBirthday, out contactBirthdayValue);
contactItem.CONTACT_BIRTHDAY = contactBirthdayValue;
}
//阴阳历
string efChar2 = (book.Worksheets[1].GetCell("I" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("I" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.EF_CHAR2 = efChar2;
string contactEmail = (book.Worksheets[1].GetCell("J" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("J" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_EMAIL = contactEmail;
string contactTel = (book.Worksheets[1].GetCell("K" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("K" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_TEL = contactTel;
string contactFax = (book.Worksheets[1].GetCell("L" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("L" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CONTACT_FAX = contactFax;
string wexinCode = (book.Worksheets[1].GetCell("M" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("M" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.WEXIN_CODE = wexinCode;
string qqCode = (book.Worksheets[1].GetCell("N" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("N" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.QQ_CODE = qqCode;
string provinceName = (book.Worksheets[1].GetCell("O" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("O" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.PROVINCE_NAME = provinceName;
string cityName = (book.Worksheets[1].GetCell("P" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("P" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.CITY_NAME = cityName;
string districtName = (book.Worksheets[1].GetCell("Q" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("Q" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.DISTRICT_NAME = districtName;
string detailAddress = (book.Worksheets[1].GetCell("R" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("R" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.DETAIL_ADDRESS = detailAddress;
string defaultFlag = (book.Worksheets[1].GetCell("S" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("S" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.DEFAULT_FLAG = defaultFlag;
string remark = (book.Worksheets[1].GetCell("T" + rowIndex.ToString()).Value == null) ? null :
book.Worksheets[1].GetCell("T" + rowIndex.ToString()).Value.ToString().Trim();
contactItem.REMARK = remark;
contactItems.Add(contactItem);
bw.ReportProgress(1, string.Format("已导入{0}行联系人信息", this.contactItems.Count.ToString()));
}
}
this.currentStream.Close();
}
private async void btnImport_Click(object sender, RoutedEventArgs e)
{
this.busyIndicator.BusyContent = "正在保存中...";
this.busyIndicator.IsBusy = true;
foreach (var customerItem in customerItems)
{
var m_RS_CUSTOMER = new RS_CUSTOMER();
DataExchange.CopyDataItem(customerItem, m_RS_CUSTOMER);
DataExchange.SetCreationLog(m_RS_CUSTOMER);
this.ctxRSM.RS_CUSTOMERs.Add(m_RS_CUSTOMER);
}
foreach (var contactItem in contactItems)
{
var m_RS_CONTACT = new RS_CONTACT();
DataExchange.CopyDataItem(contactItem, m_RS_CONTACT);
DataExchange.SetCreationLog(m_RS_CONTACT);
this.ctxRSM.RS_CONTACTs.Add(m_RS_CONTACT);
}
var operationSave = await ctxRSM.SubmitChanges().AsTask();
this.busyIndicator.IsBusy = false;
if (!this.CheckLoadDataArgs(ExceptionManager.CheckDataContextResult(operationSave)))
{
MessageBox.Show(operationSave.Error.Message.ToString());
}
RadWindowExtension.CloseRadWindow(this, true);
}
private async void btnDownLoad_Click(object sender, RoutedEventArgs e)
{
UploadFileItem m_UploadFileItem = new UploadFileItem();
this.busyIndicator.IsBusy = true;
var getOper = await HD.SL.SDM.DataAccess.Utilities.CacheEngine.GetCacheData<HD.SVR.SDM.DataAccess.DataModels.SYS_DICTIONARY>(
CacheItem.SysDictionary.ToString(), p => p.ITEM_TYPE == "EXCEL_TEMPLATE" && p.ITEM_ID == "CUSTOMER_IMPORT");
this.busyIndicator.IsBusy = false;
m_UploadFileItem.FILE_ID = getOper.FirstOrDefault().ITEM_NAME.ToString();
m_UploadFileItem.FILE_NAME = getOper.FirstOrDefault().ITEM_NAME.ToString();
this.uploaderWrapper.DownLoadFile(m_UploadFileItem, "./Common/TemplateDownload.aspx");
}
}
}