Exemplo n.º 1
0
 public DoctorSearchController()
 {
     objIDoctorSearch = new DoctorSearch();
     objDepartment    = new DepartmentMaster();
     objHospital      = new HospitalMaster();
     objLocation      = new LocationMaster();
     objLanguage      = new LanguageMaster();
     objReferenceType = new ReferenceType();
 }
Exemplo n.º 2
0
 protected void lstVwLocation_ItemDataBound(object sender, ListViewItemEventArgs e)
 {
     if (e.Item.ItemType == ListViewItemType.DataItem)
     {
         ILocationMaster     currentLocation        = ((ListViewDataItem)e.Item).DataItem as ILocationMaster;
         ucFacilitiesDisplay currentLocationDisplay = e.Item.FindControl("UCLocation") as ucFacilitiesDisplay;
         currentLocationDisplay.Initialize(currentLocation);
     }
 }
        List <IMeetingMaster> IMeetingRetriever.GetMeetingsByLocation(ILocationMaster location)
        {
            using (ManagementSystemDataContext dataContext = new ManagementSystemDataContext(_connectionString))
            {
                IEnumerable <Meeting_MasterDto> results = (from meeting in dataContext.Meeting_MasterDtos
                                                           where meeting.ActualLocationId == location.LocationId
                                                           select meeting);

                return(results.Cast <IMeetingMaster>().ToList());
            }
        }
Exemplo n.º 4
0
        public void Initialize(ILocationMaster location)
        {
            if (location != null)
            {
                lblLocationBuilding.Text = location.LocationBuilding.Trim();
                lblLocationCapacity.Text = location.LocationCapacity.ToString().Trim();
                lblLocationFloor.Text    = location.LocationFloor.Trim();
                lblLocationName.Text     = location.LocationName.Trim();

                listItemAVAvailable.Selected    = location.IsAvAvailable;
                listItemPhoneAvailable.Selected = location.IsPhoneAvailable;
                listItemVideoAvailable.Selected = location.IsVideoConfAvailable;
            }
        }
Exemplo n.º 5
0
        public void should_return_correct_location_by_location_id()
        {
            ILocationMaster location = LocationRetriever.GetLocationByLocationId(_locationId2);

            Assert.IsTrue(location.IsAvAvailable);
            Assert.IsTrue(location.IsPhoneAvailable);
            Assert.IsTrue(location.IsVideoConfAvailable);
            Assert.AreEqual("Building2", location.LocationBuilding);
            Assert.AreEqual(10, location.LocationCapacity);
            Assert.AreEqual("1", location.LocationFloor);
            Assert.AreEqual(_locationId2, location.LocationId);
            Assert.AreEqual("Test 2", location.LocationName);
            Assert.AreEqual("TestRoom", location.LocationRoom);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString.HasKeys())
                {
                    _controller = new LocationController(this);
                    //Get Location
                    int locId = Convert.ToInt16(Request.QueryString["LocationId"]);
                    if (locId >= 1)
                    {
                        ILocationMaster _currentLocation = _controller.GetLocationByLocationId(locId);
                        //Populate Page
                        lblLocationBuilding.Text = _currentLocation.LocationBuilding.Clone().ToString();
                        lblLocationCapacity.Text = _currentLocation.LocationCapacity.ToString();
                        lblLocationFloor.Text    = _currentLocation.LocationFloor;
                        lblLocationName.Text     = _currentLocation.LocationName.Clone().ToString();
                        lblLocationRoom.Text     = _currentLocation.LocationRoom;

                        if (_currentLocation.IsAvAvailable)
                        {
                            chkBoxListFeatures.Items.FindByValue("AV Available").Selected = true;
                        }
                        if (_currentLocation.IsPhoneAvailable)
                        {
                            chkBoxListFeatures.Items.FindByValue("Phone Available").Selected = true;
                        }
                        if (_currentLocation.IsVideoConfAvailable)
                        {
                            chkBoxListFeatures.Items.FindByValue("Video Available").Selected = true;
                        }
                    }
                }
                else
                {
                }
            }
        }
        void ILocationSaver.SaveLocation(ILocationMaster location)
        {
            using (ManagementSystemDataContext datacontext = new ManagementSystemDataContext(_connectionString))
            {
                if (datacontext.Location_MasterDtos.Any(c => c.LocationId == location.LocationId))
                {
                    Location_MasterDto lcm = datacontext.Location_MasterDtos.Single(c => c.LocationId == location.LocationId);
                    lcm.IsAVAvailable        = location.IsAvAvailable;
                    lcm.IsPhoneAvailable     = location.IsPhoneAvailable;
                    lcm.IsVideoConfAvailable = location.IsVideoConfAvailable;
                    lcm.LocationBuilding     = location.LocationBuilding;
                    lcm.LocationCapacity     = location.LocationCapacity;
                    lcm.LocationFloor        = location.LocationFloor;
                    lcm.LocationName         = location.LocationName;
                    lcm.LocationRoom         = location.LocationRoom;
                }
                else
                {
                    Location_MasterDto lcm = new Location_MasterDto
                    {
                        IsAVAvailable        = location.IsAvAvailable,
                        IsPhoneAvailable     = location.IsPhoneAvailable,
                        IsVideoConfAvailable = location.IsVideoConfAvailable,
                        LocationBuilding     = location.LocationBuilding,
                        LocationCapacity     = location.LocationCapacity,
                        LocationFloor        = location.LocationFloor,
                        LocationName         = location.LocationName,
                        LocationRoom         = location.LocationRoom
                    };

                    datacontext.Location_MasterDtos.InsertOnSubmit(lcm);
                }

                datacontext.SubmitChanges();
            }
        }
 public void InsertLocation(ILocationMaster location)
 {
     _locationSaver.SaveLocation(location);
 }