コード例 #1
0
        public ActionResult Delete(string[] ids)
        {
            try
            {
                if (ids.Length != 0)
                {
                    var staticContents =
                        from id in ids
                        select _staticContentService.GetById(int.Parse(id));

                    _staticContentService.BatchDelete(staticContents);

                    ////Check and delete logo exists
                    //string str1 = string.Format("{0}", item.FileName.NonAccent());
                    //if (System.IO.File.Exists(str))
                    //    System.IO.File.Delete(str);

                    //Delete localize
                    for (var i = 0; i < ids.Length; i++)
                    {
                        var ieLocalizedProperty
                            = _localizedPropertyService.GetByEntityId(int.Parse(ids[i]));
                        _localizedPropertyService.BatchDelete(ieLocalizedProperty);
                    }
                }
            }
            catch (Exception ex)
            {
                ExtentionUtils.Log(Concat("StaticContent.Delete: ", ex.Message));
            }

            return(RedirectToAction("Index"));
        }