예제 #1
0
        public void CommitEvent(object key)
        {
            string str = ConfigHelper.Get("IsWBSRelevance");
            BudTaskChangeService   service  = new BudTaskChangeService();
            BudTaskService         service2 = new BudTaskService();
            BudTaskResourceService service3 = new BudTaskResourceService();

            cn.justwin.Domain.Entities.BudTaskChange   byId      = service.GetById(key.ToString());
            IList <cn.justwin.Domain.Entities.BudTask> byProject = service2.GetByProject(byId.PrjId, 0x3e7);
            IList <int> years = service2.GetYears(byId.PrjId);

            if (years != null)
            {
                foreach (int num in years)
                {
                    IList <cn.justwin.Domain.Entities.BudTask> yearTask = service2.GetYearTask(byProject, num);
                    foreach (cn.justwin.Domain.Entities.BudTask task in yearTask)
                    {
                        service2.Add(task);
                    }
                    foreach (int num2 in service2.GetMonths(yearTask, num))
                    {
                        foreach (cn.justwin.Domain.Entities.BudTask task2 in service2.GetMonthTasks(yearTask, num, num2))
                        {
                            service2.Add(task2);
                        }
                    }
                }
            }
            if (str == "1")
            {
                service3.AddTaskResource(byId.PrjId);
            }
        }
예제 #2
0
    private void GenerageBudgetByParent(string prjId)
    {
        PTPrjInfoService pTPrjInfoService = new PTPrjInfoService();
        PTPrjInfo        byId             = pTPrjInfoService.GetById(prjId);
        PTPrjInfo        parent           = pTPrjInfoService.GetParent(prjId);
        string           str            = byId.TypeCode.Substring(6, 4);
        BudTaskService   budTaskService = new BudTaskService();

        budTaskService.DeleteByProject(prjId);
        System.Collections.Generic.IList <cn.justwin.Domain.Entities.BudTask> byProject = budTaskService.GetByProject(parent.PrjGuid.Value.ToString(), 999);
        for (int i = 0; i < byProject.Count; i++)
        {
            cn.justwin.Domain.Entities.BudTask budTask = byProject[i];
            budTask.PrjId  = byId.PrjGuid.Value.ToString();
            budTask.TaskId = budTask.TaskId.Substring(0, 9) + str + budTask.TaskId.Substring(13);
            if (!string.IsNullOrEmpty(budTask.ParentId))
            {
                budTask.ParentId = budTask.ParentId.Substring(0, 9) + str + budTask.ParentId.Substring(13);
            }
            budTaskService.Add(budTask);
        }
        this.BindGv();
    }
예제 #3
0
    protected void btnSaveTemplate_Click(object sender, System.EventArgs e)
    {
        string   text     = string.Empty;
        CheckBox checkBox = this.gvBudget.HeaderRow.Cells[0].FindControl("cbAllBox") as CheckBox;

        if (checkBox != null)
        {
            if (checkBox.Checked)
            {
                BudTaskService budTaskService = new BudTaskService();
                System.Collections.Generic.IList <cn.justwin.Domain.Entities.BudTask> byProject = budTaskService.GetByProject(this.prjId, 999);
                foreach (cn.justwin.Domain.Entities.BudTask current in byProject)
                {
                    text = text + "\"" + current.TaskId + "\",";
                }
                if (byProject.Count == 1)
                {
                    text = text.Substring(1, text.Length - 2);
                }
                else
                {
                    text = "[" + text.Substring(0, text.Length - 1) + "]";
                }
            }
            else
            {
                text = this.hfldCheckedIds.Value;
            }
        }
        this.Session["taskIds"] = text;
        base.RegisterScript("saveTem()");
    }
예제 #4
0
        public void CommitEvent(object key)
        {
            BudModifyService       service  = new BudModifyService();
            BudTaskService         service2 = new BudTaskService();
            BudModifyTaskService   service3 = new BudModifyTaskService();
            BudTaskResourceService service4 = new BudTaskResourceService();
            ConPayoutModifyService service5 = new ConPayoutModifyService();
            string    modifyId  = key.ToString();
            BudModify budmodify = (from r in service
                                   where r.ModifyId == modifyId
                                   select r).FirstOrDefault <BudModify>();
            ConPayoutModify item = (from r in service5
                                    where r.BudModifyId == modifyId
                                    select r).FirstOrDefault <ConPayoutModify>();

            if (item != null)
            {
                item.FlowState = 1;
                service5.Update(item);
            }
            using (List <BudModifyTask> .Enumerator enumerator = (from p in service3
                                                                  where p.ModifyId == budmodify.ModifyId
                                                                  select p).ToList <BudModifyTask>().GetEnumerator())
            {
                BudModifyTask taskx;
                while (enumerator.MoveNext())
                {
                    taskx = enumerator.Current;
                    cn.justwin.Domain.Entities.BudTask task = (from p in service2
                                                               where p.TaskId == taskx.TaskId
                                                               select p).FirstOrDefault <cn.justwin.Domain.Entities.BudTask>();
                    if ((task != null) && (budmodify.Flowstate == 1))
                    {
                        if (taskx.ModifyType == 0)
                        {
                            task.IsValid = true;
                            service2.Update(task);
                            service3.UpdateTotal2(taskx.ModifyTaskId);
                        }
                        if ((task.ModifyId != task.ModifyId) || (taskx.ModifyType == 1))
                        {
                            task.ModifyId = task.ModifyId;
                            if (!task.Total2.HasValue)
                            {
                                task.Total2 = 0;
                            }
                            if (!task.Quantity.HasValue)
                            {
                                task.Quantity = 0;
                            }
                            task.Total2   = new decimal?(Convert.ToDecimal(task.Total2) + Convert.ToDecimal(task.Total2));
                            task.Quantity = new decimal?(Convert.ToDecimal(task.Quantity) + Convert.ToDecimal(task.Quantity));
                            if (task.Quantity != 0M)
                            {
                                task.UnitPrice = task.Total2 / task.Quantity;
                            }
                            service2.Update(task);
                            service3.UpdateTotal2(taskx.ModifyTaskId);
                        }
                    }
                }
            }
            if (ConfigHelper.Get("BudgetRequireDiff") != "0")
            {
                string    str2 = ConfigHelper.Get("IsWBSRelevance");
                BudModify byId = service.GetById(key.ToString());
                service2.DeleteYearMonthByPrj(byId.PrjId);
                IList <cn.justwin.Domain.Entities.BudTask> byProject = service2.GetByProject(byId.PrjId, 0x3e7);
                IList <int> years = service2.GetYears(byId.PrjId);
                if (years != null)
                {
                    foreach (int num in years)
                    {
                        IList <cn.justwin.Domain.Entities.BudTask> yearTask = service2.GetYearTask(byProject, num);
                        foreach (cn.justwin.Domain.Entities.BudTask task2 in yearTask)
                        {
                            service2.Add(task2);
                        }
                        foreach (int num2 in service2.GetMonths(yearTask, num))
                        {
                            foreach (cn.justwin.Domain.Entities.BudTask task3 in service2.GetMonthTasks(yearTask, num, num2))
                            {
                                service2.Add(task3);
                            }
                        }
                    }
                    if (str2 == "1")
                    {
                        service4.AddTaskResource(byId.PrjId);
                    }
                }
            }
        }