Esempio n. 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            #region Capabilities
            if (SessionState.User.IsReadOnly)
            {
                uwToolbar.Items.FromKeyButton("Save").Enabled   = false;
                uwToolbar.Items.FromKeyButton("Delete").Enabled = false;
                uwToolbar.Items.FromKeyButton("Clone").Enabled  = false;
            }

            if (!SessionState.User.HasCapability(HyperCatalog.Business.CapabilitiesEnum.MANAGE_CARTOGRAPHY))
            {
                UITools.HideToolBarButton(uwToolbar, "Save");
                UITools.HideToolBarSeparator(uwToolbar, "SaveSep");
                UITools.HideToolBarButton(uwToolbar, "Delete");
                UITools.HideToolBarSeparator(uwToolbar, "DeleteSep");
                UITools.HideToolBarButton(uwToolbar, "Clone");
                UITools.HideToolBarSeparator(uwToolbar, "CloneSep");
            }
            #endregion

            ifId = Convert.ToInt32(Request["i"]);
            if (!Page.IsPostBack)
            {
                ifObj = HyperCatalog.Business.InputForm.GetByKey(ifId);
                UpdateDataEdit();
            }
        }
Esempio n. 2
0
    // Save the new or updated Input form
    private void ApplyChanges()
    {
        ifObj = HyperCatalog.Business.InputForm.GetByKey(ifId);
        ifObj.PLs.Clear();
        Trace.Warn("Calling PLTree.GetCheckedPLs()");
        PLList checkedPLs = PLTree.GetCheckedPLs();

        foreach (PL pl in checkedPLs)
        {
            ifObj.PLs.Add(pl);
        }
        if (!ifObj.Save(true))
        {
            lbError.CssClass = "hc_error";
            lbError.Text     = HyperCatalog.Business.InputForm.LastError;
            lbError.Visible  = true;
        }
        else
        {
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "RefreshTabs", "<script>RefreshTabs('PLs', " + ifObj.PLs.Count.ToString() + ", 'Usage', " + ifObj.Items.Count.ToString() + ");</script>");
            lbError.Text     = "Data saved!";
            lbError.CssClass = "hc_success";
            lbError.Visible  = true;
        }
    }
Esempio n. 3
0
 // Clone current Input form
 private void Clone()
 {
     ifObj = HyperCatalog.Business.InputForm.GetByKey(ifId);
     if (ifObj != null)
     {
         HyperCatalog.Business.InputForm newIFObj = ifObj.Clone();
         if (newIFObj == null)
         {
             lbError.CssClass = "hc_error";
             lbError.Text     = HyperCatalog.Business.InputForm.LastError;
             lbError.Visible  = true;
         }
         else
         {
             Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ReloadParent", "<SCRIPT>Redirect(" + newIFObj.Id + ")</SCRIPT>");
         }
     }
 }
Esempio n. 4
0
 // Save the new or updated Input form
 private void Save()
 {
     ifObj = HyperCatalog.Business.InputForm.GetByKey(ifId);
     if (ifObj == null)
     {
         ifObj = new HyperCatalog.Business.InputForm(-1, string.Empty, string.Empty, string.Empty, SessionState.User.Id,
                                                     null, SessionState.User.Id,
                                                     null, ' ', false);
     }
     ifObj.Name              = txtInputFormName.Text;
     ifObj.ShortName         = txtInputFormShortName.Text;
     ifObj.Description       = txtDescription.Text;
     ifObj.InputFormTypeCode = Convert.ToChar(ddlInputFormType.SelectedValue);
     // If the current item is not null and the inputform active status is changed, force current item to reload input forms
     if (ifObj.IsActive != cbIsActive.Checked && SessionState.CurrentItem != null)
     {
         SessionState.CurrentItem.InputForms.Clear();
         SessionState.CurrentItem.InputForms = null;
     }
     ifObj.IsActive = cbIsActive.Checked;
     if (!ifObj.Save())
     {
         SessionState.ClearAppInputForms();
         lbError.CssClass = "hc_error";
         lbError.Text     = HyperCatalog.Business.InputForm.LastError;
         lbError.Visible  = true;
     }
     else
     {
         if (!panelId.Visible)
         {
             Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "clientScript", "<script>Redirect(" + ifObj.Id + ");</script>");
         }
         else
         {
             lbError.Text     = "Data saved!";
             lbError.CssClass = "hc_success";
             lbError.Visible  = true;
         }
     }
 }
Esempio n. 5
0
 // Delete current Input form
 private void Delete()
 {
     if (panelId.Visible)
     {
         ifObj = HyperCatalog.Business.InputForm.GetByKey(ifId);
         if (ifObj != null)
         {
             if (!ifObj.Delete(HyperCatalog.Shared.SessionState.User.Id))
             {
                 SessionState.ClearAppInputForms();
                 lbError.CssClass = "hc_error";
                 lbError.Text     = HyperCatalog.Business.InputForm.LastError;
                 lbError.Visible  = true;
             }
             else
             {
                 Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "clientScript", "<script>back();</script>");
             }
         }
     }
 }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region Capabilities
        if (SessionState.User.IsReadOnly)
        {
            uwToolbar.Items.FromKeyButton("ApplyChanges").Enabled = false;
        }

        if (!SessionState.User.HasCapability(HyperCatalog.Business.CapabilitiesEnum.MANAGE_CARTOGRAPHY))
        {
            UITools.HideToolBarButton(uwToolbar, "ApplyChanges");
        }
        #endregion

        ifId = Convert.ToInt32(Request["i"]);

        if (!Page.IsPostBack)
        {
            ifObj = HyperCatalog.Business.InputForm.GetByKey(ifId);
        }
    }