private void MainForm_Load(object sender, EventArgs e) { if (File.Exists(SystemAramis.APPLICATION_PATH + "\\version")) { UpdatePageGroup.Text = String.Format("Обновление {0}", File.ReadAllText(SystemAramis.APPLICATION_PATH + "\\version")); } if (SystemAramis.CurrentUser != null) { UIConsts.Skin = SystemAramis.CurrentUser.Skin; adminRibbonPage.Visible = SystemAramis.CurrentUser.Ref == Catalogs.CatalogUsers.Admin; if (SystemAramis.CurrentUser.Roles.IsContain(Predefined.SuperUser.Id, "Role") || SystemAramis.CurrentUser.Ref == Catalogs.CatalogUsers.Admin) { DBObjectsPageGroup.Visible = true; } } CreateTrayIcon(); CheckNewTaskTimer.Enabled = true; Jornal J = new Jornal(); J.Date = DateTime.Now; J.Event = Enums.Events.LogIn; J.Description = "Вход в систему"; J.Write(); }
void Shipment_AfterWriting(DatabaseObject item) { if ( needWriteToJornal ) { Jornal J = new Jornal(); J.Date = CreationDate; J.Event = Events.ShipmentOpened; J.Description = String.Format("Открыта партия №{0}", Number); J.Write(); } }
private void MainForm_FormClosed(object sender, FormClosedEventArgs e) { Jornal J = new Jornal(); J.Date = DateTime.Now; J.Event = Enums.Events.LogOut; J.Description = "Выход из системы"; J.Write(); RemoveTrayIcon(); }