コード例 #1
0
        public ActionResult Reply(string id)
        {
            IDefect defect = Service.Get(id);

            Service.MoveStateOn(defect);

            return(View(new DefectViewModel(defect)));
        }
コード例 #2
0
        public ActionResult Notify(string id, string mailId)
        {
            IDefect defect = Service.Get(id);

            IMailItem itemRead = Mail.Get(ServiceFactory.Get <IItemFactory>().GetNew <IMailItem>(mailId));

            Mail.Flag(itemRead);
            ServiceFactory.Get <IItemFactory>().MergeTo(itemRead, defect);

            return(View(new DefectViewModel(defect)));
        }
 public static void SLXSocial_OnCreate( IDefect defect)
 {
     var appCtx = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Application.IContextService>();
     if(appCtx.HasContext("NewEntityParameters")){
         var entityParams = appCtx["NewEntityParameters"] as System.Collections.Generic.Dictionary<String,String>;
         if(entityParams != null) {
             defect.Subject = (String)entityParams["DefectSubject"];
             defect.DefectProblem.Notes = (String)entityParams["DefectNotes"];
         }
         appCtx.RemoveContext("NewEntityParameters");
     }
 }
コード例 #4
0
        public void InsertDefect()
        {
            IMailItem mailItem = ServiceFactory.Get <IItemFactory>().GetNew <IMailItem>();
            IDefect   defect   = ServiceFactory.Get <IItemFactory>().GetNewDefect(mailItem);

            service.Save(defect);

            var collection = service.GetAllDefects();

            Assert.IsNotNull(collection);
            CollectionAssert.AllItemsAreInstancesOfType(collection, typeof(IDefect));
            Assert.IsTrue(collection.Any(item => item.DefectID.Equals(defect.DefectID)));
        }
コード例 #5
0
        public IDefect GetNewDefect(IMailItem itemRead)
        {
            SubjectMetaData data = new SubjectMetaData(itemRead.Subject);

            string  agency = data.DecodeCodCompany + " " + data.Agency.ToString().PadLeft(4, '0');
            IDefect defect = GetNewDefect(null, agency: agency, defectID: data.Id);

            defect.Title             = data.Title;
            defect.Description       = HttpUtility.UrlDecode(itemRead.Content);
            defect.IMailItemUniqueId = itemRead.UniqueId;

            return(defect);
        }
コード例 #6
0
        public static void SLXSocial_OnCreate(IDefect defect)
        {
            var appCtx = Sage.Platform.Application.ApplicationContext.Current.Services.Get <Sage.Platform.Application.IContextService>();

            if (appCtx.HasContext("NewEntityParameters"))
            {
                var entityParams = appCtx["NewEntityParameters"] as System.Collections.Generic.Dictionary <String, String>;
                if (entityParams != null)
                {
                    defect.Subject             = (String)entityParams["DefectSubject"];
                    defect.DefectProblem.Notes = (String)entityParams["DefectNotes"];
                }
                appCtx.RemoveContext("NewEntityParameters");
            }
        }
コード例 #7
0
        public IDefect Get(string id)
        {
            IDefect result = null;

            using (TfsTeamProjectCollection service = Service)
            {
                WorkItemStore workItemStore = service.GetService <WorkItemStore>();
                WorkItem      wi            = GetWorkItemById(workItemStore, id);

                result = ToDefectItem(wi);

                result.ConfirmedNotificationAddress = GetEmailAddress(Service, result.AssignedTo);
            }

            return(result);
        }
コード例 #8
0
        public IDefect LookFor(IMailItem mailItem)
        {
            IDefect result = null;

            IMailItem mail    = Mail.Get(mailItem);
            string    subject = Factory.GetSubject(mail);

            using (TfsTeamProjectCollection service = Service)
            {
                WorkItemStore workItemStore = service.GetService <WorkItemStore>();

                WorkItemCollection workItems = GetWorkItemByTitle(workItemStore, subject);
                result = ToDefectItemCollection(workItems).FirstOrDefault();
            }

            return(result);
        }
コード例 #9
0
        public ActionResult Create(string id, string mailId)
        {
            IMailItem model  = Mail.Get(ServiceFactory.Get <IItemFactory>().GetNew <IMailItem>(HttpUtility.UrlDecode(mailId)));
            IDefect   defect = Service.LookFor(model);

            if (defect == null)
            {
                IMailItem itemRead = Mail.Get(model);
                Mail.Flag(itemRead);
                defect = ServiceFactory.Get <IItemFactory>().GetNewDefect(itemRead);

                return(View(new DefectViewModel(defect)));
            }
            else
            {
                return(RedirectToAction("Notify", "Defect", new { id = defect.Id, mailId = model.UniqueId }));
            }
        }
コード例 #10
0
ファイル: PIAOutput.aspx.cs プロジェクト: wra222/testgit
    private void initDefectList()
    {
        commServiceObj = ServiceAgent.getInstance().GetObjectByName<IDefect>(WebConstant.CommonObject);
        iDefect = (IDefect)commServiceObj;

        if (iDefect != null)
        {
            IList<DefectInfo> defectList = iDefect.GetDefectList("PRD");
        
            if (defectList != null && defectList.Count != 0)
            {
                foreach (DefectInfo item in defectList)
                {
                    this.lbDefectList.Items.Add(new ListItem(item.id + " " + item.friendlyName, item.id));
                }
            }
        }
    }
コード例 #11
0
        public void MoveStateOn(IDefect defect)
        {
            using (TfsTeamProjectCollection service = Service)
            {
                WorkItemStore      workItemStore = service.GetService <WorkItemStore>();
                WorkItemCollection collection    = GetWorkItemCollectionById(workItemStore, defect.DefectID);
                WorkItem           workItem      = collection[0];
                workItem.Open();

                workItem.State = GetNextState(workItem.Fields[DefectField.State.FieldName()]);

                if (!workItem.IsValid())
                {
                    throw new ApplicationException("Errore salvataggio " + workItem.Title);
                }

                workItem.Save();
            }
        }
コード例 #12
0
        private IDefect ToDefectItem(WorkItem workItem)
        {
            IDefect defect = Factory.GetNewDefect(workItem.Id,
                                                  workItem.TryToGetField(DefectField.Agenzia.FieldName()),
                                                  workItem.TryToGetField(DefectField.DefectID.FieldName()),
                                                  workItem.TryToGetField(DefectField.DefectType.FieldName()),
                                                  workItem.TryToGetField(DefectField.DefectSystem.FieldName()),
                                                  workItem.TryToGetField(DefectField.FoundIn.FieldName()),
                                                  workItem.TryToGetField(DefectField.environment.FieldName()));

            defect.Title       = workItem.TryToGetField(DefectField.Title.FieldName());
            defect.AreaPath    = workItem.TryToGetField(DefectField.AreaPath.FieldName());
            defect.Iteration   = workItem.TryToGetField(DefectField.IterationPath.FieldName());
            defect.State       = workItem.TryToGetField(DefectField.State.FieldName());
            defect.Description = workItem.TryToGetField(DefectField.Description.FieldName());
            defect.Severity    = workItem.TryToGetEnumField <SeverityLevel>(DefectField.Severity.FieldName());
            defect.AssignedTo  = workItem.TryToGetField(DefectField.AssignedTo.FieldName());

            return(defect);
        }
コード例 #13
0
        public DefectViewModel(IDefect defect)
        {
            Id = defect.Id;

            Title = defect.Title;

            AutoAssign = defect.AutoAssign;

            AreaPath = defect.AreaPath;

            Iteration = defect.Iteration;

            SurveySystem = defect.SurveySystem;

            DefectID = defect.DefectID;

            FoundIn = defect.FoundIn;

            Agency = defect.Agency;

            Environment = defect.Environment;

            DefectType = defect.DefectType;

            Severity = defect.Severity;

            State = defect.State;

            Description = defect.Description;

            Comments = defect.Comments;

            Attachment = defect.Attachment;

            IMailItemUniqueId = defect.IMailItemUniqueId;

            AssignedTo = defect.AssignedTo;

            ConfirmedNotificationAddress = defect.ConfirmedNotificationAddress;
        }
コード例 #14
0
 public string SaveNotify(IDefect defect)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
 public void MoveStateOn(IDefect defect)
 {
     throw new NotImplementedException();
 }
コード例 #16
0
 public string Save(IDefect model)
 {
     throw new NotImplementedException();
 }
コード例 #17
0
 public void MergeTo(IMailItem itemRead, IDefect defect)
 {
     defect.Description       = HttpUtility.UrlDecode(itemRead.Content);
     defect.IMailItemUniqueId = itemRead.UniqueId;
 }
コード例 #18
0
        public string SaveNotify(IDefect model)
        {
            WorkItem workItem;

            using (TfsTeamProjectCollection service = Service)
            {
                WorkItemStore workItemStore = service.GetService <WorkItemStore>();
                Project       project       = workItemStore.Projects[TeamProjectName];

                // Create the work item.
                workItem = GetWorkItemCollectionById(workItemStore, model.Id.Value.ToString())[0] as WorkItem;
                workItem.Open();


                // Comments & state
                if (workItem.State == "Resolved")
                {
                    workItem.State   = "Verified";
                    workItem.History = string.Join(Environment.NewLine
                                                   , "Reopened on " + DateTime.Now.Date.ToShortDateString() + " by " + workItemStore.UserIdentityName
                                                   , ""
                                                   , "<em>" + model.Description + "<em>");

                    // Save the new
                    if (!workItem.IsValid())
                    {
                        throw new ApplicationException("Errore in verifica Defect " + workItem.Title);
                    }

                    workItem.Save();

                    // Reopen
                    workItem.Open();

                    // needs to be reopened
                    workItem.State = "Reopened";
                }
                else
                {
                    if (workItem.State == "Verified")
                    {
                        workItem.State = "Reopened";
                    }

                    workItem.History = string.Join(Environment.NewLine
                                                   , "Notified on " + DateTime.Now.Date.ToShortDateString() + " by " + workItemStore.UserIdentityName
                                                   , ""
                                                   , "<em>" + model.Description + "<em>");
                }

                //workItem.Fields[DefectField.Severity.FieldName()].Value = model.Severity;
                //workItem.Fields[DefectField.Severity.FieldName()].AllowedValues[(short)model.Severity];

                if (!string.IsNullOrEmpty(model.IMailItemUniqueId))
                {
                    IAttachment att = Mail.GetAsAttachment(Factory.GetNew <IMailItem>(model.IMailItemUniqueId));
                    workItem.Attachments.Add(ToAttachment(att,
                                                          comment: "Uploaded by " + workItemStore.UserIdentityName + " with Allianz.Vita.Quality Tool",
                                                          fileName: model.Title.Replace('/', '-') + " - Comunicazione(" + (workItem.Attachments.Count + 1) + ").eml"));
                }

                // Links is read only

                // Save the new
                if (!workItem.IsValid())
                {
                    throw new ApplicationException("Errore in aggiornamento Defect " + workItem.Title);
                }

                Mail.Complete(Factory.GetNew <IMailItem>(model.IMailItemUniqueId));

                workItem.Save();
            }

            return(workItem != null?workItem.Id.ToString() : string.Empty);
        }
コード例 #19
0
        private string ExecuteSteps(ITestCase tc)
        {
            _defect = IoC.Get<IDefect>();

            tc.Steps.ForEach(step => ExecuteStep(tc, step));

            return GetTestCaseExecutionStatus(tc);
        }
コード例 #20
0
        public ActionResult Detail(string id)
        {
            IDefect defect = Service.Get(id);

            return(View(new DefectViewModel(defect)));
        }
コード例 #21
0
 public void MergeTo(IMailItem itemRead, IDefect defect)
 {
     throw new NotImplementedException();
 }
コード例 #22
0
        public string Save(IDefect model)
        {
            WorkItem defect;

            using (TfsTeamProjectCollection service = Service)
            {
                WorkItemStore workItemStore = service.GetService <WorkItemStore>();
                Project       project       = workItemStore.Projects[TeamProjectName];

                // Create the work item.
                defect = project
                         .WorkItemTypes[Config.WorkItemType]
                         .NewWorkItem();

                // int ? Id { get; }
                defect.Title = model.Title;

                if (model.AutoAssign)
                {
                    Autoassign(workItemStore, defect);
                }
                else
                {
                    defect.AreaPath = model.AreaPath;
                    //defect.IterationPath = model.Iteration;

                    // moved to current/<unique node>
                    defect.IterationPath = GetCurrentIterationPath(workItemStore);
                }

                defect.State       = model.State;
                defect.Description = model.Description;

                defect.Fields[DefectField.DefectSystem.FieldName()].Value = model.SurveySystem;
                defect.Fields[DefectField.DefectID.FieldName()].Value     = model.DefectID;
                defect.Fields[DefectField.FoundIn.FieldName()].Value      = model.FoundIn;
                defect.Fields[DefectField.Agenzia.FieldName()].Value      = model.Agency;
                defect.Fields[DefectField.environment.FieldName()].Value  = model.Environment;
                defect.Fields[DefectField.DefectType.FieldName()].Value   = model.DefectType;
                defect.Fields[DefectField.Severity.FieldName()].Value     =
                    defect.Fields[DefectField.Severity.FieldName()].AllowedValues[(short)model.Severity];

                // Comments
                defect.History = "Created on " + DateTime.Now.Date.ToShortDateString() + " by " + workItemStore.UserIdentityName;

                if (!string.IsNullOrEmpty(model.IMailItemUniqueId))
                {
                    IAttachment att = Mail.GetAsAttachment(Factory.GetNew <IMailItem>(model.IMailItemUniqueId));
                    defect.Attachments.Add(ToAttachment(att,
                                                        comment: "Uploaded by " + workItemStore.UserIdentityName + " with Allianz.Vita.Quality Tool",
                                                        fileName: model.Title.Replace('/', '-') + ".eml"));
                }

                // Links is read only

                // Save the new
                if (!defect.IsValid())
                {
                    throw new ApplicationException("Errore in inserimento Defect " + defect.Title);
                }

                Mail.Complete(Factory.GetNew <IMailItem>(model.IMailItemUniqueId));

                defect.Save();
            }

            return(defect != null?defect.Id.ToString() : string.Empty);
        }
コード例 #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            iDefect = ServiceAgent.getInstance().GetObjectByName<IDefect>(WebConstant.CommonObject);
            iTestStation = ServiceAgent.getInstance().GetObjectByName<ITestStation>(WebConstant.CommonObject);
            if (!this.IsPostBack)
            {
                if (isPercentage)
                {
                    if (Convert.ToInt32(width) > 100)
                    {
                        this.drpReturnStation.Width = Unit.Percentage(100);
                    }
                    else
                    {
                        drpReturnStation.Width = Unit.Percentage(Convert.ToDouble(width));
                    }
                }
                else
                {
                    drpReturnStation.Width = Unit.Parse(width);
                }

                this.drpReturnStation.CssClass = cssClass;
                this.drpReturnStation.Enabled = enabled;

                if (enabled)
                {
                    initReturnStation();
                }
                else
                {
                    this.drpReturnStation.Items.Add(new ListItem("", ""));
                }
            }
        }
        catch (FisException ex)
        {
            showCmbErrorMessage(ex.mErrmsg);
        }
        catch (Exception ex)
        {
            showCmbErrorMessage(ex.Message);
        }
    }