예제 #1
0
        public async Task <IActionResult> UploadModelData(List <M_Product> lstProd)
        {
            var uId = await base.CurrentUserId();

            lstProd.ForEach(m =>
            {
                m.Created_By = uId;
            });

            try
            {
                using (var prodBll = new ProductBLL())
                {
                    var rowaffected = await prodBll.BulkInsertProduct(lstProd);

                    _cache.Remove("CACHE_MASTER_PRODUCT");
                }

                return(Json(new { success = true, data = lstProd, message = "Import Success." }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, data = lstProd, message = ex.Message }));
            }
        }