Esempio n. 1
0
 // DELETE: api/Registration/5
 public bool Delete(int id)
 {
     if (id > 0)
     {
         return(_RegistrationServices.DeleteRegistration(id));
     }
     return(false);
 }
        public IActionResult DeleteRegistrations(RegistrationModel model)
        {
            ResultModel resultModel = new ResultModel();

            try
            {
                Registration registration = null;
                registration = new Registration()
                {
                    CustFirstName    = model.CustFirstName,
                    CustLastName     = model.CustLastName,
                    EatingPreferance = model.EatingPreferance,
                    Email            = model.Email,
                    Password         = model.Password,
                    PhoneNo          = model.PhoneNo,
                    RAmount          = model.RAmount,
                    ReferCode        = model.ReferCode,
                    Gender           = model.Gender
                };



                _registrationServices.DeleteRegistration(registration);


                if (registration != null)
                {
                    resultModel.Message  = ValidationMessages.Success;
                    resultModel.Status   = 1;
                    resultModel.Response = registration;
                }
                else
                {
                    resultModel.Message  = ValidationMessages.Failure;
                    resultModel.Status   = 0;
                    resultModel.Response = null;
                }
            }
            catch (Exception exp)
            {
                resultModel.Message  = exp.ToString();
                resultModel.Status   = 0;
                resultModel.Response = null;
            }


            return(Ok(resultModel));
        }