Beispiel #1
0
        public static void BindDropDownTree(DropDownTree ddv, int typeID)
        {
            CodingInfoCollection infos = new CodingAction().QueryCodeInfoList(typeID, ValidState.Valid);
            DataTable            table = new DataTable();

            table.Columns.Add(new DataColumn("CodeID", typeof(int)));
            table.Columns.Add(new DataColumn("ParentCodeID", typeof(int)));
            table.Columns.Add(new DataColumn("CodeName", typeof(string)));
            int     count = infos.Count;
            DataRow row   = table.NewRow();

            row["CodeID"]       = "9999";
            row["ParentCodeID"] = "0";
            row["CodeName"]     = "全部".ToString();
            table.Rows.Add(row);
            for (int i = 0; i < count; i++)
            {
                DataRow row2 = table.NewRow();
                row2["CodeID"]       = infos[i].CodeID.ToString();
                row2["ParentCodeID"] = infos[i].ParentCodeID.ToString();
                row2["CodeName"]     = infos[i].CodeName;
                table.Rows.Add(row2);
            }
            ddv.LoadFromTable(table, false, "CodeID", "ParentCodeID", "CodeName", "CodeID");
        }
Beispiel #2
0
 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;}";
     }
 }
Beispiel #3
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.TrVCodeType.Nodes.Clear();
         this.TrVCodeType.Target = "FraCodeList";
         TreeNode treeNode = new TreeNode();
         treeNode.Text        = "选择类型";
         treeNode.NavigateUrl = "~/EPC/UserControl1/webNullTS.aspx";
         treeNode.Target      = "FraCodeList";
         this.TrVCodeType.Nodes.Add(treeNode);
         DataTable dataTable = new DataTable();
         if (base.Request["SignCode"] != null)
         {
             if (base.Request["SignCode"].ToString() != "")
             {
                 string str = base.Request["SignCode"].ToString();
                 dataTable = publicDbOpClass.DataTableQuary("SELECT [TypeID],[TypeName] FROM  [XPM_Basic_CodeType] where SignCode = '" + str + "' and  [IsVisible]=1 and [IsValid]=1");
             }
             else
             {
                 dataTable = CodingAction.QueryCodeTypeDT();
             }
         }
         for (int i = 0; i < dataTable.Rows.Count; i++)
         {
             TreeNode treeNode2 = new TreeNode();
             treeNode2.Text        = dataTable.Rows[i]["TypeName"].ToString();
             treeNode2.Value       = dataTable.Rows[i]["TypeID"].ToString();
             treeNode2.NavigateUrl = "CodeList.aspx?w=0&tid=" + treeNode2.Value;
             treeNode2.Target      = "FraCodeList";
             treeNode.ChildNodes.Add(treeNode2);
         }
     }
 }
Beispiel #4
0
        public static string QueryBasicCode(Page obj, string signCode, int typeID, int codeID)
        {
            bool      flag      = true;
            Hashtable hashtable = new Hashtable();

            if (obj.Cache[signCode] == null)
            {
                flag = false;
            }
            else
            {
                hashtable = (Hashtable)obj.Cache[signCode];
                if (hashtable == null)
                {
                    flag = false;
                }
            }
            if (!flag)
            {
                CodingInfoCollection infos = new CodingAction().QueryCodeInfoList(typeID, ValidState.All);
                int count = infos.Count;
                for (int i = 0; i < count; i++)
                {
                    hashtable.Add(infos[i].CodeID.ToString(), infos[i].CodeName);
                }
            }
            obj.Cache[signCode] = hashtable;
            return(hashtable[codeID.ToString()].ToString());
        }
Beispiel #5
0
        public static void RefreshBasicCode(Page obj, string signCode, int typeID)
        {
            Hashtable            hashtable = new Hashtable();
            CodingInfoCollection infos     = new CodingAction().QueryCodeInfoList(typeID, ValidState.All);
            int count = infos.Count;

            for (int i = 0; i < count; i++)
            {
                hashtable.Add(infos[i].CodeID.ToString(), infos[i].CodeName);
            }
            obj.Cache[signCode] = hashtable;
        }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     base.Response.Cache.SetNoStore();
     base.Response.Clear();
     if (!this.Page.IsPostBack)
     {
         this.hdnmyuser.Value             = base.UserCode;
         this.DDL_CorpKind.DataTextField  = "CodeName";
         this.DDL_CorpKind.DataValueField = "CodeID";
         this.DDL_CorpKind.DataSource     = CodingAction.getTypebyID("1");
         this.DDL_CorpKind.DataBind();
     }
 }
Beispiel #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     base.Response.Cache.SetNoStore();
     base.Response.Clear();
     if (!base.IsPostBack)
     {
         this.DDL_CorpKind.DataTextField  = "CodeName";
         this.DDL_CorpKind.DataValueField = "CodeID";
         this.DDL_CorpKind.DataSource     = CodingAction.getTypebyID("1");
         this.DDL_CorpKind.DataBind();
         if (!string.IsNullOrEmpty(base.Request["cti"]) && !string.IsNullOrEmpty(base.Request["w"]))
         {
             if (!string.IsNullOrEmpty(base.Request["Audit"]))
             {
                 this.isAudit = base.Request["Audit"].ToString().Replace("'", "");
             }
             if (!string.IsNullOrEmpty(base.Request["cti"]))
             {
                 this.CorpTypeID = Convert.ToInt32(base.Request["cti"]);
                 if (this.CorpTypeID != 4 && this.CorpTypeID != 5 && this.CorpTypeID != 10 && this.CorpTypeID != 19 && this.CorpTypeID != 20)
                 {
                     this.WF1.Type = 0;
                     this.DgrdList.Columns[8].Visible = false;
                 }
             }
             if (!string.IsNullOrEmpty(base.Request["w"]))
             {
                 this.WindowType = base.Request["w"];
             }
         }
         if (this.WindowType == "1")
         {
             this.BtnClose.Visible             = true;
             this.BtnAdd.Attributes["style"]   = "visibility:hidden";
             this.BtnClose.Attributes["style"] = "visibility:hidden";
             this.BtnDel.Attributes["style"]   = "visibility:hidden";
             this.BtnMod.Attributes["style"]   = "visibility:hidden";
         }
         this.HdnTypeID.Value = this.CorpTypeID.ToString();
         this.Page_CustomInit();
         this.DgrdList_Bind();
     }
 }
Beispiel #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.TrVCodeType.Nodes.Clear();
         this.TrVCodeType.Target = "FraCodeList";
         TreeNode treeNode = new TreeNode();
         treeNode.Text        = "选择类型";
         treeNode.NavigateUrl = "../../EPC/UserControl1/webNullTS.aspx";
         treeNode.Target      = "FraCodeList";
         this.TrVCodeType.Nodes.Add(treeNode);
         DataTable dataTable = CodingAction.QueryCodeTypeDT();
         for (int i = 0; i < dataTable.Rows.Count; i++)
         {
             TreeNode treeNode2 = new TreeNode();
             treeNode2.Text        = dataTable.Rows[i]["TypeName"].ToString();
             treeNode2.Value       = dataTable.Rows[i]["TypeID"].ToString();
             treeNode2.NavigateUrl = "CodeList.aspx?w=0&tid=" + treeNode2.Value;
             treeNode2.Target      = "FraCodeList";
             treeNode.ChildNodes.Add(treeNode2);
         }
     }
 }
Beispiel #9
0
    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);
        }
    }
Beispiel #10
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.DG.DataSource = CodingAction.CodeInfoList(base.Request["typeID"].ToString());
     this.DG.DataBind();
 }
    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();
    }