protected void OrderNotesGrid_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("AddNote"))
     {
         string[] data    = ((string)e.CommandArgument).Split(':');
         int      orderId = AlwaysConvert.ToInt(data[0]);
         HiddenOrderId.Value   = orderId.ToString();
         AddDialogCaption.Text = String.Format(AddDialogCaption.Text, data[1]);
         List <string> history = new List <string>();
         Order         order   = EntityLoader.Load <Order>(orderId);
         if (order != null)
         {
             IList <OrderNote> notes = order.Notes;
             notes.Sort(new PropertyComparer("CreatedDate", CommerceBuilder.Common.SortDirection.DESC));
             foreach (OrderNote note in notes)
             {
                 if (note.NoteType != NoteType.SystemPrivate && note.NoteType != NoteType.SystemPublic)
                 {
                     StringBuilder historyEntry = new StringBuilder();
                     historyEntry.Append("<i>On " + note.CreatedDate.ToString("g") + ", ");
                     historyEntry.Append(note.User.PrimaryAddress.FullName);
                     historyEntry.Append(note.NoteType == NoteType.Public ? " wrote" : " whispered");
                     historyEntry.Append(":</i><br />");
                     historyEntry.Append(note.Comment);
                     history.Add(historyEntry.ToString());
                 }
             }
         }
         NoteHistory.Text = string.Join("<hr>", history.ToArray());
         AddPopup.Show();
         NoteText.Focus();
     }
 }
예제 #2
0
        private void FindAndChange_OnClick(object sender, RoutedEventArgs e)
        {
            NoteText.Focus();
            NoteText.SelectionStart = 0;

            finder = new Find_and_Change(this);
            finder.Show();
        }
예제 #3
0
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var addedItems = e.AddedItems;

            if (addedItems.Count > 0)
            {
                NoteText.Text = NotesDL.GetInstance.GetNote(((Note)addedItems[0]).Id).Text;
            }
            RenderMarkDown(NoteText.Text);
            NoteText.Focus();
            NoteText.SelectionStart = NoteText.Text.Length;
        }
예제 #4
0
 private void ChoseCategory_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (ChoseCategory.SelectedIndex != -1)
     {
         Resources["Notes"] = NotesDL.GetInstance.GetNoteInCategorylist(Application.Current.Properties["UserName"].ToString(), ((Category)ChoseCategory.Items[ChoseCategory.SelectedIndex]).Id);
         if (!NotesList.Items.IsEmpty)
         {
             NotesList.SelectedIndex = 0;
         }
     }
     RenderMarkDown(NoteText.Text);
     NoteText.Focus();
     NoteText.SelectionStart = NoteText.Text.Length;
 }
예제 #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            newbtn.Enabled      = false;
            edit.Enabled        = false;
            delete.Enabled      = false;
            choosCust.Enabled   = false;
            chooseOrder.Enabled = false;
            priceText.Enabled   = true;
            date.Enabled        = true;
            NoteText.Enabled    = true;
            save.Enabled        = true;
            status = "edit";

            prevPrice = Convert.ToDouble(priceText.Text);
            NoteText.Focus();
        }