Пример #1
0
        public ActionResult MultiRowDelete(string Ids)
        {
            string validationResponse = "";

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

            TaxesPost taxes;

            sIDs.ToList()
            .ForEach(s =>
            {
                if (long.TryParse(s, out nID))
                {
                    sTax = _taxesService.Get(nID).sTax;
                    if (!_taxesService.VerifyTaxDeleteOK(nID, sTax).Any())
                    {
                        taxes          = _taxesService.GetPost(nID);
                        taxes.UserName = User.Identity.Name;
                        _taxesService.Delete(taxes);
                        iDs.Add(nID);
                    }
                }
            }
                     );

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

            return(Json(validationResponse));
        }