Beispiel #1
0
        public DataSet GetTodoList()
        {
            dataSet.Clear();
            dataSet.ReadXml(ConfigurationClass.ReadSetting("TodoXMLFilePath"));
            DataTable table = dataSet.Tables[0];

            return(dataSet);
        }
Beispiel #2
0
        public int AddTodoListItem()
        {
            DataSet ds     = this.GetTodoList();
            DataRow newRow = ds.Tables[0].NewRow();

            newRow["Title"] = "Place New Todo Title Here";
            newRow["Text"]  = "Place New Todo Text Here";
            ds.Tables[0].Rows.Add(newRow);
            ds.WriteXml(ConfigurationClass.ReadSetting("TodoXMLFilePath"));
            return(ds.Tables[0].Rows.Count - 1);
        }
Beispiel #3
0
        public void UPDATEListItem()
        {
            DataSet ds = this.GetTodoList();

            foreach (DataTable table in ds.Tables)
            {
                foreach (DataRow row in table.Rows)
                {
                    foreach (DataColumn column in table.Columns)
                    {
                        row[column] = 100.000;
                    }
                }
            }
            ds.WriteXml(ConfigurationClass.ReadSetting("TodoXMLFilePath"));
        }
Beispiel #4
0
        public bool RemoveTodoListItem(int recordID)
        {
            bool removeSuccessful = false;

            DataSet ds  = this.GetTodoList();
            DataRow row = ds.Tables[0].Rows[recordID];

            try
            {
                row.Delete();
                removeSuccessful = true;
            }
            catch (Exception e)
            {
                throw new ApplicationException("Error Deleting Todo Item: " + e.Message + "\n" +
                                               e.StackTrace);
            }
            ds.WriteXml(ConfigurationClass.ReadSetting("TodoXMLFilePath"));

            return(removeSuccessful);
        }
Beispiel #5
0
 public void UpdateXMLDoc(DataSet newTodoListDataSet)
 {
     newTodoListDataSet.WriteXml(ConfigurationClass.ReadSetting("TodoXMLFilePath"));
 }
Beispiel #6
0
 public YPosition()
 {
     _DYAttri   = new Dictionary <string, YAttri>();
     xmlOperate = new XmlOperate(ConfigurationClass.ReadSetting("xmlyPosition"));
 }
Beispiel #7
0
 public XPosition()
 {
     _DTwoXAttri = new Dictionary <string, TwoXAttri>();
     xmlOperate  = new XmlOperate(ConfigurationClass.ReadSetting("xmlxPosition"));
 }
Beispiel #8
0
 public ZPostionModel()
 {
     _DSixZAttri = new Dictionary <string, SixZAttri>();
     _LSixZAttri = new List <SixZAttri>();
     xmlOperate  = new XmlOperate(ConfigurationClass.ReadSetting("xmlzPotion"));
 }
Beispiel #9
0
 public ZCompensation()
 {
     _DSixZAttri = new Dictionary <string, SixZAttri>();
     _LSixZAttri = new List <SixZAttri>();
     xmlOperate  = new XmlOperate(ConfigurationClass.ReadSetting("xmlzComp"));
 }