public ActionResult DeleteSPLazada() { using (TextFieldParser parser = new TextFieldParser(Server.MapPath("~/data/database-lazada.csv"))) { parser.TextFieldType = FieldType.Delimited; parser.SetDelimiters(","); while (!parser.EndOfData) { string[] values = parser.ReadFields(); if (values[0].Contains("Link")) { continue; } var x = values[1]; SanPhamModel spm = new SanPhamModel(); DeleteAnh(spm.FindByName(values[1]).AnhDaiDien); DeleteAnh(spm.FindByName(values[1]).AnhNen); DeleteAnh(spm.FindByName(values[1]).AnhKhac); spm.DeleteSPName(values[1]); } } return(RedirectToAction("SanPham")); }