コード例 #1
0
 public void initilizeListToXml()
 {
     XmlDataSource.SaveToXML <List <HostingUnit> >(DataSource.ListHostingUnits, HostingUnitPath);
     XmlDataSource.SaveToXML <List <GuestRequest> >(DataSource.ListGuestRequest, XG.GuestRequestPath);
     XmlDataSource.SaveToXML <List <Order> >(DataSource.ListOrder, XO.OrderPath);
     XC.AddConfiguration();
 }
コード例 #2
0
ファイル: Menu.ascx.cs プロジェクト: danygolden/gianfratti
    XmlDataSource GetMenuDataSource(string menu, string serverMapPath)
    {
        XmlDataSource objData = new XmlDataSource();
        objData.XPath = "siteMap/siteMapNode";
        switch (menu)
        {
            case "Empresa":
                objData.DataFile = serverMapPath + @"\App_Data\Empresa.sitemap";
                break;
            case "Atendimento":
                objData.DataFile = serverMapPath + @"\App_Data\Atendimento.sitemap";
                break;
            case "Medico":
                objData.DataFile = serverMapPath + @"\App_Data\Medico.sitemap";
                break;
            case "Ambulatorio":
                objData.DataFile = serverMapPath + @"\App_Data\Ambulatorio.sitemap";
                break;
            case "Administrativo":
                objData.DataFile = serverMapPath + @"\App_Data\Administrativo.sitemap";
                break;
            case "Multidisciplinar":
                objData.DataFile = serverMapPath + @"\App_Data\Multidisciplinar.sitemap";
                break;

            default:
                break;
        }
        objData.DataBind();
        return objData;
    }
コード例 #3
0
        protected void Suoshusheng_SelectedIndexChanged(object sender, EventArgs e)
        {
            Suoshushi.Items.Clear();                      //清空所属市
            Suoshushi.Items.Add(new ListItem("请选择", "")); //添加请选择
            Suoshushi.DataTextField  = "cname";
            Suoshushi.DataValueField = "cname";
            XmlDataSource xds = new XmlDataSource();

            xds.DataFile             = Server.MapPath("~/pc.xml");//地址
            xds.XPath                = "//province[@name='" + Suoshusheng.SelectedValue + "']/city";
            Suoshushi.DataSource     = xds;
            Suoshushi.DataTextField  = "cname";
            Suoshushi.DataValueField = "cname";
            Suoshushi.DataBind();
            //Suoshushi.Items.Clear();
            //Suoshushi.Items.Add(new ListItem("请选择", ""));
            //Suoshushi.DataTextField = "name2";
            //Suoshushi.DataValueField = "name2";
            //XmlDataSource xds = new XmlDataSource();
            //xds.DataFile = Server.MapPath("~/new.xml");
            //xds.XPath = "//Province[@name1='" + Suoshusheng.SelectedValue + "']/City";
            //Suoshushi.DataSource = xds;
            //Suoshushi.DataTextField = "name2";
            //Suoshushi.DataValueField = "name2";
            //Suoshushi.DataBind();
            //Suoshushi.SelectedValue = "请选择";
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        //Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            if (!IsPostBack)
            {
                MembershipUser User = Membership.GetUser();
                objOrganization = objOrganization.Get_Organization();
                int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
                if (userid != 0)
                {
                    objContact = objContact.Get_By_id(userid);
                    lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
                }
            }
            XmlDataSource ds = new XmlDataSource();
            ds.EnableCaching = false;
            ds.DataFile = Server.MapPath("../Files/Admin.xml");
            TreeView1.DataSource = ds;
            TreeView1.DataBind();

        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
コード例 #5
0
 public void initilizeListToXml()
 {
     XmlDataSource.SaveToXML <List <HostingUnit> >(DataSource.HostingUnitsCollection, HostingUnitPath);
     // XmlDataSource.SaveToXML<List<GuestRequest>>(DataSource.GuestRequestsCollection ,XG.GuestRequestPath);
     //XmlDataSource.SaveToXML<List<Order>>(DataSource.OrdersCollection,XO.OrderPath);
     //XC.AddConfiguration();
 }
コード例 #6
0
 protected void Suoshushi_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Suoshushi.Items.Clear();                      //所属市清空
         Suoshushi.Items.Add(new ListItem("请选择", "")); //所属市添加请选择
         Suoshushi.DataTextField  = "cname";           //id
         Suoshushi.DataValueField = "cname";
         XmlDataSource xds = new XmlDataSource();
         xds.DataFile             = Server.MapPath("~/pc.xml");                                   //同上
         xds.XPath                = "//province[@name='" + Suoshusheng.SelectedValue + "']/city"; //同上
         Suoshushi.DataSource     = xds;
         Suoshushi.DataTextField  = "cname";                                                      //同上
         Suoshushi.DataValueField = "cname";
         Suoshushi.DataBind();
         mu = bu.GetModel(Request.QueryString["UserID"]);
         Suoshushi.Items.FindByValue(mu.UserCity).Selected = true;//同上
     }
     //if (!IsPostBack)
     //{
     //    XmlDataSource xds = new XmlDataSource();
     //    xds.DataFile = Server.MapPath("~/new.xml");
     //    xds.XPath = "//Province[@name1='" + Suoshusheng.SelectedValue + "']/City";
     //    Suoshushi.DataSource = xds;
     //    Suoshushi.DataTextField = "name2";
     //    Suoshushi.DataValueField = "name2";
     //    Suoshushi.SelectedValue = mu.UserCity;
     //    Suoshushi.DataBind();
     //}
 }
コード例 #7
0
    /// <summary>
    /// Carrega os itens do menu conforme perfil logado
    /// </summary>
    /// <param name="menu"></param>
    /// <param name="serverMapPath"></param>
    /// <returns></returns>
    XmlDataSource GetMenuDataSource(string menu, string serverMapPath)
    {
        XmlDataSource objData = new XmlDataSource();

        objData.XPath = "siteMap/siteMapNode";
        switch (menu)
        {
        case "Administrador":     //Caso seja o perfil Administrador carrega o perfil setado no xml
            objData.DataFile = serverMapPath + @"\App_Data\Administrador.sitemap";
            break;

        case "Fisioterapeuta":     //Caso seja o perfil Fisioterapeuta carrega o perfil setado no xml
            objData.DataFile = serverMapPath + @"\App_Data\Fisioterapeuta.sitemap";
            break;

        case "Recepcionista":     //Caso seja o perfil Fisioterapeuta carrega o perfil setado no xml
            objData.DataFile = serverMapPath + @"\App_Data\Recepcionista.sitemap";
            break;

        case "Financeiro":     //Caso seja o perfil Fisioterapeuta carrega o perfil setado no xml
            objData.DataFile = serverMapPath + @"\App_Data\Financeiro.sitemap";
            break;

        default:
            break;
        }
        objData.DataBind();
        return(objData);
    }
コード例 #8
0
        public void Client_VariablesTest()
        {
            var ds = new XmlDataSource(File.OpenRead(SampleTemplatesFolder + @"\Manufacturing.xml"));

            ds.Variables = new List <TemplateVariable>()
            {
                new TemplateVariable()
                {
                    Name = "Var1", Value = "hi there"
                }
            };

            var dataSources = new Dictionary <string, DataSource>()
            {
                { "", ds }
            };

            var templateFilePath = SampleTemplatesFolder + @"\Variables.docx";
            var outputFilePath   = SampleTemplatesFolder + @"\VariablesOutput.pdf";

            using (var templateFile = File.OpenRead(templateFilePath))
            {
                using (var outputFile = File.Create(outputFilePath))
                {
                    var report = new ReportPdf(uri, templateFile, outputFile);
                    report.Process(dataSources);
                }
            }
        }
コード例 #9
0
ファイル: Menu.ascx.cs プロジェクト: danygolden/gianfratti
    XmlDataSource GetMenuDataSource(string menu, string serverMapPath)
    {
        XmlDataSource objData = new XmlDataSource();

        objData.XPath = "siteMap/siteMapNode";
        switch (menu)
        {
        case "Empresa":
            objData.DataFile = serverMapPath + @"\App_Data\Empresa.sitemap";
            break;

        case "Cliente":
            objData.DataFile = serverMapPath + @"\App_Data\Cliente.sitemap";
            break;

        case "Medico":
            objData.DataFile = serverMapPath + @"\App_Data\Medico.sitemap";
            break;

        default:
            break;
        }
        objData.DataBind();
        return(objData);
    }
    public static void InsertNode(ASPxTreeList treeList, ASPxDataInsertingEventArgs e)
    {
        XmlDataSource xmlDataXource = treeList.Page.FindControl(treeList.DataSourceID) as XmlDataSource;
        XmlDocument   docum         = xmlDataXource.GetXmlDocument();

        AddNewNodeId(e.NewValues, docum);

        var     parentNodeInTreeList = treeList.FindNodeByKeyValue(treeList.NewNodeParentKey);
        var     parentID             = parentNodeInTreeList.GetValue("Id").ToString();
        XmlNode parentNode           = FindNode(docum, parentID);

        var     level   = Convert.ToInt32(parentNode.Attributes["Level"].Value) + 1;
        XmlNode newNode = docum.CreateElement("Level" + level + "Node");

        foreach (DictionaryEntry entry in e.NewValues)
        {
            newNode.Attributes.Append(GetNewAttribute(docum, entry.Key, entry.Value));
        }

        newNode.Attributes.Append(GetNewAttribute(docum, "Level", level));
        newNode.Attributes.Append(GetNewAttribute(docum, "ParentKey", parentID));

        parentNode.AppendChild(newNode);
        RearrangeAndSaveXml(docum);
    }
コード例 #11
0
        public void RemoveUnit(HostingUnit hostingUnit)
        {
            List <HostingUnit> lis = XmlDataSource.LoadFromXML <List <HostingUnit> >(HostingUnitPath);

            lis.RemoveAll(item => item.HostingUnitKey == hostingUnit.HostingUnitKey);
            XmlDataSource.SaveToXML <List <HostingUnit> >(lis, HostingUnitPath);
        }
コード例 #12
0
 public bool IsBookingAssociatedHostingUnit(long key)
 {
     return(XmlDataSource.LoadFromXML <List <Order> >(XO.OrderPath)
            .Where(item => item.HostingUnitKey == key)
            .Select(item => GetGuestRequest(item.GuestRequestKey))
            .Any(item => item.Status == StatusCode.Open));
 }
コード例 #13
0
 public bool IsBookingAssociatedHostingUnit(long key)
 {
     return(XmlDataSource.LoadFromXML <List <Order> >(XO.OrderPath)
            .Where(item => item.HostingUnitKey == key)
            .Select(item => GetClientRequest(item.GuestRequestKey))
            .Any(item => item.StatusRequest == Request_Status.Active));
 }
コード例 #14
0
ファイル: AktaSpraw.aspx.cs プロジェクト: radtek/eSoda
        void LoadBriefcase(int briefcaseId)
        {
            Session["idTeczki"] = briefcaseId;

            XmlDataSource xdsh = new XmlDataSource();
            XmlDataSource xds  = new XmlDataSource();

            XmlReader xrh = new BriefcaseDAO().GetBriefcaseInfo(briefcaseId);
            XmlReader xr  = new BriefcaseDAO().GetCasesFromBriefcase(briefcaseId);

            naglowekTeczki.DataSource = null;
            listaSpraw.DataSource     = null;


            if (xrh.Read())
            {
                xdsh.Data                 = xrh.ReadOuterXml();
                xdsh.EnableCaching        = false;
                xdsh.XPath                = "/teczka";
                naglowekTeczki.DataSource = xdsh;
            }

            if (xr.Read())
            {
                xds.Data              = xr.ReadOuterXml();
                xds.EnableCaching     = false;
                xds.XPath             = "/sprawy/sprawa";
                listaSpraw.DataSource = xds;
            }

            briefcaseStatusMessage.Text       = (listaSpraw.DataSource == null) ? "Teczka jest pusta" : "";
            briefcaseHeaderStatusMessage.Text = (naglowekTeczki.DataSource == null) ? "Brak informacji o teczce" : "";
            naglowekTeczki.DataBind();
            listaSpraw.DataBind();
        }
コード例 #15
0
 protected void Page_Load(object sender, EventArgs e)
 {//Add Exception handilng try catch change by vishal 21-05-2012
     try
     {
         if (!IsPostBack)
         {
             MembershipUser User = Membership.GetUser();
             objOrganization = objOrganization.Get_Organization();
             int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
             if (userid != 0)
             {
                 objContact   = objContact.Get_By_id(userid);
                 lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
             }
         }
         XmlDataSource ds = new XmlDataSource();
         ds.EnableCaching     = false;
         ds.DataFile          = Server.MapPath("../Files/Admin.xml");
         TreeView1.DataSource = ds;
         TreeView1.DataBind();
     }
     catch (Exception ex)
     {
         string myScript;
         myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         return;
     }
 }
コード例 #16
0
ファイル: ManagePower.aspx.cs プロジェクト: paddy235/YCJN
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                xmlpath = Server.MapPath("EditMenu.xml");
                DownLoadXml(sender, e);//下载XML文件至指定路径
                treeMenuPower.Nodes.Clear();
                //新建个DataSource指向要绑定的文件
                XmlDataSource xds = new XmlDataSource();
                xds.DataFile = xmlpath;
                XmlDocument xmlDocument = xds.GetXmlDocument();
                //把根节点和treeView实例根节点群放进去递归
                BindXmlToTreeView(xmlDocument.DocumentElement, treeMenuPower.Nodes);
                if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "")
                {
                    string id       = Request.QueryString["id"].ToString();
                    string rolename = bl.GetRoleNameById(id, out errMsg).ToString();
                    this.lblRoleName.Text = rolename;

                    ShowTreeCheck(id, treeMenuPower.Nodes);
                }
                treeMenuPower.ExpandAll();
            }
            catch
            {
            }
        }
    }
コード例 #17
0
 private void CreateDataSource(string data)
 {
     _configurationDataSource = new XmlDataSource();
     _configurationDataSource.EnableCaching = false;
     _configurationDataSource.Data          = data;
     ViewState["SourceData"] = data;
 }
コード例 #18
0
        public void XmlDataSourceTest()
        {
            /* Create folder Test in DOCODO root folder, place >=2 documents in it,
             * create test.xml file in root folder with description of documents */

            XmlDataSource xml = new XmlDataSource("xml", "..\\..\\..\\..\\test.xml");

            xml.Reset();
            Task.Factory.StartNew <IIndexDocument>(() => { return(xml.Next(true)); }).ContinueWith((doc) =>
            {
                Assert.NotNull(doc.Result);
                Assert.IsAssignableFrom <IIndexDocument>(doc.Result);
                Assert.Equal("Dickens Charles. The Pickwick Papers - royallib.ru.txt", ((IIndexDocument)doc.Result).Name);
                int c = 0;
                foreach (IndexPage p in ((IIndexDocument)doc.Result))
                {
                    c++;
                }
                Assert.True(c > 10);
            }).Wait();
            Task.Factory.StartNew <IIndexDocument>(() => xml.Next(true)).ContinueWith((doc) =>
            {
                Assert.NotNull(doc.Result);
                Assert.IsAssignableFrom <IIndexDocument>(doc.Result);
                Assert.Equal("PDFSPEC.PDF", ((IIndexDocument)doc.Result).Name);
                int c = 0;
                foreach (IndexPage p in ((IIndexDocument)doc.Result))
                {
                    c++;
                }
                Assert.True(c > 10);
            }).Wait();

            Assert.Null(xml.Next(true));
        }
コード例 #19
0
ファイル: XmlDataSourceTest.cs プロジェクト: xdhukang/cuite
        public void SecondGenerationData()
        {
            // Act
            Hashtable data = XmlDataSource.GetDataBlock(typeof(XmlDataSourceTest), "XmlDataSource.xml", "dateofbirth");

            // Assert
            AssertDateOfBirth(data);
        }
コード例 #20
0
ファイル: XmlDataSourceTest.cs プロジェクト: xdhukang/cuite
        public void OverriddenData()
        {
            // Act
            Hashtable data = XmlDataSource.GetDataBlock(typeof(XmlDataSourceTest), "XmlDataSource.xml", "motorcyclewithsidecar");

            // Assert
            Assert.AreEqual("3", data["numberofwheels"]);
        }
コード例 #21
0
ファイル: XmlDataSourceTest.cs プロジェクト: xdhukang/cuite
        public void ThirdGenerationData()
        {
            // Act
            Hashtable data = XmlDataSource.GetDataBlock(typeof(XmlDataSourceTest), "XmlDataSource.xml", "currentaddress");

            // Assert
            AssertCurrentAddress(data);
        }
コード例 #22
0
ファイル: XmlDataSourceTest.cs プロジェクト: xdhukang/cuite
        public void FirstGenerationData()
        {
            // Act
            Hashtable data = XmlDataSource.GetDataBlock(typeof(XmlDataSourceTest), "XmlDataSource.xml", "name");

            // Assert
            AssertName(data);
        }
コード例 #23
0
        public bool DeleteHostingUnit(HostingUnit Dunit)
        {
            List <HostingUnit> lis = XmlDataSource.LoadFromXML <List <HostingUnit> >(HostingUnitPath);

            lis.RemoveAll(item => item.HostingUnitKey == Dunit.HostingUnitKey);
            XmlDataSource.SaveToXML <List <HostingUnit> >(lis, HostingUnitPath);
            return(true);
        }
コード例 #24
0
        private void bindXML()
        {
            DataSet       ds     = new DataSet();
            XmlDataSource source = Page.Master.FindControl("source") as XmlDataSource;

            ds.ReadXml(new XmlNodeReader(source.GetXmlDocument()));

            dt = ds.Tables[0];
        }
コード例 #25
0
ファイル: XmlDataSourceTests.cs プロジェクト: riyanhax/Maui
        public void GetSingleValue_MultipleCurrenciesAvailable()
        {
            ISingleDataSource <int> dataSource = new XmlDataSource <int>("SingleValue", myDataStore);

            var stock = TomEntityBuilder.CreateStockHandle("SanDisk", "US80004C1018", "Dollar");
            var value = dataSource.ForStock(stock);

            Assert.That(value, Is.EqualTo(456));
        }
コード例 #26
0
ファイル: XmlDataSourceTests.cs プロジェクト: bg0jr/Maui
        public void GetSingleValue_MultipleCurrenciesAvailable()
        {
            ISingleDataSource<int> dataSource = new XmlDataSource<int>( "SingleValue", myDataStore );

            var stock = TomEntityBuilder.CreateStockHandle( "SanDisk", "US80004C1018", "Dollar" );
            var value = dataSource.ForStock( stock );

            Assert.That( value, Is.EqualTo( 456 ) );
        }
 public XmlDataSourceConfigureDataSourceForm(IServiceProvider serviceProvider, XmlDataSource xmlDataSource) : base(serviceProvider)
 {
     this._xmlDataSource = xmlDataSource;
     this.InitializeComponent();
     this.InitializeUI();
     this.DataFile      = this._xmlDataSource.DataFile;
     this.TransformFile = this._xmlDataSource.TransformFile;
     this.XPath         = this._xmlDataSource.XPath;
 }
 public void Bind_Tree()
 {
     XmlDataSource ds = new XmlDataSource();
     ds.EnableCaching = false;
     string path = Server.MapPath("..//Files//Asset.xml");
     ds.DataFile = path;
     Treeview1.DataSource = ds;
     Treeview1.DataBind();
 }
コード例 #29
0
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
 {
     XmlDataSource3.DataFile = "~/XML/" + DropDownList1.SelectedValue + "_feed.xml";
     XmlDataSource5.DataFile = "~/XML/" + DropDownList1.SelectedValue + "_feed.xml";
     XmlDataSource6.DataFile = "~/XML/" + DropDownList1.SelectedValue + "_feed.xml";
     a = XmlDataSource6;
     XmlDocument xdoc     = XmlDataSource6.GetXmlDocument();
     XmlNodeList elemList = xdoc.GetElementsByTagName("channel");
     //System.Diagnostics.Debug.WriteLine(elemList[0].Attributes["category"].Value);
 }
コード例 #30
0
        public void CacheKeyContext()
        {
            var xds = new XmlDataSource();

            Assert.AreEqual(String.Empty, xds.CacheKeyContext, "#A1");
            xds.CacheKeyContext = null;
            Assert.AreEqual(String.Empty, xds.CacheKeyContext, "#A2");
            xds.CacheKeyContext = "MyKey";
            Assert.AreEqual("MyKey", xds.CacheKeyContext, "#A1");
        }
コード例 #31
0
        public HostingUnit GetHostingUnit(int HKey)
        {
            HostingUnit hosting = XmlDataSource.LoadFromXML <List <HostingUnit> >(HostingUnitPath).Where(item => item.HostingUnitKey == HKey).FirstOrDefault();

            if (hosting == null)
            {
                throw new Exception("Unit with Key [" + HKey + "] does not exist");
            }
            return(hosting.Clone());
        }
コード例 #32
0
        public long AddUnit(HostingUnit hostingUnit)
        {
            HostingUnit hostingUnitCopy = (HostingUnit)hostingUnit.Clone();

            hostingUnitCopy.HostingUnitKey = XC.GetConfiguration <long>("HostUnitKey");
            DataSource.HostingUnitsCollection.Add(hostingUnitCopy);
            XmlDataSource.SaveToXML <List <HostingUnit> >(DataSource.HostingUnitsCollection, HostingUnitPath);
            XC.UpdateConfiguration <long>("HostUnitKey", (hostingUnitCopy.HostingUnitKey + 1));
            return(hostingUnitCopy.HostingUnitKey);
            //XH.AddUnit(hostingUnit);
        }
コード例 #33
0
    public void Bind_Tree()
    {
        XmlDataSource ds = new XmlDataSource();

        ds.EnableCaching = false;
        string path = Server.MapPath("..//Files//Asset.xml");

        ds.DataFile          = path;
        Treeview1.DataSource = ds;
        Treeview1.DataBind();
    }
コード例 #34
0
        public void InitMenuDataSource(SiteMapMenus menu, string siteMapPath)
        {
            XmlDataSource menuData = new XmlDataSource();

            menuData.EnableCaching = false;
            menuData.XPath         = "siteMap/siteMapNode";
            menuData.DataFile      = GetMapPath(menu, siteMapPath);
            menuData.DataBind();
            menuRepeater.DataSource = menuData;
            menuRepeater.DataBind();
        }
コード例 #35
0
ファイル: XmlDataSourceTests.cs プロジェクト: bg0jr/Maui
        public void GetPrices()
        {
            IEnumerableDataSource<SimplePrice> dataSource = new XmlDataSource<SimplePrice>( "Prices", myDataStore );

            var stock = TomEntityBuilder.CreateStockHandle( "SanDisk", "US80004C1018", "Dollar" );
            var prices = new TimedValueSet<DateTime, double>( dataSource.ForStock( stock ) );

            Assert.That( prices[ new DateTime( 2010, 12, 13 ) ].Value, Is.EqualTo( 4.63 ) );
            Assert.That( prices[ new DateTime( 2010, 12, 12 ) ].Value, Is.EqualTo( 4.53 ) );
            Assert.That( prices[ new DateTime( 2010, 12, 11 ) ].Value, Is.EqualTo( 4.43 ) );
            Assert.That( prices[ new DateTime( 2010, 12, 10 ) ].Value, Is.EqualTo( 4.33 ) );
        }
    //private void BindRepeater()
    //{
    //    string[] letters = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K",
    //                 "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
    //                 "W", "X", "Y", "Z","0-9"};
    //    DataTable dt = new DataTable();
    //    dt.Columns.Add("Name");
    //    char c = 'A';
    //    //    while (Strings.Asc(c) <= Strings.Asc("Z"))
    //    for (int i = 0; i < letters.Length; i++)
    //    {
    //        DataRow dr = dt.NewRow();
    //        dr[0] = letters[i];
    //        dt.Rows.Add(dr);
    //    }
    //    this.rptAlfha.DataSource = dt;
    //    this.rptAlfha.DataBind();
    //}
    public void Bind_Tree()
    {
        XmlDataSource ds = new XmlDataSource();
        ds.EnableCaching = false;
        //string path = Server.MapPath("..//Files//Network.xml");
        //ds.DataFile = path;
        DataSet ds1 = new DataSet();
        ds1.ReadXml(Server.MapPath("..//Files//Network.xml"));

        DataTable dt1 = ds1.Tables[0];

        dlSecondAplfha.DataSource = dt1;

        dlSecondAplfha.DataBind();
    }
コード例 #37
0
ファイル: Default.aspx.cs プロジェクト: mono/gert
	protected void Page_Load (object sender, EventArgs e)
	{
		XmlDataSource xmlds = new XmlDataSource ();

		xmlds.DataFile = "./dialogbeispiel.xml";
		XmlDocument xmldoc = xmlds.GetXmlDocument ();
		XmlNodeList xmlnl = xmldoc.GetElementsByTagName ("button");

		foreach (XmlNode node in xmlnl) {
			Button tmp = new Button ();
			tmp.Text = node.FirstChild.InnerText;
			tmp.ID = node.ChildNodes [1].InnerText;
			PlaceHolder1.Controls.Add (tmp);
		}
	}
コード例 #38
0
    /// <summary>
    /// tab menu items from xml file
    /// </summary>
    protected void bind_tabs()
    {
        string _path = AppDomain.CurrentDomain.BaseDirectory;
        _path += "xml\\form_menus.xml";

        XmlDataSource _xml = new XmlDataSource();
        _xml.DataFile = _path;
        _xml.XPath = "//menuitem[@AppliesTo='Order']"; //you need this or tab will not databind!
        _xml.DataBind();
        //Run time population of GridViewDataComboBoxColumn column with data
        //DevExpress.Web.ASPxTabControl.ASPxTabControl _tab = (DevExpress.Web.ASPxTabControl.ASPxTabControl)this.FindControl("dxtabOrder");
        this.dxtabOrder.DataSource = _xml;
        this.dxtabOrder.DataBind();

    }
コード例 #39
0
ファイル: Menu.ascx.cs プロジェクト: danygolden/gianfratti
 /// <summary>
 /// Carrega os itens do menu conforme perfil logado
 /// </summary>
 /// <param name="menu"></param>
 /// <param name="serverMapPath"></param>
 /// <returns></returns>
 XmlDataSource GetMenuDataSource(string menu, string serverMapPath)
 {
     XmlDataSource objData = new XmlDataSource();
     objData.XPath = "siteMap/siteMapNode";
     switch (menu)
     {
         case "Administrador": //Caso seja o analista de credito carrega o perfil setado no xml
             objData.DataFile = serverMapPath + @"\App_Data\Administrador.sitemap";
             break;
         default:
             break;
     }
     objData.DataBind();
     return objData;
 }
コード例 #40
0
ファイル: Menu.ascx.cs プロジェクト: danygolden/gianfratti
 XmlDataSource GetMenuDataSource(string menu, string serverMapPath)
 {
     XmlDataSource objData = new XmlDataSource();
     objData.XPath = "siteMap/siteMapNode";
     switch (menu)
     {
         case "Empresa":
             objData.DataFile = serverMapPath + @"\App_Data\Empresa.sitemap";
             break;
         case "Cliente":
             objData.DataFile = serverMapPath + @"\App_Data\Cliente.sitemap";
             break;
         default:
             break;
     }
     objData.DataBind();
     return objData;
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MembershipUser User = Membership.GetUser();
            objOrganization = objOrganization.Get_Organization();
            int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
            if (userid != 0)
            {
                objContact = objContact.Get_By_id(userid);
                lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;

            }
        }
        XmlDataSource ds = new XmlDataSource();
        ds.EnableCaching = false;
        ds.DataFile = Server.MapPath("../Files/Admin.xml");
        TreeView1.DataSource = ds;
        TreeView1.DataBind();
    }
コード例 #42
0
    /// <summary>
    /// command menu 
    /// </summary>
    protected void bind_formview_commands()
    {
        string _path = AppDomain.CurrentDomain.BaseDirectory;
        _path += "xml\\order_commands.xml";

        XmlDataSource _xml = new XmlDataSource();
        _xml.DataFile = _path;

        _xml.XPath = "//item[@Filter='GenericFormView']"; //you need this or tab will not databind!
        _xml.DataBind();
        //Run time population of GridViewDataComboBoxColumn column with data

        //DevExpress.Web.ASPxMenu.ASPxMenu _mnu = (DevExpress.Web.ASPxMenu.ASPxMenu)this.FindControl("dxmnuCommand");
        //if (_mnu != null)
        //{
        //    _mnu.DataSource = _xml;
        //    _mnu.DataBind();
        //}
        this.dxmnuFormView.DataSource = _xml;
        this.dxmnuFormView.DataBind();

    }
コード例 #43
0
ファイル: Menu.ascx.cs プロジェクト: danygolden/gianfratti
 /// <summary>
 /// Carrega os itens do menu conforme perfil logado
 /// </summary>
 /// <param name="menu"></param>
 /// <param name="serverMapPath"></param>
 /// <returns></returns>
 XmlDataSource GetMenuDataSource(string menu, string serverMapPath)
 {
     XmlDataSource objData = new XmlDataSource();
     objData.XPath = "siteMap/siteMapNode";
     switch (menu)
     {
         case "Administrador": //Caso seja o perfil Administrador carrega o perfil setado no xml
             objData.DataFile = serverMapPath + @"\App_Data\Administrador.sitemap";
             break;
         case "Fisioterapeuta": //Caso seja o perfil Fisioterapeuta carrega o perfil setado no xml
             objData.DataFile = serverMapPath + @"\App_Data\Fisioterapeuta.sitemap";
             break;
         case "Recepcionista": //Caso seja o perfil Fisioterapeuta carrega o perfil setado no xml
             objData.DataFile = serverMapPath + @"\App_Data\Recepcionista.sitemap";
             break;
         case "Financeiro": //Caso seja o perfil Fisioterapeuta carrega o perfil setado no xml
             objData.DataFile = serverMapPath + @"\App_Data\Financeiro.sitemap";
             break;
         default:
             break;
     }
     objData.DataBind();
     return objData;
 }
コード例 #44
0
    /// <summary>
    /// allocate order to container menu 
    /// </summary>
    protected void bind_order_commands()
    {
        string _path = AppDomain.CurrentDomain.BaseDirectory;
        _path += "xml\\order_commands.xml";

        XmlDataSource _xml = new XmlDataSource();
        _xml.DataFile = _path;
        //these commands moved to bind_container_commands so this menu is not needed
        _xml.XPath = "//item[@Filter='Container']"; //you need this or tab will not databind! "//item[@Filter='NoCommands']";
        _xml.DataBind();
        //Run time population of GridViewDataComboBoxColumn column with data

        //DevExpress.Web.ASPxMenu.ASPxMenu _mnu = (DevExpress.Web.ASPxMenu.ASPxMenu)this.FindControl("dxmnuCommand");
        //if (_mnu != null)
        //{
        //    _mnu.DataSource = _xml;
        //    _mnu.DataBind();
        //}
        this.dxmnuOrder.DataSource = _xml;
        this.dxmnuOrder.DataBind();

    }
コード例 #45
0
 public DataAgent(AppValueProvider valueProvider)
 {
     this.source = new XmlDataSource<ItemsDb>();
     this.appValueProvider = valueProvider;
 }
コード例 #46
0
 // Constructors
 public XmlDataSourceView(XmlDataSource owner, string name)
 {
 }
コード例 #47
0
    /* Page Load */
    protected void Page_Load(object sender, EventArgs e)
    {
        //��ȡҳ���ҳ����
        BasePage owner = (BasePage)Page;

        XmlDataSource xmlDataSource = new XmlDataSource();
        xmlDataSource.ID = Guid.NewGuid().ToString();
        xmlDataSource.Data = (Session["ESB_MENU"] as XmlDocument).OuterXml;
        xmlDataSource.XPath = "//DemoGroup";
        xmlDataSource.DataBind();

        //�˵���
        nbMenu.DataSource = xmlDataSource;
        nbMenu.DataBind();

        /* Title Image */
        iTitleImage.ImageUrl = TitleImageUrl;
        iTitleImage.AlternateText = GroupName + "" + Name;

        if (String.IsNullOrEmpty(TitleImageUrl)) {
            lGroupName.Style.Add(HtmlTextWriterStyle.MarginLeft, "11px");
            iTitleImage.Visible = false;
            iTitleImage.EnableViewState = false;
        }

        // Header
        string currentUrl = Request.AppRelativeCurrentExecutionFilePath.ToLower();
        if (IsHomePage || Logotype.NavigateUrl.ToLower() == currentUrl)
            Logotype.NavigateUrl = "";

        // Logotype
        Logotype.ImageUrl = "~/App_Themes/" + Page.Theme + "/Demo/LogoESB.png";

        //UserName
        String userName = owner.AuthUser.UserName;
        if (owner.AuthUser.IsVisitor)
            userName += "-�ÿ�";

        lblUserName.Text = "��" + userName + "���ѵ�½";

        if (phOnceContent.Controls.Count != 0)
            tdFooter.Style.Add(HtmlTextWriterStyle.PaddingLeft, "37px");

        if (!String.IsNullOrEmpty(Title))
            Page.Header.Title = Title + Page.Header.Title;

        if (phContent.Controls.Count == 0) {
            phContent.Visible = false;
            phContent.EnableViewState = false;
            tblTitle.Visible = false;
            tblTitle.EnableViewState = false;
            tblHeader.Visible = false;
            tblHeader.EnableViewState = false;
            tblFooter.Visible = false;
            tblFooter.EnableViewState = false;
            tblContent.Visible = false;
            tblContent.EnableViewState = false;
        }

        if (phOnceContent.Controls.Count == 0) {
            phOnceContent.Visible = false;
            phOnceContent.EnableViewState = false;
        }
        // general terms
        if (!string.IsNullOrEmpty(GeneralTerms)) {
            lGeneralTerms.Visible = true;
            lGeneralTerms.Text = GeneralTerms;
            //pDescription.Controls.Add(new LiteralControl(demoMaster.Description));
        }

        // Title
        lGroupName.Text = Name;// GroupName;
        //lName.Text = Name;
        if (string.IsNullOrEmpty(lName.Text)) {
            hName.Visible = false;
            hName.EnableViewState = false;
        }
    }
コード例 #48
0
ファイル: ManageMenu.aspx.cs プロジェクト: eseawind/YCJN
 //加载XML文件
 protected void LoadXml(string xmlPathS)
 {
     TreeView1.Nodes.Clear();
     //xmlpath = FileUpload1.PostedFile.FileName.ToString();
     xmlpath = xmlPathS;
     Session.Contents["xmlpath"] = xmlpath;
     XmlDataSource xds = new XmlDataSource();
     xds.DataFile = xmlpath;
     XmlDocument xmlDocument = xds.GetXmlDocument();
     BindXmlToTreeView(xmlDocument.DocumentElement, TreeView1.Nodes);
     TreeView1.ExpandAll();
 }
コード例 #49
0
ファイル: ManageMenu.aspx.cs プロジェクト: eseawind/YCJN
    protected void Page_Load(object sender, EventArgs e)
    {
        string param = Request["param"];
        if (param != "")
        {
            if (param == "Add")
            {
                string id = Request.Form["id"];
                string name = Request.Form["name"];
                string src = Request.Form["src"];
                string vis = Request.Form["vis"];
                string dep = Request.Form["dep"];
                BtnAdd_Click(sender,e);
            }
        }
        if (!IsPostBack)
        {

        }
        if (!Page.IsPostBack)
        {
            xmlpath = Server.MapPath("EditMenu.xml");
            DownLoadXml(sender, e);//下载XML文件至指定路径
            TreeView1.Nodes.Clear();
            //Session.Contents["xmlpath"] = xmlpath;
            XmlDataSource xds = new XmlDataSource();
            xds.DataFile = xmlpath;
            XmlDocument xmlDocument = xds.GetXmlDocument();
            BindXmlToTreeView(xmlDocument.DocumentElement, TreeView1.Nodes);
            TreeView1.ExpandAll();
        }
    }
コード例 #50
0
ファイル: ManagePower.aspx.cs プロジェクト: eseawind/YCJN
    //加载XML文件
    protected void LoadXml(string xmlPathS)
    {
        treeMenuPower.Nodes.Clear();
        //xmlpath = FileUpload1.PostedFile.FileName.ToString();
        xmlpath = xmlPathS;
        Session.Contents["xmlpath"] = xmlpath;
        XmlDataSource xds = new XmlDataSource();
        xds.DataFile = xmlpath;
        XmlDocument xmlDocument = xds.GetXmlDocument();
        //把根节点的东东和treeView实例根节点群丢进去递归
        BindXmlToTreeView(xmlDocument.DocumentElement, treeMenuPower.Nodes);
        if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "")
        {
            string id = Request.QueryString["id"].ToString();
            string rolename = id;
            this.lblRoleName.Text = rolename;

            ShowTreeCheck(rolename, treeMenuPower.Nodes);
        }
        treeMenuPower.ExpandAll();
    }
コード例 #51
0
ファイル: ManagePower.aspx.cs プロジェクト: eseawind/YCJN
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                xmlpath = Server.MapPath("EditMenu.xml");
                DownLoadXml(sender, e);//下载XML文件至指定路径
                treeMenuPower.Nodes.Clear();
                //新建个DataSource指向要绑定的文件
                XmlDataSource xds = new XmlDataSource();
                xds.DataFile = xmlpath;
                XmlDocument xmlDocument = xds.GetXmlDocument();
                //把根节点和treeView实例根节点群放进去递归
                BindXmlToTreeView(xmlDocument.DocumentElement, treeMenuPower.Nodes);
                if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "")
                {
                    string id = Request.QueryString["id"].ToString();
                    string rolename = bl.GetRoleNameById(id,out errMsg).ToString();
                    this.lblRoleName.Text = rolename;

                    ShowTreeCheck(id, treeMenuPower.Nodes);
                }
                treeMenuPower.ExpandAll();
            }
            catch
            {

            }
        }
    }
コード例 #52
0
    /// <summary>
    /// tab menu 
    /// </summary>
    protected void bind_tabs(string mode)
    {
        string _path = AppDomain.CurrentDomain.BaseDirectory;
        _path += "xml\\form_menus.xml";

        XmlDataSource _xml = new XmlDataSource();
        _xml.DataFile = _path;
        //080814 for Insert mode just display Order detials tab (Titles must be added to a new order)  
        _xml.XPath = string.Format("//menuitem[@AppliesTo='{0}Order']", mode == "Insert"? "Insert": ""); //you need this or tab will not databind!
        //_xml.XPath = "//menuitem[@AppliesTo='Order']"; //you need this or tab will not databind!
        _xml.DataBind(); 
        //Run time population of GridViewDataComboBoxColumn column with data
        //DevExpress.Web.ASPxTabControl.ASPxTabControl _tab = (DevExpress.Web.ASPxTabControl.ASPxTabControl)this.FindControl("dxtabOrder");
        this.dxtabOrder.DataSource = _xml;
        this.dxtabOrder.DataBind(); 
        
    }