public JsonResult Delete(AccomodationActionModel model)
        {
            JsonResult jsonResult   = new JsonResult();
            var        result       = false;
            var        accomodation = accomodationService.GetAccomodationsByID(model.ID);

            result = accomodationService.DeleteAccomodation(accomodation);

            if (result)
            {
                jsonResult.Data = new { Success = true };
            }
            else
            {
                jsonResult.Data = new { Success = false, Message = "Unable to Perform Action On Accomodation Package" };
            }
            return(jsonResult);
        }
Esempio n. 2
0
        public JsonResult Delete(AccomodationActionModel model)
        {
            JsonResult json   = new JsonResult();
            var        result = false;

            var accomodation = accomodationService.GetAccomodationId(model.Id);

            result = accomodationService.DeleteAccomodation(accomodation);

            if (result)
            {
                json.Data = new { Success = true };
            }
            else
            {
                json.Data = new { Success = false, Message = "Unable to perform action on Accomodation Type" };
            }
            return(json);
        }
Esempio n. 3
0
        public JsonResult Delete(int id)
        {
            JsonResult result = new JsonResult();

            result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            dynamic message = "";
            var     data    = false;

            try
            {
                if (id > 0)
                {
                    _Accomodation = _AccomodationService.GetAccomodationById(id);
                    data          = _AccomodationService.DeleteAccomodation(_Accomodation);
                }
                else
                {
                    message = "Please click valid item";
                }
            }
            catch (Exception ex)
            {
                message = ex.Message;
            }
            if (data)
            {
                message     = "Data Delete Successfully !!";
                result.Data = new { Success = true, Message = message };
            }
            else
            {
                result.Data = new { Success = false, Message = message };
            }

            return(result);
        }