示例#1
0
        protected void GetClassRoom()
        {
            ResetForm();
            if (Grid.SelectedValue != null)
            {
                var cRoom = new CProgramClassRoom();
                var room  = cRoom.Get(Convert.ToInt32(Grid.SelectedValue));
                if (room.ProgramClassRoomId > 0)
                {
                    tbName.Text                = room.Name;
                    tbNumber.Text              = room.Number;
                    tbFloor.Text               = room.Floor;
                    tbCapacity.Value           = room.Capacity;
                    RadButtonActive.Checked    = room.IsActive;
                    RadTextBoxDescription.Text = room.Description;

                    RadListBoxComponents.DataSource = new CProgramClassRoom().GetClassRoomItemList(room.ProgramClassRoomId);
                    RadListBoxComponents.DataBind();

                    RadToolBar2.FindItemByText("New").Enabled = true;
                    if (RadToolBar2.FindItemByText("Save") != null)
                    {
                        RadToolBar2.FindItemByText("Save").Text = "Update";
                    }
                }
            }
        }
示例#2
0
        protected void ResetForm()
        {
            tbName.Text                = "";
            tbNumber.Text              = "";
            tbFloor.Text               = "";
            tbCapacity.Value           = null;
            RadButtonActive.Checked    = true;
            RadTextBoxDescription.Text = string.Empty;

            RadListBoxComponents.DataSource = new CProgramClassRoom().GetClassRoomItemList(0);
            RadListBoxComponents.DataBind();

            RadToolBar2.FindItemByText("New").Enabled = false;
            if (RadToolBar2.FindItemByText("Update") != null)
            {
                RadToolBar2.FindItemByText("Update").Text = "Save";
            }
        }