Click here to Skip to main content
15,885,278 members
Articles / Web Development / HTML

Light Speed Inline Editing Using ASP.NET AJAX and Web Services(Architecture and Customization) - Part II

Rate me:
Please Sign up or sign in to vote.
4.94/5 (15 votes)
1 Nov 2007CPOL7 min read 69.1K   1.3K   73  
JavaScript+AJAX solution for inline editing in grid.
using System.IO;
using System.Web;
using System.Xml;

namespace TargetProcess.DaoTraining.DataAccessLayer.XmlRepository
{
	public class XmlDaoFactory : DaoFactory
	{
		public static string PathToCustomersFile
		{
			get
			{
				string pathToFile = HttpContext.Current.Server.MapPath("App_Data/XmlRepository/Customers.xml");
				if (!File.Exists(pathToFile))
				{
					XmlDocument xmlDoc = new XmlDocument();
					xmlDoc.LoadXml("<Customers LastGeneratedId=\"0\" />");
					xmlDoc.Save(pathToFile);
				}
				return pathToFile;
			}
		}

		public static string PathToOrdersFile
		{
			get
			{
				string pathToFile = HttpContext.Current.Server.MapPath("App_Data/XmlRepository/Orders.xml");
				if (!File.Exists(pathToFile))
				{
					XmlDocument xmlDoc = new XmlDocument();
					xmlDoc.LoadXml("<Orders LastGeneratedId=\"0\" />");
					xmlDoc.Save(pathToFile);
				}
				return pathToFile;
			}
		}

		public override CustomerDao GetCustomerDao()
		{
			return new XmlCustomerDao();
		}

		public override OrderDao GetOrderDao()
		{
			return new XmlOrderDao();
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Belarus Belarus
Andrew Golik is a software professional working in Minsk, Belarus.
He enjoys design infrastructures based on object oriented paradigm. His programming experience includes ASP, ASP.NET, .NET, COM, JAVA, PHP, DHTML, AJAX, blah blah blah....

Andrew Golik's Blog

Comments and Discussions