public bool DeleteParty(PartyTypeModel partytypemodel)
        {
            Mapper.Initialize(map => { map.CreateMap <PartyTypeModel, PartyType>(); });
            var partyData = Mapper.Map <PartyType>(partytypemodel);

            return(partyRepository.DeleteParty(partyData));
        }
Exemplo n.º 2
0
 /// <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;
     }
 }
Exemplo n.º 3
0
 /// <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);
     }
 }
Exemplo n.º 4
0
        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));
            }
        }
Exemplo n.º 5
0
 public async Task DeleteParty(int partyId)
 {
     await _partyRepository.DeleteParty(partyId);
 }