コード例 #1
0
ファイル: CountryController.cs プロジェクト: Galib43/OEMS
        public ActionResult Delete(int id)
        {
            bool isDelete = _countryManager.Delete(id);

            if (isDelete)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
コード例 #2
0
        public void Delete_DeleteCountry_ReturnTrueResult()
        {
            ICountryService countryService = new CountryManager(_mockCountryDal.Object);
            Country         country        = new Country()
            {
                Id         = 1,
                Name       = "Country1",
                CreateDate = DateTime.Now,
                Active     = true
            };
            var result = countryService.Delete(country);

            Assert.IsTrue(result.Success);
        }
コード例 #3
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         Country co = country.Get(int.Parse(txtCountryCode.Text));
         country.Delete(co);
         MessageBox.Show("Selected Country Successfully Deleted");
         RowFocusedIndex = 0;
         FRM_Country_Load(null, null);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #4
0
 public JsonResult Delete(int id)
 {
     _countryManager.Delete(id);
     return(null);
 }