public bool DeleteParty(PartyTypeModel partytypemodel) { Mapper.Initialize(map => { map.CreateMap <PartyTypeModel, PartyType>(); }); var partyData = Mapper.Map <PartyType>(partytypemodel); return(partyRepository.DeleteParty(partyData)); }
/// <summary> /// This is the method for delete party. /// </summary> /// <param name="partyId"></param> /// <returns></returns> public string DeleteParty(int partyId) { try { if (partyId != 0) { return(partyRL.DeleteParty(partyId)); } else { return(null); } } catch (Exception) { throw; } }
/// <summary> /// It Delete the Party /// </summary> /// <param name="PartyId">PartyId</param> /// <returns>It return true, if party is delete successfully or else false</returns> public bool DeleteParty(int PartyId) { try { if (PartyId <= 0) { return(false); } else { return(_partyRepository.DeleteParty(PartyId)); } } catch (Exception e) { throw new Exception(e.Message); } }
public HttpResponseMessage Delete([FromBody] Models.party oParty, long?updated_by) { try { long deleteParty = partyRepository.DeleteParty(oParty.party_id, updated_by); if (deleteParty == 1) { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "warning", msg = "Sorry! you can not delete Party, because its already used in many Tables!" }, formatter)); } if (deleteParty == 2) { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "success", msg = "Party Information Delete Successfully." }, formatter)); } else { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "error", msg = "" }, formatter)); } } catch (Exception ex) { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "error", msg = ex.ToString() }, formatter)); } }
public async Task DeleteParty(int partyId) { await _partyRepository.DeleteParty(partyId); }