public void add_Car_fault(BE.Car_Fault cf) { if (this.return_list(retur.car_fault).Contains(cf)) { throw new Exception("הקשר בין התקלה לרכב כבר קיים"); } xml_control.Car_Fault_Root.Add(cf.ToXml()); xml_control.Car_Fault_Root.Save(xml_control.Car_Fault_Path); }
public void Del_car_fault(BE.Car_Fault temp) { try { (from item in xml_control.Car_Fault_Root.Elements() where item.Element("car_number").Value == temp.id.ToString() && item.Element("fault_number").Value == temp.fault_number.ToString() select item).Remove(); xml_control.Car_Fault_Root.Save(xml_control.Car_Fault_Path); } catch (Exception e) { throw new Exception(e.Message); } }
public Car_Fault(Car_Fault temp) { id = temp.id; fault_number = temp.fault_number; date = temp.date; }