示例#1
0
    protected void btnImport_Click(object sender, EventArgs e)
    {
        try
        {
            CycleCount cycleCount = this.GetCycleCount();
            if (cycleCount == null)
                return;

            IList<CycleCountDetail> cycleCountDetailList = TheImportMgr.ReadCycleCountFromXls(fileUpload.PostedFile.InputStream, this.CurrentUser, cycleCount);
            TheCycleCountMgr.SaveCycleCount(cycleCount, cycleCountDetailList, this.CurrentUser);
            ShowSuccessMessage("Import.Result.Successfully");
            if (BtnImportClick != null)
            {
                BtnImportClick(cycleCount.Code, null);
            }
        }
        catch (BusinessErrorException ex)
        {
            ShowErrorMessage(ex);
        }
    }