コード例 #1
0
        public ActionResult MultiRowDelete(string Ids)
        {
            string validationResponse = "";

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

            CarriersPost carriers;

            sIDs.ToList()
            .ForEach(s =>
            {
                if (long.TryParse(s, out nID))
                {
                    sCarrier = _carriersService.Get(nID).sCarrier;
                    if (!_carriersService.VerifyCarrierDeleteOK(nID, sCarrier).Any())
                    {
                        carriers          = _carriersService.GetPost(nID);
                        carriers.UserName = User.Identity.Name;
                        _carriersService.Delete(carriers);
                        iDs.Add(nID);
                    }
                }
            }
                     );

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

            return(Json(validationResponse));
        }