public void Add() { DS_NiheComputers.MonitorRow mr = null; if (MonitorAddEvent != null) { DialogMonitorAdd D = new DialogMonitorAdd(); MonitorAddEvent(this, D); if (D.Changed) { mr = DS.Monitor.NewMonitorRow(); mr.DepartmentID = D.DepartmentID; mr.MonitorModelID = D.MonitorModelID; mr.GUID = Guid.NewGuid().ToString(); mr.Number = D.Number; mr.Room = D.Room; mr.Deleted = false; mr.PurchaseDate = D.PurchaseDate; mr.WarantyDate = D.PurchaseDate.AddYears((int)D.WarantyDate); DS.Monitor.AddMonitorRow(mr); DS_NiheComputers.MonitorEventRow mer = DS.MonitorEvent.NewMonitorEventRow(); mer.MonitorGUID = mr.GUID; mer.Date = D.PurchaseDate; mer.ExtendedInfo = D.ExtendedInfo; //mer.MonitorText = Dialog. mer.Info = "Покупка монитора"; mer.EventName = "Создание монитора"; DS.MonitorEvent.AddMonitorEventRow(mer); DS.AcceptChanges(); } D = null; } }
public void Write() { DS_NiheComputers.MonitorEventRow mer = DS.MonitorEvent.NewMonitorEventRow(); mer.MonitorGUID = GUID; mer.Date = Date; mer.ExtendedInfo = ExtendedInfo; mer.Info = Info; mer.EventName = EventName; DS.MonitorEvent.AddMonitorEventRow(mer); }