コード例 #1
0
ファイル: codelist.aspx.cs プロジェクト: zxl881203/src
 protected void Page_Load(object sender, EventArgs e)
 {
     this.hdnstate.Value = base.Request.QueryString["r"];
     this._CodeList      = this.HdnCodeUse.Value.Split(new char[]
     {
         '^'
     });
     if (!this.Page.IsPostBack)
     {
         if (base.Request.Params["tid"] == null || base.Request.Params["w"] == null)
         {
             this.JS.Text = "alert('参数错误');window.returnValue=false;window.close();";
             return;
         }
         DataTable dataTable = CodingAction.CodeInfoListType(base.Request.Params["tid"].ToString());
         if (dataTable != null)
         {
             this.TypeID          = Convert.ToInt32(dataTable.Rows[0]["TypeID"].ToString());
             this.HdnTypeID.Value = this.TypeID.ToString();
             if (base.Request.Params["w"] == "0")
             {
                 this.BtnClose.Visible = false;
             }
         }
         this.Page_CustomInit();
         this.TblCodeTree_Create(true);
         this.BtnDel.Attributes["onclick"] = "javascript:if(!confirm('删除该数据可能造成数据不完整,\\r\\n 确定要删除当前选中数据吗?')){return false;}";
     }
 }
コード例 #2
0
ファイル: DictTree.aspx.cs プロジェクト: zxl881203/src
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Response.Cache.SetNoStore();
        if (!string.IsNullOrEmpty(base.Request["pc"]))
        {
            this.prjId = base.Request["pc"];
            PTPrjInfoService pTPrjInfoService = new PTPrjInfoService();
            PTPrjInfo        byId             = pTPrjInfoService.GetById(this.prjId);
            this.prjCode = byId.PrjCode;
        }
        if (!string.IsNullOrEmpty(base.Request["opType"]))
        {
            this.opType = base.Request["opType"].Trim();
        }
        if (base.Request["codetype"] != "")
        {
            this.DictTypeID = base.Request["codetype"];
        }
        else
        {
            base.Response.End();
        }
        if (!this.Page.IsPostBack)
        {
            this.TvDict.Nodes.Clear();
            this.TvDict.Target = "FraCodeList2";
            TreeNode treeNode = new TreeNode();
            treeNode.Text        = "选择类型";
            treeNode.Value       = "0";
            treeNode.NavigateUrl = "~/EPC/UserControl1/webNullTS.aspx";
            string dictTypeID;
            if ((dictTypeID = this.DictTypeID) != null)
            {
                if (dictTypeID == "Img")
                {
                    treeNode.Text        = "图纸类型";
                    treeNode.NavigateUrl = string.Concat(new string[]
                    {
                        "/OPM/Business_Data/Business_Data_Manage.aspx?w=0&codeid=0&codetype=",
                        base.Request["codetype"].ToString(),
                        "&pc=",
                        base.Request["pc"].ToString(),
                        "&isshowall=false&opType=",
                        this.opType,
                        "&PrjCode=",
                        this.prjCode
                    });
                    goto IL_271;
                }
                if (dictTypeID == "211")
                {
                    treeNode.NavigateUrl = string.Concat(new string[]
                    {
                        "/OPM/FireManage/FireManageList.aspx?w=0&codeid=0&codetype=",
                        base.Request["codetype"].ToString(),
                        "&pc=",
                        base.Request["pc"].ToString(),
                        "&opType=",
                        this.opType,
                        "&PrjCode=",
                        this.prjCode
                    });
                    goto IL_271;
                }
            }
            treeNode.NavigateUrl = "~/EPC/UserControl1/webNullTS.aspx";
IL_271:
            if (this.DictTypeID == "Img")
            {
                if (this.opType == "img")
                {
                    treeNode.Text        = "图纸类型";
                    treeNode.NavigateUrl = string.Concat(new string[]
                    {
                        "/OPM/Business_Data/Business_Data_Main.aspx?w=0&codeid=0&codetype=",
                        base.Request["codetype"].ToString(),
                        "&pc=",
                        base.Request["pc"].ToString(),
                        "&isshowall=false&opType=",
                        this.opType,
                        "&PrjCode=",
                        this.prjCode
                    });
                }
                if (this.opType == "view")
                {
                    treeNode.Text        = "图纸类型";
                    treeNode.NavigateUrl = string.Concat(new string[]
                    {
                        "/OPM/Business_Data/Business_Data_Main.aspx?w=0&codeid=0&codetype=",
                        base.Request["codetype"].ToString(),
                        "&pc=",
                        base.Request["pc"].ToString(),
                        "&isshowall=false&opType=",
                        this.opType,
                        "&PrjCode=",
                        this.prjCode
                    });
                }
            }
            treeNode.Target   = "FraCodeList3";
            treeNode.Selected = true;
            this.TvDict.Nodes.Add(treeNode);
            DataTable dataTable = CodingAction.CodeInfoListType(this.DictTypeID);
            DataTable dt        = CodingAction.CodeInfoList(dataTable.Rows[0]["TypeID"].ToString());
            this.CreateDictTree(0, dt, treeNode);
        }
    }
コード例 #3
0
    public void GetStage()
    {
        string prjcode     = this.txtCode.Text.Trim();
        string prjname     = this.txtPrjName.Text.Trim();
        string strSignCode = string.Empty;

        if (!string.IsNullOrEmpty(base.Request.Params["businessType"].ToString()))
        {
            strSignCode = base.Request.Params["businessType"].ToString();
        }
        DataTable dataTable = CodingAction.CodeInfoListType(strSignCode);

        this.dt = publicDbOpClass.DataTableQuary("select codeID,codeName from XPM_Basic_CodeList where TypeID=" + System.Convert.ToInt32(dataTable.Rows[0]["TypeID"].ToString()) + " and [IsValid]='true' and ChildNumber=0  order by I_xh");
        DataTable dataTable2 = new DataTable();

        dataTable2.Columns.Add("项目名称");
        dataTable2.Columns.Add("uid");
        dataTable2.Columns.Add("prjID");
        dataTable2.Columns.Add("PrjCode");
        for (int i = 0; i < this.dt.Rows.Count; i++)
        {
            dataTable2.Columns.Add("计划日期" + i.ToString());
            dataTable2.Columns.Add("实际日期" + i.ToString());
            dataTable2.Columns.Add("状态" + i.ToString());
        }
        PTPrjInfoBll pTPrjInfoBll = new PTPrjInfoBll();
        int          projectCount = pTPrjInfoBll.GetProjectCount(base.UserCode, prjcode, prjname);

        this.AspNetPager1.RecordCount = projectCount;
        DataTable project = pTPrjInfoBll.GetProject(base.UserCode, prjcode, prjname, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize);

        foreach (DataRow dataRow in project.Rows)
        {
            string  text     = dataRow["prjGuid"].ToString();
            string  text2    = dataRow["prjName"].ToString();
            string  value    = dataRow["PrjCode"].ToString();
            DataRow dataRow2 = dataTable2.NewRow();
            if (text2.Length > 20)
            {
                dataRow2["项目名称"] = text2.Substring(1, 20) + "...";
            }
            else
            {
                dataRow2["项目名称"] = text2;
            }
            dataRow2["prjID"]   = text;
            dataRow2["PrjCode"] = value;
            for (int j = 0; j < this.dt.Rows.Count; j++)
            {
                string value2 = "--";
                string value3 = "--";
                string text3  = "--";
                string text4  = this.dt.Rows[j]["codeID"].ToString();
                this.dt.Rows[j]["codeName"].ToString();
                string text5 = "\r\n                 select top (1) UID,enddate FROM [OPM_Business_Data]  \r\n                 left join WF_Instance_Main on InstanceCode=uid inner join WF_Instance   on WF_Instance.ID=WF_Instance_Main.ID \r\n                 where [IsValid]=1 and flowstate=1 and btype='img' ";
                string text6 = text5;
                text5 = string.Concat(new string[]
                {
                    text6,
                    "and [prjid]='",
                    text,
                    "' and [codeID]='",
                    text4,
                    "'  order by AuditDate desc"
                });
                DataTable dataTable3 = publicDbOpClass.DataTableQuary(text5.ToString());
                if (dataTable3.Rows.Count > 0)
                {
                    string text7 = dataTable3.Rows[0][0].ToString();
                    if (dataTable3.Rows[0]["enddate"].ToString() != "")
                    {
                        value2 = System.Convert.ToDateTime(dataTable3.Rows[0]["enddate"].ToString()).ToString("yyyy-MM-dd");
                    }
                    if ((int)publicDbOpClass.ExecuteScalar("select count(*) FROM [OPM_Business_Dataitem] where flowstate='1' and codeid='" + text7 + "'") > 0)
                    {
                        string text8 = "select top(1) AuditDate FROM [OPM_Business_Dataitem] \r\n                        left join WF_Instance_Main on InstanceCode=uid inner join WF_Instance   on WF_Instance.ID=WF_Instance_Main.ID where   flowstate='1' ";
                        text8 = text8 + " and codeid='" + text7 + "' order by AuditDate desc ";
                        if (System.Convert.ToDateTime(publicDbOpClass.ExecuteScalar(text8)).ToString("yyyy-MM-dd") != "0001-01-01")
                        {
                            value3 = System.Convert.ToDateTime(publicDbOpClass.ExecuteScalar(text8)).ToString("yyyy-MM-dd");
                        }
                        text3 = "1";
                    }
                    else
                    {
                        DataTable dataTable4 = publicDbOpClass.DataTableQuary("select top(1)flowstate FROM [OPM_Business_Dataitem] where codeid='" + text7 + "' order by addtime");
                        if (dataTable4.Rows.Count > 0)
                        {
                            text3 = dataTable4.Rows[0][0].ToString();
                        }
                        else
                        {
                            text3 = "-1";
                        }
                    }
                    dataRow2["uid"] = text7;
                }
                dataRow2[3 * j + 4] = value2;
                dataRow2[3 * j + 5] = value3;
                dataRow2[3 * j + 6] = ((text3 == "--") ? "--" : Business_Data_Schedule.GetState(text3));
            }
            dataTable2.Rows.Add(dataRow2);
        }
        this.gvStageSchedule.DataSource = dataTable2;
        this.gvStageSchedule.DataBind();
    }