public JsonResult Contact(string MyChecked)
 {
     Contact n = new Contact();
     ContactData nd = new ContactData();
     var array = MyChecked.Split(',');
     if (MyChecked != "" && MyChecked != null)
     {
         for (var i = 0; i < array.Length; i++)
         {
             //var Original = nd.Get().ToList().Where(a => a.num.ToString() == array[i]).SingleOrDefault();
             //var DelPath = System.IO.Path.Combine(Server.MapPath("~/upload/News/"), Original.pic1);
             //System.IO.File.Delete(DelPath);
             //if (Original.jsonimg != "no_img.jpg")
             //{
             //    var jsonstr = JsonConvert.DeserializeObject<List<jsonSer>>(Original.jsonimg);
             //    var DelJsonPath = Server.MapPath("~/upload/photograhy/");
             //    foreach (var j in jsonstr)
             //    {
             //        var DelJsonPathing = System.IO.Path.Combine(DelJsonPath, j.content);
             //        System.IO.File.Delete(DelJsonPathing);
             //    }
             //}
             n.isdel = 1;
             n.udate = DateTime.Now;
             n.num = Convert.ToInt32(array[i]);
             nd.Delete(n);
         }
     }
     return Json("");
 }
Пример #2
0
 public JsonResult Contact(string MyChecked)
 {
     Contact ct = new Contact();
     ContactData ctd = new ContactData();
     var array = MyChecked.Split(',');
     if (MyChecked != "" && MyChecked != null)
     {
         for (var i = 0; i < array.Length; i++)
         {
             //var Original = dred.Get().ToList().Where(a => a.num.ToString() == array[i]).SingleOrDefault();
             ////var DelPath = System.IO.Path.Combine(Server.MapPath("~/upload/dressdesign/"), Original.img);
             ////System.IO.File.Delete(DelPath);
             //if (Original.jsonimg != "no_img.jpg")
             //{
             //    var jsonstr = JsonConvert.DeserializeObject<List<jsonSer>>(Original.jsonimg);
             //    var DelJsonPath = Server.MapPath("~/upload/dressdesign/");
             //    foreach (var j in jsonstr)
             //    {
             //        var DelJsonPathing = System.IO.Path.Combine(DelJsonPath, j.content);
             //        System.IO.File.Delete(DelJsonPathing);
             //    }
             //}
             ct.num = Convert.ToInt32(array[i]);
             ctd.Delete(ct);
         }
     }
     return Json("");
 }
        public void Delete(ref ArrayList validationErrors)
        {
            ValidateDelete(ref validationErrors);

            if (validationErrors.Count == 0)
            {
                ContactData.Delete(ContactId);
            }
        }