Example #1
0
 public Color DeleteColor(int ID)
 {
     if (ID <= 0)
     {
         throw new ArgumentException("Incorrect ID entered");
     }
     if (GetColorByID(ID) == null)
     {
         throw new ArgumentException("No color with such ID found");
     }
     return(ColorRepository.DeleteColor(ID));
 }
        public HttpResponseMessage Delete([FromBody] Models.color color)
        {
            try
            {
                //long con_id = long.Parse(country_id);
                bool updatCountry = colorRepository.DeleteColor(color.color_id);

                var formatter = RequestFormat.JsonFormaterString();
                return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                    output = "success", msg = "Color Delete Successfully."
                }, formatter));
            }
            catch (Exception ex)
            {
                var formatter = RequestFormat.JsonFormaterString();
                return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                    output = "error", msg = ex.ToString()
                }, formatter));
            }
        }
Example #3
0
 public void DeleteColor(int id)
 {
     colorRepository.DeleteColor(id);
 }
Example #4
0
 public void DeleteColor(int id)
 {
     colorRepo.DeleteColor(id);
 }
Example #5
0
 public bool DeleteColor(Color color)
 {
     return(colorRepository.DeleteColor(color));
 }