コード例 #1
0
        public bool Delete(int id)
        {
            bool            status = false;
            PartyRepository repo   = new PartyRepository();

            status = repo.Delete(id);
            return(status);
        }
コード例 #2
0
        public ActionResult Delete(int id, string confirmButton)
        {
            Party party = partyRepository.GetParty(id);

            if (party == null)
            {
                return(View("NotFound"));
            }
            partyRepository.Delete(party);
            partyRepository.Save();
            return(View("Deleted"));
        }
コード例 #3
0
        public async Task TestPartyDelete()
        {
            try
            {
                UOW.BeginTransaction();
                Party result = await partyRepository.GetByID(Context, 1);

                Assert.IsNotNull(result, "Expect to find Democratic Party");
                Assert.AreEqual(result.Description, "Democratic Party", "Expect to find Party Description = Democratic Party");
                Party deleted = await partyRepository.Delete(UOW, result.Id);

                UOW.CloseTransaction();
                Assert.IsTrue(deleted.Active == false, "Expect new Party active flag to be false.");
            }
            catch (Exception ex)
            {
                Assert.IsNull(ex, "Exception Thrown: " + ex.Message);
            }
        }
コード例 #4
0
ファイル: PartyService.cs プロジェクト: razorbohan/PVT
 public void DeleteParty(int partyId)
 {
     PartyRepository.Delete(partyId);
 }