示例#1
0
        private void DoBatchDelete()
        {
            IList <object> idList = RequestData.GetList <object>("IdList");

            if (idList != null && idList.Count > 0)
            {
                A_TaskWBS.DoBatchDelete(idList.ToArray());
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            A_TaskWBS ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <A_TaskWBS>();
                ent.Delete();
                this.SetMessage("删除成功!");
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    IList <object> idList = RequestData.GetList <object>("IdList");

                    if (idList != null && idList.Count > 0)
                    {
                        A_TaskWBS.DoBatchDelete(idList.ToArray());
                    }
                }
                else
                {
                    SearchCriterion.SetSearch("DutyId", this.UserInfo.UserID);
                    SearchCriterion.SetOrder("SubmitDate", false);
                    string dateFlag = this.RequestData["Date"] == null ? "180" : this.RequestData["Date"].ToString();
                    switch (dateFlag)
                    {
                    case "3":
                        SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddDays(-3), SearchModeEnum.GreaterThanEqual);
                        break;

                    case "7":
                        SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddDays(-7), SearchModeEnum.GreaterThanEqual);
                        break;

                    case "14":
                        SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddDays(-14), SearchModeEnum.GreaterThanEqual);
                        break;

                    case "30":
                        SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddMonths(-1), SearchModeEnum.GreaterThanEqual);
                        break;

                    case "31":
                        SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddMonths(-1), SearchModeEnum.LessThanEqual);
                        break;

                    case "180":
                        SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddMonths(3), SearchModeEnum.LessThanEqual);
                        break;
                    }
                    if (this.RequestData.Get <string>("Status") == "0")
                    {
                        ents = A_TaskWBS.FindAll(SearchCriterion, Expression.IsNull("Tag"));
                    }
                    else
                    {
                        ents = A_TaskWBS.FindAll(SearchCriterion, Expression.IsNotNull("Tag"));
                    }
                    this.PageState.Add("SysWorkFlowTaskList", ents);
                }
                break;
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            A_TaskWBS ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <A_TaskWBS>();
                ent.Delete();
                this.SetMessage("删除成功!");
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    IList <object> idList = RequestData.GetList <object>("IdList");

                    if (idList != null && idList.Count > 0)
                    {
                        A_TaskWBS.DoBatchDelete(idList.ToArray());
                    }
                }
                else if (RequestActionString == "batchsubmit")
                {
                    IList <object> idList = RequestData.GetList <object>("IdList");

                    if (idList != null && idList.Count > 0)
                    {
                        A_TaskWBS[] tents = A_TaskWBS.FindAll(Expression.In("Id", idList.ToArray()));
                        foreach (A_TaskWBS tent in tents)
                        {
                            tent.State = "2";
                            tent.Save();
                        }
                    }
                }
                else if (RequestActionString == "batchback")
                {
                    IList <object> idList = RequestData.GetList <object>("IdList");

                    if (idList != null && idList.Count > 0)
                    {
                        A_TaskWBS[] tents = A_TaskWBS.FindAll(Expression.In("Id", idList.ToArray()));
                        foreach (A_TaskWBS tent in tents)
                        {
                            tent.State = "1";
                            tent.Save();
                        }
                    }
                }
                else
                {
                    if (SearchCriterion.Orders.Count == 0)
                    {
                        SearchCriterion.Orders.Add(new OrderCriterionItem("PlanEndDate", true));
                    }
                    string dateFlag = this.RequestData["Date"] == null ? "365" : this.RequestData["Date"].ToString();
                    switch (dateFlag)
                    {
                    case "3":
                        SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(3), SearchModeEnum.LessThanEqual);
                        break;

                    case "7":
                        SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(7), SearchModeEnum.LessThanEqual);
                        break;

                    case "14":
                        SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(14), SearchModeEnum.LessThanEqual);
                        break;

                    case "30":
                        SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(1), SearchModeEnum.LessThanEqual);
                        break;

                    case "31":
                        SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(1), SearchModeEnum.LessThanEqual);
                        break;

                    case "180":
                        SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(3), SearchModeEnum.LessThanEqual);
                        break;

                    case "365":
                        SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddYears(1), SearchModeEnum.LessThanEqual);
                        break;
                    }
                    if (this.RequestData.Get <string>("Status") == "2")
                    {
                        ents = A_TaskWBS.FindAll(SearchCriterion, Expression.Sql(" ParentId in (select Id from " + db + "..A_TaskWBS where DutyId like '%" + this.UserInfo.UserID + "%' )  and State='2'"));
                    }
                    else
                    {
                        ents = A_TaskWBS.FindAll(SearchCriterion, Expression.Sql(" ParentId in (select Id from " + db + "..A_TaskWBS where DutyId like '%" + this.UserInfo.UserID + "%' ) and State='1.5'"), Expression.IsNotNull("ParentID"));
                    }
                    this.PageState.Add("SysWorkFlowTaskList", ents);
                }
                break;
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id   = RequestData.Get <string>("id", String.Empty);
            ids  = RequestData.GetList <string>("ids");
            pids = RequestData.GetList <string>("pids");
            year = RequestData.Get <string>("Year", String.Empty);

            A_TaskWBS ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Update:
                ent          = this.GetMergedData <A_TaskWBS>();
                ent.ParentID = String.IsNullOrEmpty(ent.ParentID) ? null : ent.ParentID;
                ent.Update();
                this.SetMessage("更新成功!");
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    IList <object> idList = RequestData.GetList <object>("IdList");
                    if (idList != null && idList.Count > 0)
                    {
                        A_TaskWBS.DoBatchDelete(idList.ToArray());
                    }
                }
                else if (RequestActionString == "paste")
                {
                    DoPaste();
                }
                else if (RequestActionString == "submittask")
                {
                    ent                = A_TaskWBS.Find(this.RequestData.Get <string>("Id"));
                    ent.State          = "1";
                    ent.SubmitDate     = DateTime.Now;
                    ent.SubmitUserId   = this.UserInfo.UserID;
                    ent.SubmitUserName = this.UserInfo.Name;
                    ent.Save();
                }
                else if (RequestActionString == "backtask")
                {
                    ent       = A_TaskWBS.Find(this.RequestData.Get <string>("Id"));
                    ent.State = "0";
                    ent.Save();
                }
                else
                {
                    DoSelect();
                    this.PageState.Add("BudgetType", SysEnumeration.GetEnumDict("BudgetType"));
                    this.PageState.Add("Years", SysEnumeration.GetEnumDict("Year"));
                    this.PageState.Add("AimType", SysEnumeration.GetEnumDict("AimType"));
                }
                if (this.RequestData.Get <string>("ChartSearch") == "T")
                {
                    string    sql      = "select Name TaskType,0 CountFinish,0 CountNormal from dbo.SysEnumeration where ParentId='5cf5990a-a68d-40b7-8ae5-558b1732cc92'";
                    DataTable dt       = DataHelper.QueryDataTable(sql);
                    string    sqlAll   = "";
                    string    deptName = this.RequestData.Get <string>("DeptName");
                    string    Year     = this.RequestData.Get <string>("Year");
                    DataTable newDt    = new DataTable();
                    foreach (DataColumn col in dt.Columns)
                    {
                        newDt.Columns.Add(col.ColumnName, col.DataType);
                    }
                    foreach (DataRow row in dt.Rows)
                    {
                        DataRow newrow = newDt.NewRow();
                        newrow.ItemArray = row.ItemArray;
                        newDt.Rows.Add(newrow);
                        string rootId = DataHelper.QueryValue <string>("select isnull(Id,'') from " + db + "..A_TaskWBS where (DeptName='" + deptName + "' or DutyName='" + deptName + "') and Year='" + year + "' and TaskType='" + row["TaskType"].ToString() + "'");
                        newrow["CountFinish"] = DataHelper.QueryValue("select isnull(count(*),0) from " + db + "..A_TaskWBS where (DeptName='" + deptName + "' or DutyName='" + deptName + "') and Year='" + year + "' and Path like '%" + rootId + "%' and State='2'");
                        newrow["CountNormal"] = DataHelper.QueryValue("select isnull(count(*),0) from " + db + "..A_TaskWBS where (DeptName='" + deptName + "' or DutyName='" + deptName + "') and Year='" + year + "' and Path like '%" + rootId + "%' and State<>'2'");
                    }
                    this.PageState.Add("ChartData", DataHelper.DataTableToDictList(newDt));
                }

                break;
            }
        }