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 Form12MonitorAdd(DS_NiheComputers DS, DialogMonitorAdd Dialog) { this.DS = DS; this.Dialog = Dialog; InitializeComponent(); Init(); }
void Monitor_MonitorAddEvent(object sender, DialogMonitorAdd Dialog) { Form12MonitorAdd F = new Form12MonitorAdd(C1.DS, Dialog); F.ShowDialog(); }