Beispiel #1
0
 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();
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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);
         }
     }
 }
Beispiel #4
0
        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("");
        }
Beispiel #7
0
        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();
                    }
                }
            }
        }
Beispiel #8
0
        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;
        }
Beispiel #10
0
 public TypingShortcutReturnEventArgs(YellowstonePathology.Business.Typing.TypingShortcut typingShortcut)
 {
     this.m_TypingShortcut = typingShortcut;
 }