public IResponseDTO EditWorkShopPrefer(WorkShopPreferVM model) { //try //{ // int OldStuts = (int)_WorkShopPreferRepositroy.GetFirst(x => x.WorkShopPreferId == model.WorkShopPreferId).Status; // var DbWorkShopPrefer = _mapper.Map<WorkShopPrefer>(model); // var entityEntry = _WorkShopPreferRepositroy.Update(DbWorkShopPrefer); // if (OldStuts != model.Status) // { // bool _notification = SendNotification(model); // } // int save = _unitOfWork.Commit(); // if (save == 200) // { // _response.Data = model; // _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); }
public IResponseDTO DeleteWorkShopPrefer(WorkShopPreferVM model) { try { var DbWorkShopPrefer = _mapper.Map <WorkShopPrefer>(model); var entityEntry = _WorkShopPreferRepositroy.Remove(DbWorkShopPrefer); 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); }
public IResponseDTO UpdateWorkShopPrefer(WorkShopPreferVM WorkShopPreferVM) { var depart = _WorkShopPreferServices.EditWorkShopPrefer(WorkShopPreferVM); return(depart); }
public IResponseDTO postWorkShopPrefer(WorkShopPreferVM WorkShopPreferVM) { var depart = _WorkShopPreferServices.PostWorkShopPrefer(WorkShopPreferVM); return(depart); }
public IResponseDTO RemoveWorkShopPrefer(WorkShopPreferVM WorkShopPreferVM) { var depart = _WorkShopPreferServices.DeleteWorkShopPrefer(WorkShopPreferVM); return(depart); }