public void Delete(Guid id) { var q = db.Proposal.Where(x => x.ProposalId == id).FirstOrDefault(); if (q != null) { var q2 = db.ProposalDetail.Where(x => x.ProposalId == q.ProposalId); db.RemoveRange(q2); db.Remove(q); } }
public void Delete(string id) { var q = db.UserHeader.Where(x => x.BinusianId == id).FirstOrDefault(); db.Remove(q); db.SaveChanges(); }
public Tuple <Boolean, String> DeleteVoting(Guid VotingId) { try{ var q = db.Voting.Where(x => x.VotingId == VotingId).FirstOrDefault(); db.Remove(q); db.SaveChanges(); return(Tuple.Create(true, "Data Deleted Successfully")); } catch (Exception ex) { return(Tuple.Create(false, ex.Message)); } }
public Tuple <Boolean, String> DeletePeriodManagement(Guid id) { try{ var q = db.PeriodManagement.Where(x => x.PeriodId == id).FirstOrDefault(); db.Remove(q); db.SaveChanges(); return(Tuple.Create(true, "Data Deleted Successfully")); } catch (Exception ex) { return(Tuple.Create(false, ex.Message)); } }