/// <summary> /// просморт/экспорт /// </summary> /// <param name="fName"></param> /// <param name="vr"></param> /// <param name="DT"></param> /// <param name="dpz"></param> /// <param name="fr"></param> /// <param name="objective"></param> public ShowEvents(string fName, byte[] vr, DateTime DT, Diapazon dpz, MainForm fr, ShowEventsObjective objective) { InitializeComponent(); FileName = fName; Date = DT; //WorkDir = WDir; Array.Copy(vr, vers, 4); // заголовок switch (dpz) { case Diapazon.Day: // день lblCaption.Text = DT.ToShortDateString(); ShowOneDay = true; lblDate.Visible = false; break; case Diapazon.Month: // месяц lblCaption.Text = month[DT.Month] + " " + DT.Year.ToString(); ShowOneDay = false; lblDate.Visible = true; break; default: // все события lblCaption.Text = "Список всех событий"; ShowOneDay = false; lblDate.Visible = true; break; } //pnlMain.Dispose(); //panel4.Dispose(); MnFrm = fr; obj = objective; switch (objective) { case ShowEventsObjective.toExport: btnExpImpAdd.Text = "Экспорт"; btnExpImpAdd.Click += new EventHandler(btnExp_Click); btnDelete.Visible = false; btnEdit.Visible = false; break; case ShowEventsObjective.toImport: btnExpImpAdd.Text = "Импорт"; btnExpImpAdd.Click += new EventHandler(btnImp_Click); btnDelete.Visible = false; btnEdit.Visible = false; break; default: btnExpImpAdd.Click += new EventHandler(btnAdd_Click); break; } }
// ---------------------------------------------------- /* * public ShowEvents() * { * InitializeComponent(); * } */ /// <summary> /// Импорт событий /// </summary> /// <param name="WorkFileName"></param> /// <param name="ImportFileName"></param> /// <param name="vr"></param> /// <param name="fr"></param> /// <param name="objective"></param> public ShowEvents(string WorkFileName, string ImportFileName, byte[] vr, MainForm fr, ShowEventsObjective objective) { InitializeComponent(); FileName = WorkFileName; ImpFlName = ImportFileName; Array.Copy(vr, vers, 4); lblCaption.Text = "Импорт событий"; MnFrm = fr; obj = objective; btnExpImpAdd.Text = "Импорт"; btnExpImpAdd.Click += new EventHandler(btnImp_Click); btnDelete.Visible = false; btnEdit.Visible = false; }