public ActionResult Reply(string id)
        {
            IDefect defect = Service.Get(id);

            Service.MoveStateOn(defect);

            return(View(new DefectViewModel(defect)));
        }
        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");
     }
 }
        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");
            }
        }
        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);
        }
        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);
        }
        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
    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));
                }
            }
        }
    }
        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();
            }
        }
        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;
        }
 public string SaveNotify(IDefect defect)
 {
     throw new NotImplementedException();
 }
 public void MoveStateOn(IDefect defect)
 {
     throw new NotImplementedException();
 }
 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;
 }
        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);
        }
        private string ExecuteSteps(ITestCase tc)
        {
            _defect = IoC.Get<IDefect>();

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

            return GetTestCaseExecutionStatus(tc);
        }
        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();
 }
        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);
        }
    }