Пример #1
0
        public ActionResult <ImportSiteResponseModel> ImportSite([FromBody] ImportSiteInputModel data)
        {
            ImportSiteResponseModel res = new ImportSiteResponseModel();

            LogAppBL blLog = new LogAppBL(DbContext);

            try
            {
                string message = data.UserID + " Start upload excel list site";

                //blLog.SaveLog(LogAppEnum.StartUploadExcelSite, data.UserID, message);

                SiteBL bl = new SiteBL(DbContext);
                bl.ImportSite(data);

                ImportSiteOutputModel x = new ImportSiteOutputModel();
                x.ImportDate = DateTime.Now;

                res.data     = x;
                res.Message  = "Success upload file excel";
                res.Response = true;

                //blLog.SaveLog(LogAppEnum.EndUploadExcelSite, data.UserID, res.Message);

                return(res);
            }
            catch (Exception ex)
            {
                res.Message  = ex.Message;
                res.Response = false;

                //blLog.SaveLog(LogAppEnum.ErrorUploadExcelSite, data.UserID, ex.Message);

                return(res);
            }
        }