public async Task Create_FaciltiyDetails_Test()
        {
            var           facilityName = "Martin Memorial Medical Center - North Campus";
            IDbConnection smartAgentDb = new SqlConnection(ConfigurationManager.ConnectionStrings[_devAppConfigName].ConnectionString);
            var           kernel       = new StandardKernel(new RepoTestsModule(smartAgentDb));
            var           facilityRepo = kernel.Get <IAsyncRepository <FacilityMaster> >();
            var           result       = await facilityRepo.FindByName(facilityName);

            if (result.Any())
            {
                var details        = new List <FacilityDetail>();
                var facilityData   = result.FirstOrDefault();
                var facilityDetial = new FacilityDetail();

                facilityDetial.FacilityKey = facilityData.FacilityKey;
                facilityDetial.UpdatedBy   = "kris.lindsey";
                details.Add(facilityDetial);

                var facilityDetialRepo = kernel.Get <IAsyncRepository <FacilityDetail> >();
                var checkResults       = await facilityDetialRepo.FindWithGuidAsync(facilityData.FacilityKey);

                if (checkResults.Any())
                {
                    writeToConsole("Already have facility detial records for facility: ", facilityData);
                }
                else
                {
                    var facilityKey = await facilityDetialRepo.AddAsync(details);

                    Console.WriteLine("facility Detials added with facility key: ", facilityKey);
                }
            }
        }
 public void UpdateFacility(FacilityDetail detail, Facility facility, IPersistenceContext context)
 {
     facility.Code                 = detail.Code;
     facility.Name                 = detail.Name;
     facility.Description          = detail.Description;
     facility.InformationAuthority = EnumUtils.GetEnumValue <InformationAuthorityEnum>(detail.InformationAuthority, context);
     facility.Deactivated          = detail.Deactivated;
 }
Beispiel #3
0
        public int AddFacilityDetail(string clientId, AccountModel model, IFacilityDetailRepository _facilityDetailsRepository)
        {
            FacilityDetail _facilityDetail = new FacilityDetail
            {
                FacilityDetailId = clientId,
                Email            = model.Email,
                jobType          = model.jobType,
                FacilityId       = model.FacilityId,
                FirstName        = model.FirstName,
                LastName         = model.LastName,
                CountryCode      = model.CountryCode,
                EmailConfirmed   = model.EmailConfirmed,
                PhoneNumber      = model.PhoneNumber,
                CreatedBy        = "Self",
                ModifiedBy       = "Self",
                DateEntered      = DateTime.Now.ToString(),
                DateModified     = DateTime.Now.ToString()
            };

            return(_facilityDetailsRepository.Insert(_facilityDetail));
        }
Beispiel #4
0
        public override void Start()
        {
            Platform.GetService(
                delegate(IFacilityAdminService service)
            {
                var formResponse             = service.GetFacilityEditFormData(new GetFacilityEditFormDataRequest());
                _informationAuthorityChoices = formResponse.InformationAuthorityChoices;

                if (_isNew)
                {
                    _facilityDetail = new FacilityDetail();
                }
                else
                {
                    var response    = service.LoadFacilityForEdit(new LoadFacilityForEditRequest(_facilityRef));
                    _facilityRef    = response.FacilityDetail.FacilityRef;
                    _facilityDetail = response.FacilityDetail;
                }
            });


            base.Start();
        }
Beispiel #5
0
        /// <summary>
        ///  Gets all Contract Facilities.
        /// </summary>
        /// <returns>List of GetAllContractFacilities</returns>
        public List <FacilityDetail> GetAllContractFacilities(ContractHierarchy contractHierarchyData)
        {
            List <FacilityDetail> contractFacilitiesList = null;

            if (contractHierarchyData != null)
            {
                _cmd = _db.GetStoredProcCommand("GetAllFacilities");
                string facilityIds = string.Join(",", contractHierarchyData.FacilityList.Select(a => a.ToString(CultureInfo.InvariantCulture)).ToArray());
                _db.AddInParameter(_cmd, "@FacilityID", DbType.String, facilityIds);
                DataSet contractHierarchyDataSet = _db.ExecuteDataSet(_cmd);

                if (contractHierarchyDataSet.IsTableDataPopulated(0))
                {
                    if (contractHierarchyDataSet.Tables[0].Rows != null && contractHierarchyDataSet.Tables[0].Rows.Count > 0)
                    {
                        contractFacilitiesList = new List <FacilityDetail>();
                        for (int i = 0; i < contractHierarchyDataSet.Tables[0].Rows.Count; i++)
                        {
                            FacilityDetail contractFacilityList = new FacilityDetail
                            {
                                FacilityId =
                                    int.Parse(
                                        contractHierarchyDataSet.Tables[0].Rows[i][
                                            "FacilityId"].ToString()),
                                FacilityName =
                                    Convert.ToString(
                                        contractHierarchyDataSet.Tables[0].Rows[i][
                                            "FacilityName"]),
                                NodeId = long.Parse(contractHierarchyDataSet.Tables[0].Rows[i]["NodeId"].ToString())
                            };
                            contractFacilitiesList.Add(contractFacilityList);
                        }
                    }
                }
            }
            return(contractFacilitiesList);
        }
Beispiel #6
0
 public UpdateFacilityRequest(FacilityDetail detail)
 {
     this.FacilityDetail = detail;
 }
 public LoadFacilityForEditResponse(FacilityDetail facilityDetail)
 {
     this.FacilityDetail = facilityDetail;
 }
Beispiel #8
0
 public UpdateFacilityRequest(FacilityDetail detail)
 {
     this.FacilityDetail = detail;
 }
Beispiel #9
0
 public AddFacilityRequest(FacilityDetail detail)
 {
     this.FacilityDetail = detail;
 }
 public AddFacilityRequest(FacilityDetail detail)
 {
     this.FacilityDetail = detail;
 }
Beispiel #11
0
 public LoadFacilityForEditResponse(FacilityDetail facilityDetail)
 {
     this.FacilityDetail = facilityDetail;
 }