public static int Update(Record obj)
        {
            if (Settings.DataProvider == DataProviderType.SqlServer)
            {
                int ret = 0;

                using (SqlConnection connection = new SqlConnection(DBConnector.GetBuilder().ConnectionString))
                {
                    connection.Open();

                    SqlCommand command = new SqlCommand(SQL_UPDATE, connection);
                    command.Parameters.AddWithValue("@PaidDate", obj.PaidDate);
                    command.Parameters.AddWithValue("@ID", obj.ID);

                    ret = command.ExecuteNonQuery();
                }
                return(ret);
            }
            else
            {
                xmlDoc.Load(filePath);
                XmlNode     root = xmlDoc.DocumentElement;
                XmlNodeList list = root.SelectNodes("Record");

                XmlNode objNode = null;

                foreach (XmlNode node in list)
                {
                    XmlNodeList childs = node.ChildNodes;

                    foreach (XmlNode child in childs)
                    {
                        if (child.Name == "ID" && child.InnerText == obj.ID.ToString())
                        {
                            objNode = node;
                            Console.WriteLine(objNode.InnerXml);
                            break;
                        }
                    }

                    if (objNode != null)
                    {
                        break;
                    }
                }

                foreach (XmlNode child in objNode.ChildNodes)
                {
                    if (child.Name == "Ammount")
                    {
                        child.InnerText = obj.Ammount.ToString();
                    }
                    if (child.Name == "PointsTaken")
                    {
                        child.InnerText = obj.PointsTaken.ToString();
                    }
                    if (child.Name == "DateOfEntry")
                    {
                        child.InnerText = obj.DateOfEntry.ToString();
                    }
                    if (child.Name == "ExpireDate")
                    {
                        child.InnerText = obj.ExpireDate.ToString();
                    }
                    if (child.Name == "PaidDate")
                    {
                        child.InnerText = obj.PaidDate.ToString();
                    }
                    if (child.Name == "driverID")
                    {
                        child.InnerText = obj.driverID.ToString();
                    }
                    if (child.Name == "employeeID")
                    {
                        child.InnerText = obj.employeeID.ToString();
                    }
                    if (child.Name == "fineTypeID")
                    {
                        child.InnerText = obj.fineTypeID.ToString();
                    }
                }

                XMLSaveDocument();

                return(1);
            }
        }
        public static int Save(Record obj)
        {
            if (Settings.DataProvider == DataProviderType.SqlServer)
            {
                int recordID = -1;
                using (SqlConnection connection = new SqlConnection(DBConnector.GetBuilder().ConnectionString))
                {
                    connection.Open();

                    using (SqlCommand command = new SqlCommand(SQL_INSERT, connection))
                    {
                        command.Parameters.AddWithValue("@Ammount", obj.Ammount);
                        command.Parameters.AddWithValue("@PointsTaken", obj.PointsTaken);
                        command.Parameters.AddWithValue("@DateOfEntry", obj.DateOfEntry);
                        command.Parameters.AddWithValue("@ExpireDate", obj.ExpireDate);
                        if (obj.PaidDate == null)
                        {
                            command.Parameters.AddWithValue("@PaidDate", DBNull.Value);
                        }
                        else
                        {
                            command.Parameters.AddWithValue("@PaidDate", obj.PaidDate);
                        }
                        command.Parameters.AddWithValue("@driverID", obj.driverID);
                        command.Parameters.AddWithValue("@employeeID", obj.employeeID);
                        command.Parameters.AddWithValue("@fineTypeID", obj.fineTypeID);
                        recordID = (int)command.ExecuteScalar();
                    }
                }

                return(recordID);
            }
            else
            {
                XmlElement root = xmlDoc.DocumentElement;
                XmlElement elem = xmlDoc.CreateElement("Record");

                XmlElement id = xmlDoc.CreateElement("ID");
                id.InnerText = freeID.ToString();
                obj.ID       = freeID;
                freeID       = freeID + 1;
                elem.AppendChild(id);

                XmlElement Ammount = xmlDoc.CreateElement("Ammount");
                Ammount.InnerText = obj.Ammount.ToString();
                elem.AppendChild(Ammount);

                XmlElement PointsTaken = xmlDoc.CreateElement("PointsTaken");
                PointsTaken.InnerText = obj.PointsTaken.ToString();
                elem.AppendChild(PointsTaken);

                XmlElement DateOfEntry = xmlDoc.CreateElement("DateOfEntry");
                DateOfEntry.InnerText = obj.DateOfEntry.ToString();
                elem.AppendChild(DateOfEntry);

                XmlElement ExpireDate = xmlDoc.CreateElement("ExpireDate");
                ExpireDate.InnerText = obj.ExpireDate.ToString();
                elem.AppendChild(ExpireDate);

                XmlElement PaidDate = xmlDoc.CreateElement("PaidDate");
                PaidDate.InnerText = obj.PaidDate.ToString();
                elem.AppendChild(PaidDate);

                XmlElement driverID = xmlDoc.CreateElement("driverID");
                driverID.InnerText = obj.driverID.ToString();
                elem.AppendChild(driverID);

                XmlElement employeeID = xmlDoc.CreateElement("employeeID");
                employeeID.InnerText = obj.employeeID.ToString();
                elem.AppendChild(employeeID);

                XmlElement fineTypeID = xmlDoc.CreateElement("fineTypeID");
                fineTypeID.InnerText = obj.fineTypeID.ToString();
                elem.AppendChild(fineTypeID);

                root.AppendChild(elem);
                XMLSaveDocument();

                return(1);
            }
        }