Ejemplo n.º 1
0
        public override bool SaveStep(int NextStep)
        {
            Page.Validate();
            if (Page.IsValid)
            {
                base.SaveStep(NextStep);
                try
                {
                    RoleVisibilityAndFixation.Save();
                    XmlDocument xmlDom = new XmlDocument();
                    XmlHelper.CreateRoot(xmlDom, "root");

                    xmlDom.DocumentElement.SetAttribute("version", "2.0");
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "txtURL", txtURL.Text);
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "ddlFC", ddlFC.SelectedValue);
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "cbxDesc", cbxDesc.Checked);
                    return(SaveInstanceData(InstanceID, xmlDom.OuterXml));
                }
                catch
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 public override bool SaveStep(int NextStep)
 {
     Page.Validate();
     if (Page.IsValid)
     {
         base.SaveStep(NextStep);
         try
         {
             RoleVisibilityAndFixation.Save();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
        public override bool SaveStep(int NextStep)
        {
            Page.Validate();
            if (Page.IsValid)
            {
                base.SaveStep(NextStep);
                try
                {
                    RoleVisibilityAndFixation.Save();
                    XmlDocument xmlDom = new XmlDocument();
                    InstanceID = ObjectID.Value;
                    string strXml = LoadInstanceData(InstanceID);
                    if (string.IsNullOrEmpty(strXml))
                    {
                        xmlDom.DocumentElement.SetAttribute("version", "2.0");
                        XmlHelper.CreateRoot(xmlDom, "root");
                    }
                    else
                    {
                        xmlDom.LoadXml(strXml);
                    }

                    SourceAndTagSelector.GetProperties();


                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "txtUI", SourceAndTagSelector.UserID.HasValue? SourceAndTagSelector.UserID.Value.ToString():string.Empty);
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "ctyID", SourceAndTagSelector.DataSourceIDs);
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "rcbDS", SourceAndTagSelector.DataSourceSelection);
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "rcbOverWriteByURL", rcbOverWriteByURL.SelectedValue);
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "tagWords", SourceAndTagSelector.TagList1);
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "tagWords2", SourceAndTagSelector.TagList2);
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "tagWords3", SourceAndTagSelector.TagList3);

                    if (rcbLT.SelectedIndex == 0 && rcbST.SelectedIndex == 0)
                    {
                        XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "layoutType", (int)VEMAPVWLayoutType.SimpleByObjectType);
                    }
                    else if (rcbLT.SelectedIndex == 0 && rcbST.SelectedIndex == 1)
                    {
                        XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "layoutType", (int)VEMAPVWLayoutType.SimpleByTag);
                    }
                    else if (rcbLT.SelectedIndex == 1 && rcbST.SelectedIndex == 0)
                    {
                        XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "layoutType", (int)VEMAPVWLayoutType.SingleLayerByObjectType);
                    }
                    else if (rcbLT.SelectedIndex == 1 && rcbST.SelectedIndex == 1)
                    {
                        XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "layoutType", (int)VEMAPVWLayoutType.SingleLayerdByTag);
                    }
                    else if (rcbLT.SelectedIndex == 2 && rcbST.SelectedIndex == 0)
                    {
                        XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "layoutType", (int)VEMAPVWLayoutType.MultiLayerByObjectType);
                    }
                    else if (rcbLT.SelectedIndex == 2 && rcbST.SelectedIndex == 1)
                    {
                        XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "layoutType", (int)VEMAPVWLayoutType.MultiLayerByTag);
                    }


                    string selectedObjTypes = string.Empty;
                    for (int i = 0; i < rcbOT.Items.Count; i++)
                    {
                        string checkboxId = rcbOT.UniqueID + "$i" + i + "$Checkbox";
                        if (Request.Form[checkboxId] != null)
                        {
                            if (i > 0)
                            {
                                selectedObjTypes += rcbOT.Items[i].Value + ",";
                            }
                            else if (rcbOT.Text.ToLower().IndexOf(",alle") > -1 || rcbOT.Text.ToLower().IndexOf("alle,") > -1 || rcbOT.Text.Trim().ToLower() == "alle")
                            {
                                //All Selected --> Return Empty, which means all
                                selectedObjTypes = string.Empty;
                                break;
                            }
                        }
                    }

                    selectedObjTypes = selectedObjTypes.Trim(',');
                    XmlHelper.SetElementInnerText(xmlDom.DocumentElement, "objTypes", selectedObjTypes);

                    return(SaveInstanceData(InstanceID, xmlDom.OuterXml));
                }
                catch
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }