示例#1
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        RequiresAuthorizationOrManagedGroup(Authorizations.UpdateGroup, Group.Id);

        var groupProperty = new GroupProperty
        {
            GroupId = Group.Id,
            ImageId = Convert.ToInt32(ddlComputerImage.SelectedValue),
            ImageProfileId = Convert.ToInt32(ddlComputerImage.SelectedValue) == -1 ? -1 : Convert.ToInt32(ddlImageProfile.SelectedValue),
            Description = txtComputerDesc.Text,
            SiteId = Convert.ToInt32(ddlSite.SelectedValue),
            BuildingId = Convert.ToInt32(ddlBuilding.SelectedValue),
            RoomId = Convert.ToInt32(ddlRoom.SelectedValue),
            CustomAttribute1 = txtCustom1.Text,
            CustomAttribute2 = txtCustom2.Text,
            CustomAttribute3 = txtCustom3.Text,
            CustomAttribute4 = txtCustom4.Text,
            CustomAttribute5 = txtCustom5.Text,
            ImageEnabled = Convert.ToInt16(chkImage.Checked),
            ImageProfileEnabled = Convert.ToInt16(chkProfile.Checked),
            DescriptionEnabled = Convert.ToInt16(chkDescription.Checked),
            SiteEnabled = Convert.ToInt16(chkSite.Checked),
            BuildingEnabled = Convert.ToInt16(chkBuilding.Checked),
            RoomEnabled = Convert.ToInt16(chkRoom.Checked),
            CustomAttribute1Enabled = Convert.ToInt16(chkCustom1.Checked),
            CustomAttribute2Enabled = Convert.ToInt16(chkCustom2.Checked),
            CustomAttribute3Enabled = Convert.ToInt16(chkCustom3.Checked),
            CustomAttribute4Enabled = Convert.ToInt16(chkCustom4.Checked),
            CustomAttribute5Enabled = Convert.ToInt16(chkCustom5.Checked),
            ProxyEnabledEnabled = Convert.ToInt16(chkProxyReservation.Checked),
            BootFileEnabled = Convert.ToInt16(chkBootFile.Checked),
            TftpServerEnabled = Convert.ToInt16(chkTftp.Checked),
            ProxyEnabled = Convert.ToInt16(chkProxyEnabled.Checked),
            TftpServer = txtTftp.Text,
            BootFile = ddlBootFile.Text
        };

        if (_groupProperty == null)
        {
            BLL.GroupProperty.AddGroupProperty(groupProperty);
            EndUserMessage = "Successfully Updated Group Properties";
        }
        else
        {
            groupProperty.Id = _groupProperty.Id;
            BLL.GroupProperty.UpdateGroupProperty(groupProperty);
            EndUserMessage = "Successfully Updated Group Properties";
        }
    }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _groupProperty = BLL.GroupProperty.GetGroupProperty(Group.Id);
     if (!IsPostBack) PopulateForm();
 }