public void ContextMenuTypingShortcutEdit_Click(object sender, RoutedEventArgs args) { YellowstonePathology.Business.Typing.TypingShortcut typingShortcut = (YellowstonePathology.Business.Typing.TypingShortcut) this.ListViewTypingShortcut.SelectedItem; YellowstonePathology.UI.TypingShorcutDialog typingShortcutDialog = new TypingShorcutDialog(typingShortcut, false); typingShortcutDialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; typingShortcutDialog.ShowDialog(); }
public void PullTypingShortcut(YellowstonePathology.Business.Typing.TypingShortcut typingShortcut, object writer) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * From tblTypingShortcut where ObjectId = @ObjectId"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@ObjectId", SqlDbType.VarChar).Value = typingShortcut.ObjectId; GenericDocumentBuilder builder = new GenericDocumentBuilder(cmd, typeof(YellowstonePathology.Business.Typing.TypingShortcut)); DocumentId documentId = new DocumentId(typingShortcut, writer); Document document = this.m_Stack.Pull(documentId, builder); }
public void ContextMenuTypingShortcutDelete_Click(object sender, RoutedEventArgs args) { if (this.ListViewTypingShortcut.SelectedItem != null) { YellowstonePathology.Business.Typing.TypingShortcut typingShortcut = (YellowstonePathology.Business.Typing.TypingShortcut) this.ListViewTypingShortcut.SelectedItem; MessageBoxResult result = MessageBox.Show("Delete this item?", "Delete", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { this.m_TypingShortcutCollection.Remove(typingShortcut); YellowstonePathology.Business.Persistence.DocumentGateway.Instance.DeleteDocument(typingShortcut, this.m_ParentWindow); } } }
public static YellowstonePathology.Business.Typing.TypingShortcutCollection GetTypingShortcutCollectionByUser(int userId) { YellowstonePathology.Business.Typing.TypingShortcutCollection result = new Typing.TypingShortcutCollection(); YellowstonePathology.Business.Mongo.Server transferServer = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName); MongoCollection collection = transferServer.Database.GetCollection <BsonDocument>("TypingShortcut"); MongoCursor cursor = collection.FindAs <BsonDocument>(Query.EQ("UserId", BsonValue.Create(userId))).SetSortOrder(SortBy.Ascending("Shortcut")); foreach (BsonDocument bsonDocument in cursor) { YellowstonePathology.Business.Typing.TypingShortcut typingShortcut = new YellowstonePathology.Business.Typing.TypingShortcut(); YellowstonePathology.Business.Mongo.BSONPropertyWriter.Write(bsonDocument, typingShortcut); result.Add(typingShortcut); } return(result); }
public TypingShorcutDialog(string objectId, bool isNewShortcut) { this.m_IsNewItem = isNewShortcut; if (isNewShortcut == false) { this.m_TypingShortcut = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullTypingShortcut(objectId, this); } InitializeComponent(); this.m_SystemUserCollection = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetUsersByRole(YellowstonePathology.Business.User.SystemUserRoleDescriptionEnum.Typing, true); this.DataContext = this.m_TypingShortcut; this.comboBoxTypingUsers.ItemsSource = this.m_SystemUserCollection; this.Closing += TypingShorcutDialog_Closing; }
public void ContextMenuTypingShortcutAdd_Click(object sender, RoutedEventArgs args) { string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); YellowstonePathology.Business.Typing.TypingShortcut typingShortcut = new YellowstonePathology.Business.Typing.TypingShortcut(objectId); typingShortcut.ObjectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); YellowstonePathology.UI.TypingShorcutDialog typingShorcutDialog = new TypingShorcutDialog(typingShortcut, true); typingShorcutDialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; typingShorcutDialog.ShowDialog(); if(typingShorcutDialog.DialogResult == true) { this.m_TypingShortcutCollection.Add(typingShortcut); } this.NotifyPropertyChanged(""); }
private void BuildTypingShortcut(YellowstonePathology.Business.Typing.TypingShortcut typingShortcut) { using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); m_SQLCommand.Connection = cn; using (MySqlDataReader dr = m_SQLCommand.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(typingShortcut, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } }
public void ContextMenuTypingShortcutAdd_Click(object sender, RoutedEventArgs args) { string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); YellowstonePathology.Business.Typing.TypingShortcut typingShortcut = new YellowstonePathology.Business.Typing.TypingShortcut(objectId); typingShortcut.ObjectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); YellowstonePathology.UI.TypingShorcutDialog typingShorcutDialog = new TypingShorcutDialog(typingShortcut, true); typingShorcutDialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; typingShorcutDialog.ShowDialog(); if (typingShorcutDialog.DialogResult == true) { this.m_TypingShortcutCollection.Add(typingShortcut); } this.NotifyPropertyChanged(""); }
public TypingShorcutDialog(YellowstonePathology.Business.Typing.TypingShortcut typingShortcut, bool isNewShortcut) { this.m_TypingShortcut = typingShortcut; this.m_IsNewItem = isNewShortcut; InitializeComponent(); this.m_SystemUserCollection = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetUsersByRole(YellowstonePathology.Business.User.SystemUserRoleDescriptionEnum.Typing, true); this.DataContext = this.m_TypingShortcut; this.comboBoxTypingUsers.ItemsSource = this.m_SystemUserCollection; if (isNewShortcut == false) { YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullTypingShortcut(typingShortcut, this); } this.Closing += TypingShorcutDialog_Closing; }
public TypingShortcutReturnEventArgs(YellowstonePathology.Business.Typing.TypingShortcut typingShortcut) { this.m_TypingShortcut = typingShortcut; }