Пример #1
0
        private void btnUpdateExcel_Click(object sender, EventArgs e)
        {
            var dialog = this.ofdKcExcel.ShowDialog();

            if (dialog == DialogResult.OK)
            {
                var bytes = File.ReadAllBytes(this.ofdKcExcel.FileName);
                KuCunFilePath = ofdKcExcel.FileName;

                using (var ms = new MemoryStream(bytes))
                {
                    var result = ExcelHelper.ReadKuCunInfosExcel(ms);
                    FillDataInfos(result, this.dgvKuCunInfo);

                    this.KuCunInfoList = KuCunInfo.MapCunInfos(result);
                }

                using (var ms = new MemoryStream(bytes))
                {
                    var result = ExcelHelper.ReadFaHuoInfosExcel(ms);
                    var data   = FaHuoTaskItemView.MapTaskItems(result);
                    FillDataInfos(data, this.dgvFaHuoTaskInfo);

                    FaHuoTaskItemList = FaHuoTaskItem.MapTaskItems(result);
                }
            }
            CheckExecResult();
        }
Пример #2
0
        /// <summary>
        /// 上传发货任务信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void btnFhInfo_Click(object sender, EventArgs e)
        {
            var dialog = this.ofdFhExcel.ShowDialog();

            if (dialog == DialogResult.OK)
            {
                var bytes = File.ReadAllBytes(this.ofdFhExcel.FileName);
                FaHuoTaskFilePath = ofdFhExcel.FileName;

                using (var ms = new MemoryStream(bytes))
                {
                    var result = ExcelHelper.ReadFaHuoInfosExcel(ms);
                    var data   = FaHuoTaskItemView.MapTaskItems(result);
                    FillDataInfos(data, this.dgvFaHuoTaskInfo);

                    FaHuoTaskItemList = FaHuoTaskItem.MapTaskItems(result);
                }
            }

            await CheckExecResult();
        }