コード例 #1
0
        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);
            }
        }
コード例 #2
0
        public void Delete(string id)
        {
            var q = db.UserHeader.Where(x => x.BinusianId == id).FirstOrDefault();

            db.Remove(q);
            db.SaveChanges();
        }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
        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));
            }
        }