public ucl_data GetDefault(UclTypes type) { var model = GetUclData(type) .Where(m => m.ucd_is_active && m.ucd_is_default) .FirstOrDefault(); return(model); }
public ucl_data GetDetails(string name, UclTypes type) { var model = GetUclData(type) .Where(m => m.ucd_is_active && m.ucd_title.ToLower() == name.ToLower()) .FirstOrDefault(); return(model); }
public JsonResult GetAll(UclTypes type) { try { var list = _uCLService.GetUclData(type) .Where(m => m.ucd_is_active) .OrderBy(c => c.ucd_sort_order) .Select(m => new { m.ucd_key, m.ucd_title, m.ucd_description }); return(Json(list, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(Json(new { success = false, data = "", error = ex.Message }, JsonRequestBehavior.AllowGet)); } }
private ucl_data GetDefaultTypeFromList(List <ucl_data> list, UclTypes type) { return(list.Where(m => m.ucd_ucl_key == ((int)type) && m.ucd_is_active && m.ucd_is_default).FirstOrDefault()); }
public bool Delete(ucl_data entity) { bool CanDelete = true; UclTypes type = (UclTypes)entity.ucd_ucl_key; #region Validations for Delete // checking case data if (type == UclTypes.CaseStatus) { CanDelete = _unitOfWork.CaseRepository.Query().Any(m => m.cas_cst_key == entity.ucd_key) == false; } if (type == UclTypes.CaseType) { CanDelete = _unitOfWork.CaseRepository.Query().Any(m => m.cas_ctp_key == entity.ucd_key) == false; } if (type == UclTypes.BillingCode) { CanDelete = _unitOfWork.CaseRepository.Query().Any(m => m.cas_billing_bic_key == entity.ucd_key) == false; } if (type == UclTypes.LoginDelay) { CanDelete = _unitOfWork.CaseRepository.Query().Any(m => m.cas_billing_lod_key == entity.ucd_key) == false; } // checking facility data if (type == UclTypes.EMR) { CanDelete = _unitOfWork.FacilityRepository.Query().Any(m => m.fac_cst_key == entity.ucd_key) == false; } if (type == UclTypes.FacilityType) { CanDelete = _unitOfWork.FacilityRepository.Query().Any(m => m.fac_fct_key == entity.ucd_key) == false; } if (type == UclTypes.StrokeDesignation) { CanDelete = _unitOfWork.FacilityRepository.Query().Any(m => m.fac_sct_key == entity.ucd_key) == false; } if (type == UclTypes.State) { CanDelete = _unitOfWork.FacilityRepository.Query().Any(m => m.fac_stt_key == entity.ucd_key) == false; if (CanDelete) { CanDelete = _unitOfWork.PhysicianLicenseRepository.Query().Any(m => m.phl_license_state == entity.ucd_key) == false; } } // checking data in facility contract if (type == UclTypes.ServiceType) { CanDelete = _unitOfWork.FacilityContractServiceRepository.Query().Any(m => m.fcs_srv_key == entity.ucd_key) == false; } if (type == UclTypes.CoverageType) { CanDelete = _unitOfWork.FacilityContractRepository.Query().Any(m => m.fct_cvr_key == entity.ucd_key) == false; } // checking data in entity notes if (type == UclTypes.NoteType) { CanDelete = _unitOfWork.EntityNoteRepository.Query().Any(m => m.etn_ntt_key == entity.ucd_key) == false; } #endregion if (CanDelete) { _unitOfWork.UCL_UCDRepository.Delete(entity.ucd_key); _unitOfWork.Save(); _unitOfWork.Commit(); } return(CanDelete); }
public IQueryable <ucl_data> GetUclData(UclTypes type) { int Type = type.ToInt(); return(_unitOfWork.UCL_UCDRepository.Query().Where(m => m.ucd_ucl_key == Type)); }