本文整理汇总了C#中Issue类的典型用法代码示例。如果您正苦于以下问题:C# Issue类的具体用法?C# Issue怎么用?C# Issue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Issue类属于命名空间,在下文中一共展示了Issue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TesRestOfProperties
public void TesRestOfProperties()
{
var issue = new Issue();
var connector = new SonarRestService(new JsonSonarConnector());
var projectAsso = new Resource { Key = "proj" };
var model = new ExtensionDataModel(this.service, this.vshelper, null, null)
{
AssociatedProjectKey = "proj",
CommentData = "comment",
SelectedIssue = issue,
SonarInfo = "ver",
SelectedUser = new User { Login = "login" },
DiagnosticMessage = "MessageData",
DisableEditorTags = false,
RestService = connector,
AssociatedProject = projectAsso,
};
Assert.AreEqual("Selected Project: proj", model.AssociatedProjectKey);
Assert.AreEqual(issue, model.SelectedIssue);
Assert.AreEqual("comment", model.CommentData);
Assert.AreEqual("login", model.SelectedUser.Login);
Assert.AreEqual("ver", model.SonarInfo);
Assert.AreEqual("MessageData", model.DiagnosticMessage);
Assert.IsFalse(model.DisableEditorTags);
Assert.AreEqual(connector, model.RestService);
Assert.AreEqual(projectAsso, model.AssociatedProject);
}
示例2: Parse
public static IEnumerable<Issue> Parse(string full)
{
if (string.IsNullOrEmpty(full))
return Enumerable.Empty<Issue>();
LinkedList<Issue> list = new LinkedList<Issue>();
JsonData data = JsonMapper.ToObject(full);
for (int i = 0; i < data.Count; i++)
{
Issue issue = new Issue();
issue.Id = (int)data[i]["number"];
issue.Summary = (string)data[i]["title"];
issue.Status = (string)data[i]["state"];
if (data[i]["assignee"] != null)
{
issue.Owner = (string)data[i]["assignee"]["login"];
}
if (data[i]["milestone"] != null)
{
issue.Milestone = (string)data[i]["milestone"]["title"];
}
issue.Status = (string)data[i]["state"];
list.AddLast(issue);
}
return list;
}
示例3: CommitForm
public CommitForm(Issue issue, int ticks, string Comment, int activityId, DateTime spentOn)
{
InitializeComponent();
LangTools.UpdateControlsForLanguage(this.Controls);
Text = Lang.CommitConfirmQuestion;
this.issue = issue;
this.ticks = ticks;
this.Comment = Comment;
this.activityId = activityId;
this.spentOn = spentOn;
labelProjectContent.Text = issue.Project.Name;
labelIssueContent.Text = String.Format("({0}) {1}", issue.Id, issue.Subject);
if (labelIssueContent.Size.Width > Size.Width - labelIssueContent.Location.X - 10)
this.Size = new Size(labelIssueContent.Location.X + labelIssueContent.Size.Width + 10, this.Size.Height);
ComboBoxActivity.DataSource = Enumerations.Activities;
ComboBoxActivity.DisplayMember = "Name";
ComboBoxActivity.ValueMember = "Id";
ComboBoxActivity.SelectedValue = activityId;
labelTimeContent.Text = String.Format("{0:0.##}", (double)ticks / 3600);
labelDateSpentContent.Text = spentOn.ToString(Lang.Culture.DateTimeFormat.ShortDatePattern);
TextBoxComment.Text = Comment;
if (RedmineClientForm.RedmineVersion < ApiVersion.V13x)
{
CheckBoxClosesIssue.Enabled = false;
CheckBoxClosesIssue.Visible = false;
}
}
示例4: BuildMessage_IssueCreatedThenUpdated_ExpectOneCreationMessage
public void BuildMessage_IssueCreatedThenUpdated_ExpectOneCreationMessage()
{
//Arrange
var jiraMessageBuilder = new JiraMessageBuilder("http://jira");
var user = new User {displayName = "Laurent Kempé", name = "laurent"};
var sameIssue = new Issue {key = "LK-10", fields = new Fields {summary = "Issue Description", reporter = user, assignee = user}};
var jiraModel1 = new JiraModel
{
webhookEvent = "jira:issue_created",
issue = sameIssue
};
var jiraModel2 = new JiraModel
{
webhookEvent = "jira:issue_updated",
issue = sameIssue
};
var sameJiraIssueKeyEvents = new List<JiraModel> { jiraModel1, jiraModel2 };
//Act
var buildMessage = jiraMessageBuilder.BuildMessage(sameJiraIssueKeyEvents);
//Assert
Assert.That(buildMessage, Is.EqualTo("<b><a href='http://jira/browse/LK-10'>LK-10 Issue Description</a></b> has been created by <a href='http://jira/secure/ViewProfile.jspa?name=laurent'>Laurent Kempé</a> and current assignee is <a href='http://jira/secure/ViewProfile.jspa?name=laurent'>Laurent Kempé</a>."));
}
示例5: RedmineIssueStorage
public RedmineIssueStorage(Issue issue) {
id = issue.Id;
tracker = issue.Tracker.Name;
subject = issue.Subject;
project = issue.Project.Name;
projectid = issue.Project.Id;
}
示例6: InitalizeMenu
/// <summary>
/// Initializes header menu.
/// </summary>
/// <param name="issue">Issue object</param>
protected void InitalizeMenu(Issue issue)
{
// Get newsletter
Newsletter news = NewsletterProvider.GetNewsletter(issue.IssueNewsletterID);
if (news == null)
{
return;
}
InitTabs(3, "newsletterIssueContent");
// Show only 'Send' tab for dynamic newsletter
if (news.NewsletterType == NewsletterType.Dynamic)
{
SetTab(0, GetString("Newsletter_Issue_Header.Send"), "Newsletter_Issue_Send.aspx?issueid=" + issue.IssueID, "SetHelpTopic('helpTopic', 'send_tab');");
// Set proper context help page
SetHelp("send_tab", "helpTopic");
}
else
{
// Show 'Edit' and 'Send' tabs only to authorized users
if (CMSContext.CurrentUser.IsAuthorizedPerResource("cms.newsletter", "authorissues"))
{
SetTab(0, GetString("General.Edit"), "Newsletter_Issue_Edit.aspx?issueid=" + issue.IssueID, "SetHelpTopic('helpTopic', 'edit_tab');");
SetTab(1, GetString("Newsletter_Issue_Header.Send"), "Newsletter_Issue_Send.aspx?issueid=" + issue.IssueID, "SetHelpTopic('helpTopic', 'send_tab');");
}
// Add 'Preview' tab
SetTab(2, GetString("Newsletter_Issue_Header.Preview"), "Newsletter_Issue_Preview.aspx?issueid=" + issue.IssueID, "SetHelpTopic('helpTopic', 'preview_tab');");
}
}
示例7: RedmineIssues_ShouldCreateIssue
public void RedmineIssues_ShouldCreateIssue()
{
Issue issue = new Issue();
issue.Project = new Project { Id = 10 };
issue.Tracker = new IdentifiableName { Id = 4 };
issue.Status = new IdentifiableName { Id = 5 };
issue.Priority = new IdentifiableName { Id = 8 };
issue.Subject = "Issue created using Rest API";
issue.Description = "Issue description...";
issue.Category = new IdentifiableName { Id = 11 };
issue.FixedVersion = new IdentifiableName { Id = 9 };
issue.AssignedTo = new IdentifiableName { Id = 8 };
issue.ParentIssue = new IdentifiableName { Id = 19 };
issue.CustomFields = new List<IssueCustomField>();
issue.CustomFields.Add(new IssueCustomField { Id = 13, Values = new List<CustomFieldValue> { new CustomFieldValue { Info = "Issue custom field completed" } } });
issue.IsPrivate = true;
issue.EstimatedHours = 12;
issue.StartDate = DateTime.Now;
issue.DueDate = DateTime.Now.AddMonths(1);
issue.Watchers = new List<Watcher>();
issue.Watchers.Add(new Watcher { Id = 8 });
issue.Watchers.Add(new Watcher { Id = 2 });
Issue savedIssue = redmineManager.CreateObject<Issue>(issue);
Assert.AreEqual(issue.Subject, savedIssue.Subject);
}
示例8: Issues_Validate
partial void Issues_Validate(Issue entity, EntitySetValidationResultsBuilder results)
{
if (entity.TargetResolutionDate != null & entity.DateRaised != null)
{
if (entity.TargetResolutionDate < entity.DateRaised)
{
results.AddEntityError("The target date cannot be earlier than the date raised");
}
}
if (entity.TargetResolutionDate != null & entity.CorrectiveActionCompletionTargetDate != null)
{
if (entity.TargetResolutionDate < entity.CorrectiveActionCompletionTargetDate)
{
results.AddEntityError("The corrective action must be completed on or before the target resolution date");
}
}
if (entity.TargetResolutionDate != null & entity.PreventativeActionCompletionTargetDate != null)
{
if (entity.TargetResolutionDate < entity.PreventativeActionCompletionTargetDate)
{
results.AddEntityError("The preventative action must be completed on or before the target resolution date");
}
}
}
示例9: LogMessage
public static void LogMessage(string message, Issue.IssueLevel issueLevel)
{
try
{
ShowMessage(string.Format("{0}: {1}", issueLevel, message), ConsoleColor.Blue);
switch(issueLevel)
{
case Issue.IssueLevel.Error:
ShowMessage(message, ConsoleColor.Red);
Trace.TraceError(message);
RegisterMessageAsync(message, issueLevel);
break;
case Issue.IssueLevel.Warning:
ShowMessage(message, ConsoleColor.Yellow);
Trace.TraceWarning(message);
RegisterMessageAsync(message, issueLevel);
break;
case Issue.IssueLevel.Information:
ShowMessage(message, ConsoleColor.Green);
Trace.TraceInformation(message);
//RegisterMessageAsync(message, issueLevel); //This will be too much and of no value to the support service.
break;
default:
throw new ArgumentOutOfRangeException(string.Format("Unknown issuelevel {0}.", issueLevel));
}
}
catch (Exception exp)
{
ShowMessage(exp.Message, ConsoleColor.DarkMagenta);
}
}
示例10: TaskModel
public TaskModel(ISourceControl sourceControl, IIssuesTracking issuesTracking, IRepositoryFactory repositoryFactory, Issue issue)
{
_sourceControl = sourceControl;
_issuesTracking = issuesTracking;
_repositoryFactory = repositoryFactory;
Issue = issue;
}
示例11: RedmineAttachments_ShouldUploadAttachment
public void RedmineAttachments_ShouldUploadAttachment()
{
//read document from specified path
string documentPath = "E:\\uploadAttachment.txt";
byte[] documentData = File.ReadAllBytes(documentPath);
//upload attachment to redmine
Upload attachment = redmineManager.UploadFile(documentData);
//set attachment properties
attachment.FileName = "AttachmentUploaded.txt";
attachment.Description = "File uploaded using REST API";
attachment.ContentType = "text/plain";
//create list of attachments to be added to issue
IList<Upload> attachments = new List<Upload>();
attachments.Add(attachment);
//read document from specified path
documentPath = "E:\\uploadAttachment1.txt";
documentData = File.ReadAllBytes(documentPath);
//upload attachment to redmine
Upload attachment1 = redmineManager.UploadFile(documentData);
//set attachment properties
attachment1.FileName = "AttachmentUploaded1.txt";
attachment1.Description = "Second file uploaded";
attachment1.ContentType = "text/plain";
attachments.Add(attachment1);
Issue issue = new Issue();
issue.Project = new Project { Id = 10 };
issue.Tracker = new IdentifiableName { Id = 4 };
issue.Status = new IdentifiableName { Id = 5 };
issue.Priority = new IdentifiableName { Id = 8 };
issue.Subject = "Issue with attachments";
issue.Description = "Issue description...";
issue.Category = new IdentifiableName { Id = 11 };
issue.FixedVersion = new IdentifiableName { Id = 9 };
issue.AssignedTo = new IdentifiableName { Id = 8 };
issue.ParentIssue = new IdentifiableName { Id = 19 };
issue.CustomFields = new List<IssueCustomField>();
issue.CustomFields.Add(new IssueCustomField { Id = 13, Values = new List<CustomFieldValue> { new CustomFieldValue { Info = "Issue custom field completed" } } });
issue.IsPrivate = true;
issue.EstimatedHours = 12;
issue.StartDate = DateTime.Now;
issue.DueDate = DateTime.Now.AddMonths(1);
issue.Uploads = attachments;
issue.Watchers = new List<Watcher>();
issue.Watchers.Add(new Watcher { Id = 8 });
issue.Watchers.Add(new Watcher { Id = 2 });
//create issue and attach document
Issue issueWithAttachment = redmineManager.CreateObject<Issue>(issue);
issue = redmineManager.GetObject<Issue>(issueWithAttachment.Id.ToString(), new NameValueCollection { { "include", "attachments" } });
Assert.IsTrue(issue.Attachments.Count == 2 && issue.Attachments[0].FileName == attachment.FileName);
}
示例12: UpdateIssue
public void UpdateIssue()
{
int projectId = FirstProjectId;
string originalSummary = GetRandomSummary();
string newSummary = GetRandomSummary();
string originalDescription = GetRandomDescription();
string newDescription = GetRandomDescription();
Issue issue = new Issue();
issue.Project = new ObjectRef( projectId );
issue.Summary = originalSummary;
issue.Description = originalDescription;
issue.Category = new ObjectRef( GetFirstCategory( projectId ) );
int issueId = Session.Request.IssueAdd( issue );
try
{
Issue issueToUpdate = Session.Request.IssueGet(issueId);
issueToUpdate.Summary = newSummary;
issueToUpdate.Description = newDescription;
Session.Request.IssueUpdate(issueToUpdate);
Issue updatedIssue = Session.Request.IssueGet(issueId);
Assert.AreEqual(newSummary, updatedIssue.Summary);
Assert.AreEqual(newDescription, updatedIssue.Description);
}
finally
{
Session.Request.IssueDelete(issueId);
}
}
示例13: Create
public bool Create()
{
try
{
RedmineManager manager = new RedmineManager(Configuration.RedmineHost,
Configuration.RedmineUser, Configuration.RedminePassword);
//Create a issue.
var newIssue = new Issue
{
Subject = Title,
Description = Description,
Project = new IdentifiableName() { Id = ProjectId },
Tracker = new IdentifiableName() { Id = TrackerId }
};
User thisuser = (from u in manager.GetObjectList<User>(new System.Collections.Specialized.NameValueCollection())
where u.Login == Configuration.RedmineUser
select u).FirstOrDefault();
if (thisuser != null)
newIssue.AssignedTo = new IdentifiableName() { Id = thisuser.Id };
manager.CreateObject(newIssue);
}
catch { return false; }
return true;
}
示例14: CreateDetailTransactionsForErrorCorrection
public void CreateDetailTransactionsForErrorCorrection(Order order, BLL.PickList picklist,
Issue stvLog, int receiptPalletId, int receiptID, User user, DateTime convertedEthDate
, int newItemId, int newUnitId, int newManufacturerId, decimal pickedPack
, decimal Convertedpack, int confirmationStatusId, bool changeExpiryDate
, DateTime? ExpiryDate, bool changeBatchNo, string batchNo)
{
//Load the ReceivePallet First From that we Get the Information that We need
ReceivePallet receivePalletOriginal = new ReceivePallet();
receivePalletOriginal.LoadByPrimaryKey(receiptPalletId);
ReceiveDoc receiveDocOriginal = new ReceiveDoc();
receiveDocOriginal.LoadByPrimaryKey(receivePalletOriginal.ReceiveID);
//Load ItemUnit Detail for For ItemUnit Change;
ItemUnit newItemUnit = new ItemUnit();
newItemUnit.LoadByPrimaryKey(newUnitId);
// Generate PicklistDetail With OrderDetail information
PickListService pickListService = new PickListService();
PickListDetail pickListDetail = pickListService.CreatePicklistDetailWithOrder(receiveDocOriginal, receivePalletOriginal, order, picklist,
pickedPack);
// Generate IssueDoc from picklistDetail and substract the quantity from receiveDoc
IssueService issueService = new IssueService();
issueService.CreateIssueFromPicklist(pickListDetail, order, convertedEthDate, stvLog, user);
if (Convertedpack > 0)
{
//duplicate The ReceiveDoc and ReceiptPallet
ReceiveService receiveService = new ReceiveService();
receiveService.CloneReceiveForErrorCorrection(confirmationStatusId, receivePalletOriginal, receiveDocOriginal
, Convertedpack, user, newItemId
, receiveDocOriginal.StoreID, receiptID
, newManufacturerId, newItemUnit, convertedEthDate,changeExpiryDate,ExpiryDate,changeBatchNo,batchNo);
}
}
示例15: CadastrarIssue
public ExcelIssue CadastrarIssue(ExcelIssue atualExcelIssue, bool atualizarProjetoExistente)
{
Issue issueLoaded = null;
Issue issueNew;
Issue issueToSave = null;
issueNew = new Issue
{
Id = atualExcelIssue.IdRedmine,
Subject = atualExcelIssue.Subject,
EstimatedHours = atualExcelIssue.EstimatedHours,
StartDate = atualExcelIssue.StartDate,
DueDate = atualExcelIssue.DueDate,
AssignedTo = new IdentifiableName { Id = atualExcelIssue.AssigneeId },
Tracker = new IdentifiableName { Id = atualExcelIssue.TrackerId },
Project = new IdentifiableName { Id = atualExcelIssue.ProjectId },
ParentIssue = atualExcelIssue.ParentExcelIssue != null && atualExcelIssue.ParentExcelIssue.IdRedmine != 0 ?
new IdentifiableName { Id = atualExcelIssue.ParentExcelIssue.IdRedmine } : null
};
if (atualizarProjetoExistente && atualExcelIssue.IdRedmine != 0)
{
try
{
issueLoaded = manager.GetObject<Issue>(atualExcelIssue.IdRedmine.ToString(), null);
issueToSave = AtualizarSomenteModificacoes(issueLoaded, issueNew);
}
catch(RedmineException rex)
{
Console.WriteLine("Mensagem de erro do sistema ao tentar carregar a Issue Id " + atualExcelIssue.IdRedmine.ToString() + ": " + rex.Message);
throw new Exception("O ID da Issue/Atividade sendo atualizada não foi encontrada no Redmine!");
}
}
else
issueToSave = issueNew;
try
{
if (!atualizarProjetoExistente)
{
issueToSave = manager.CreateObject(issueToSave);
atualExcelIssue.IdRedmine = issueToSave.Id;
}
else if (issueToSave.Id != 0)
manager.UpdateObject(issueToSave.Id.ToString(), issueToSave);
}
catch(RedmineException rex)
{
if (rex.Message.Contains("Tracker is not included in the list"))
{
throw new Exception("Tracker Not Found");
}
else {
throw rex;
}
}
return atualExcelIssue;
}