Beispiel #1
0
        public ActionResult MultiRowDelete(string Ids)
        {
            string validationResponse = "";

            string[]    sIDs = Ids.Split("|");
            List <long> iDs  = new List <long>();
            long        nID;
            string      sMaterial;

            MaterialsPost materials;

            sIDs.ToList()
            .ForEach(s =>
            {
                if (long.TryParse(s, out nID))
                {
                    sMaterial = _materialsService.Get(nID).sMaterial;
                    if (!_materialsService.VerifyMaterialDeleteOK(nID, sMaterial).Any())
                    {
                        materials          = _materialsService.GetPost(nID);
                        materials.UserName = User.Identity.Name;
                        _materialsService.Delete(materials);
                        iDs.Add(nID);
                    }
                }
            }
                     );

            iDs.ForEach(n => validationResponse = validationResponse + ", " + n.ToString());

            return(Json(validationResponse));
        }