SHARE
TWEET

Untitled

a guest Feb 14th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class CreateFeedbackCommand : ICommand
  2. {
  3.     private readonly IFactory factory;
  4.     private readonly IEngine engine;
  5.  
  6.     public CreateFeedbackCommand(IFactory factory, IEngine engine)
  7.     {
  8.         this.factory = factory;
  9.         this.engine = engine;
  10.     }
  11.  
  12.     public string Execute(IList<string> parameters)
  13.     {
  14.        
  15.         string title;
  16.         string description;
  17.         string strType;
  18.         //WorkItemType workItemType;
  19.         try
  20.         {
  21.             title = parameters[0].ToString();
  22.  
  23.             description = parameters[1].ToString();
  24.  
  25.             strType = parameters[2].ToString();
  26.  
  27.         }
  28.         catch (Exception ex)
  29.         {
  30.             throw new ArgumentException("Failed to parse CreateFeedback command parameters.");
  31.         }
  32.         if (strType.ToLower() == WorkItemType.feedback.ToString())
  33.         {
  34.  
  35.         }
  36.         else
  37.         {
  38.             throw new ArgumentException("Feedback could be only of type feedback");
  39.         }
  40.  
  41.         var feedback = this.factory.CreateFeedback(title, description, strType);
  42.         this.engine.WorkItemsList.Add((IWorkItem)feedback);
  43.  
  44.         return feedback.Print();
  45.     }
  46.  
  47.  
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top