public async Task <JsonResult> ILSRemoveID() { try { var oid = Guid.Parse(Request.Form["id"]); var aid = Guid.Parse(Request.Form["aid"]); if (ImageLinkStorageService.RemoveByOID(oid, aid)) { return(Success("")); } return(Failed(MessageUtilityService.FailedRemove("Image"))); } catch { return(Failed(MessageUtilityService.ServerError())); } }
public static bool Remove(Guid id, Guid qiid, Guid aid, Guid cid) { try { using (var context = new CentralProcessContext()) { var query = (from i in context.QuizQuestionsDB where i.ID == id && i.QuizInfoID == qiid select i).FirstOrDefault(); context.QuizQuestionsDB.Remove(query); context.SaveChanges(); if (QuizQuestionAnswerService.RemoveByQQID(id, aid, cid) && ImageLinkStorageService.RemoveByOID(id, aid)) { return(true); } return(false); } } catch { return(false); } }
public static bool Remove(Guid id, Guid oid, Guid aid, Guid cid) { try { using (var context = new CentralProcessContext()) { var query = (from i in context.IS_ItemColorDB where i.ID == id && i.OwnerID == oid && i.API == aid && i.CategoryID == cid select i).FirstOrDefault(); context.IS_ItemColorDB.Remove(query); context.SaveChanges(); if (ImageLinkStorageService.RemoveByOID(query.ID, aid)) { return(true); } return(false); } } catch { return(false); } }
public static bool Remove(Guid id, Guid qqid, Guid aid, Guid cid) { try { using (var context = new CentralProcessContext()) { var query = (from i in context.QuizQuestionAnswerDB where i.ID == id && i.QuizQuestionsID == qqid select i).FirstOrDefault(); context.QuizQuestionAnswerDB.Remove(query); context.SaveChanges(); //removes images associated with this data if (ImageLinkStorageService.RemoveByOID(query.ID, aid)) { return(true); } return(false); } } catch { return(false); } }