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

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