コード例 #1
0
        public void CreateArk()
        {
            var u = this.RandomUser();
            var c = new ArkConnection(u, _token, this.CreateAccount());
            this._accountConnectionService.Create(c);
            Assert.Greater(c.ID, 0);

            var c2 = this._accountConnectionService.GetConnection<ArkConnection>(u);
            Assert.IsNotNull(c2);
            Assert.AreEqual(c2.ID, c.ID);
            Assert.AreEqual(c2.Name, c.Name);
        }
コード例 #2
0
        private TaskInfo[] FetchIFree(ArkConnection ark)
        {
            var user = this._userHelper.GetUserByUserName(ark.Name);
            DateTime due;
            return this._sessionManager
                    .OpenStatelessSession()
                    .CreateSQLQuery(string.Format(@"
            select
            (case d.[type]
            when 1 then '基本任务'
            when 2 then '团队相关任务'
            when 3 then '应用相关任务'
            when 4 then '分配应用'
            when 5 then '评审任务'
            when 6 then '评审问题'
            else '未知'
            end) as TaskType,
            d.Name as TaskName,
            Owners,
            pd.PlanStartTime,
            pd.PlanEndTime,
            (case d.[type]
            when 1 then 'https://ifree.alibaba-inc.com/taskmanage/Plan/BasicDemandDetail?planDemandId='+cast(pd.id as nvarchar(50))
            when 2 then 'https://ifree.alibaba-inc.com/taskmanage/Plan/TeamRelatedDemandDetail?planDemandId='+cast(pd.id as nvarchar(50))
            when 3 then 'https://ifree.alibaba-inc.com/taskmanage/Plan/AppRelatedDemandDetail?planDemandId='+cast(pd.id as nvarchar(50))
            when 4 then 'https://ifree.alibaba-inc.com/taskmanage/Plan/AssignAppDemandDetail?planDemandId='+cast(pd.id as nvarchar(50))
            when 5 then 'https://ifree.alibaba-inc.com/taskmanage/Plan/ReviewDemandDetail?planDemandId='+cast(pd.id as nvarchar(50))
            when 6 then 'https://ifree.alibaba-inc.com/taskmanage/Plan/ReviewQuestionDemandDetail?planDemandId='+cast(pd.id as nvarchar(50))
            else ''
            end) as TaskDetailUrl,
            pd.id as taskId,
            pro.ProjectName
            from taobaoent.dbo.iFreeTaskManage_PlanDemands pd
            inner join taobaoent.dbo.iFreeTaskManage_Demands d on pd.demandId=d.RequestId
            inner join taobaoent.dbo.iFreeTaskManage_Plans p on pd.planId=p.Id
            inner join taobaoent.dbo.wf_TDMSProject pro on p.projectId=pro.RequestId
            where d.Status in (1,2) and OwnersHidden like '%{0}%'", user.ID)).List<object[]>().Select(o => new TaskInfo()
                {
                    ID = o[6].ToString(),
                    Body = string.Format("{0}\n\n{1}\n\n{2}\n\n{3}\n\n{4}", o[0], o[1], o[2], o[3], o[4]),
                    DueTime = DateTime.TryParse((o[4] ?? string.Empty).ToString(), out due) ? due.ToString("yyyy-MM-dd") : null,
                    IsCompleted = false,
                    Priority = 0,
                    Subject = string.Format("{0} - {1}", o[1], o[7]),
                    Editable = false

                }).ToArray();
        }
コード例 #3
0
 private TaskInfo[] FetchWf(ArkConnection ark)
 {
     DateTime due;
     return this.GetTasks(ark.Name).Select(o => new TaskInfo()
     {
         ID = o.No,
         Body = string.Format("{0}\n\n{1}\n\n{2}\n\n{3}\n\n{4}"
             , o.Source.Definition.Description
             , o.Title
             , o.Content
             , o.Source.Title
             , o.Uri),
         DueTime = DateTime.TryParse(o.CreateTime, out due) ? due.Date.ToString("yyyy-MM-dd") : null,
         IsCompleted = false,
         Priority = 0,
         Subject = string.Format("【{0}】{1}", o.Source.Definition.Description, o.Source.Title),
         Editable = false
     }).ToArray();
 }