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(); }
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; }
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 + " " + 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; } }
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(); }
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(); //} }
/// <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); }
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); } } }
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); }
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); }
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)); }
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)); }
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(); }
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 + " " + 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; } }
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 { } } }
private void CreateDataSource(string data) { _configurationDataSource = new XmlDataSource(); _configurationDataSource.EnableCaching = false; _configurationDataSource.Data = data; ViewState["SourceData"] = data; }
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)); }
public void SecondGenerationData() { // Act Hashtable data = XmlDataSource.GetDataBlock(typeof(XmlDataSourceTest), "XmlDataSource.xml", "dateofbirth"); // Assert AssertDateOfBirth(data); }
public void OverriddenData() { // Act Hashtable data = XmlDataSource.GetDataBlock(typeof(XmlDataSourceTest), "XmlDataSource.xml", "motorcyclewithsidecar"); // Assert Assert.AreEqual("3", data["numberofwheels"]); }
public void ThirdGenerationData() { // Act Hashtable data = XmlDataSource.GetDataBlock(typeof(XmlDataSourceTest), "XmlDataSource.xml", "currentaddress"); // Assert AssertCurrentAddress(data); }
public void FirstGenerationData() { // Act Hashtable data = XmlDataSource.GetDataBlock(typeof(XmlDataSourceTest), "XmlDataSource.xml", "name"); // Assert AssertName(data); }
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); }
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]; }
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 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(); }
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); }
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"); }
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()); }
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); }
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(); }
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(); }
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); } }
/// <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(); }
/// <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; }
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 + " " + objContact.Lastname; } } XmlDataSource ds = new XmlDataSource(); ds.EnableCaching = false; ds.DataFile = Server.MapPath("../Files/Admin.xml"); TreeView1.DataSource = ds; TreeView1.DataBind(); }
/// <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(); }
/// <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; }
/// <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(); }
public DataAgent(AppValueProvider valueProvider) { this.source = new XmlDataSource<ItemsDb>(); this.appValueProvider = valueProvider; }
// Constructors public XmlDataSourceView(XmlDataSource owner, string name) { }
/* 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; } }
//加载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(); }
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(); } }
//加载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(); }
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 { } } }
/// <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(); }