Example #1
0
        public IResponseDTO DeleteWorkshopRate(WorkshopRateVM model)
        {
            try
            {
                var DbWorkshopRate = _mapper.Map <WorkshopRate>(model);
                var entityEntry    = _WorkshopRateRepositroy.Remove(DbWorkshopRate);


                int save = _unitOfWork.Commit();

                if (save == 200)
                {
                    _response.Data     = null;
                    _response.IsPassed = true;
                    _response.Message  = "Ok";
                }
                else
                {
                    _response.Data     = null;
                    _response.IsPassed = false;
                    _response.Message  = "Not saved";
                }
            }
            catch (Exception ex)
            {
                _response.Data     = null;
                _response.IsPassed = false;
                _response.Message  = "Error " + string.Format("{0} - {1} ", ex.Message, ex.InnerException != null ? ex.InnerException.FullMessage() : "");
            }
            return(_response);
        }
Example #2
0
        public IResponseDTO DeleteContactUsMarket(ContactUsMarketVM model)
        {
            try
            {
                var DbContactUsMarket = _mapper.Map <ContactUsMarket>(model);
                var entityEntry       = _ContactUsMarketRepositroy.Remove(DbContactUsMarket);

                int save = _unitOfWork.Commit();
                if (save == 200)
                {
                    _response.Data     = null;
                    _response.IsPassed = true;
                    _response.Message  = "Ok";
                }
                else
                {
                    _response.Data     = null;
                    _response.IsPassed = false;
                    _response.Message  = "Not saved";
                }
            }
            catch (Exception ex)
            {
                _response.Data     = null;
                _response.IsPassed = false;
                _response.Message  = "Error " + ex.Message;
            }
            return(_response);
        }
        public IResponseDTO DeleteAdvertisementAttach(AdvertisementAttachVM model)
        {
            try
            {
                var DbAdvertisementAttach = _mapper.Map <AdvertisementAttach>(model);
                var entityEntry           = _AdvertisementAttachRepositroy.Remove(DbAdvertisementAttach);


                int save = _unitOfWork.Commit();

                if (save == 200)
                {
                    _response.Data     = null;
                    _response.IsPassed = true;
                    _response.Message  = "Ok";
                }
                else
                {
                    _response.Data     = null;
                    _response.IsPassed = false;
                    _response.Message  = "Not saved";
                }
            }
            catch (Exception ex)
            {
                _response.Data     = null;
                _response.IsPassed = false;
                _response.Message  = "Error " + ex.Message;
            }
            return(_response);
        }
Example #4
0
        public IResponseDTO DeletePrivacy(PrivacyVM model)
        {
            try
            {
                var DbPrivacy   = _mapper.Map <Privacy>(model);
                var entityEntry = _PrivacyRepositroy.Remove(DbPrivacy);

                int save = _unitOfWork.Commit();
                if (save == 200)
                {
                    _response.Data     = null;
                    _response.IsPassed = true;
                    _response.Message  = "Ok";
                }
                else
                {
                    _response.Data     = null;
                    _response.IsPassed = false;
                    _response.Message  = "Not saved";
                }
            }
            catch (Exception ex)
            {
                _response.Data     = null;
                _response.IsPassed = false;
                _response.Message  = "Error " + ex.Message;
            }
            return(_response);
        }
Example #5
0
        public IResponseDTO DeleteDepartment(DepartmentModel model)
        {
            try
            {
                var DbDepartment = _mapper.Map <Department>(model);
                var entityEntry  = _departmentRepositroy.Remove(DbDepartment);


                int save = _unitOfWork.Commit();

                if (save == 200)
                {
                    _response.Data     = null;
                    _response.IsPassed = true;
                    _response.Message  = "Ok";
                }
                else
                {
                    _response.Data     = null;
                    _response.IsPassed = false;
                    _response.Message  = "Not saved";
                }
            }
            catch (Exception ex)
            {
                _response.Data     = null;
                _response.IsPassed = false;
                _response.Message  = "Error " + ex.Message;
            }

            return(_response);
        }