Пример #1
0
    protected void Grid_HostList_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem DataItem = e.Item as GridDataItem;
            int          hostid   = Convert.ToInt32(DataItem["DormitoryHostId"].Text.ToString());
            int          status   = Convert.ToInt32(DataItem["HostStatus"].Text.ToString().Trim());
            DataItem["HostStatus"].Text = DormitoryHostStatus(status);
            //School and Campus
            var cHostSchool = new CDormitoryHostPreferredSchool();
            DormitoryHostPrefferedSchool hostTopSchool = cHostSchool.GetHostTopSchool(hostid);

            SiteLocation HostSchoolLocation = cHostSchool.GetHostTopShoolNameLocation(Convert.ToInt32(hostTopSchool.SiteLocationId));
            var          cSite       = new CSite();
            Site         SchoolName  = cSite.Get(Convert.ToInt32(HostSchoolLocation.SiteId));
            RadLabel     lblTopShool = (RadLabel)DataItem.FindControl("lbl_HostTopSchool");
            lblTopShool.Text = SchoolName.Abbreviation.ToString();
            RadLabel lblTopCampus = (RadLabel)DataItem.FindControl("lbl_HostTopCampus");
            lblTopCampus.Text = HostSchoolLocation.City.ToString();


            //Room Number
            RadLabel lblRoomNumber = (RadLabel)DataItem.FindControl("lbl_RoomNumber");
            var      cHostRoom     = new CDormitoryHostRoom();
            int      RoomNumber    = 0;
            RoomNumber         = cHostRoom.GetDormitoryHostRoomNumber(hostid);
            lblRoomNumber.Text = RoomNumber.ToString();
            //Bed Number
            RadLabel lblBedNumber = (RadLabel)DataItem.FindControl("lbl_BedNumber");
            var      cHostBed     = new CDormitoryHostBed();
            int      BedNumber    = 0;
            BedNumber         = cHostBed.GetDormitoryHostBedNumber(hostid);
            lblBedNumber.Text = BedNumber.ToString();
        }
    }
Пример #2
0
        protected void Grid_HostList_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem DataItem = e.Item as GridDataItem;
                int          hostid   = Convert.ToInt32(DataItem["DormitoryHostId"].Text.ToString());
                int          status   = Convert.ToInt32(DataItem["HostStatus"].Text.ToString().Trim());
                DataItem["HostStatus"].Text = DormitoryHostStatus(status);

                //Room Number
                RadLabel lblRoomNumber = (RadLabel)DataItem.FindControl("lbl_RoomNumber");
                var      cHostRoom     = new CDormitoryHostRoom();
                int      RoomNumber    = 0;
                RoomNumber         = cHostRoom.GetDormitoryHostRoomNumber(hostid);
                lblRoomNumber.Text = RoomNumber.ToString();
                //Bed Number
                RadLabel lblBedNumber = (RadLabel)DataItem.FindControl("lbl_BedNumber");
                var      cHostBed     = new CDormitoryHostBed();
                int      BedNumber    = 0;
                BedNumber         = cHostBed.GetDormitoryHostBedNumber(hostid);
                lblBedNumber.Text = BedNumber.ToString();
            }
        }