예제 #1
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        protected void BindDate()
        {
            gcqy.DataValueField = "systeminfoname";
            gcqy.DataBindEx();           //工程区域

            AREA_CODE.BindDdlArea(true); //归档移交机构
            ProjectType.DataBindEx();    //工程类别
        }
예제 #2
0
        /// <summary>
        /// 将Model值赋给控件
        /// </summary>
        /// <param name="tSingleProjectID">工程ID</param>
        public void DataBindEx(int tSingleProjectID)
        {
            CTRL_AREA.BindDdlArea(true);
            ProjectType.DataBindEx();

            if (tSingleProjectID > 0)
            {
                T_SingleProject_MDL spMdl = new T_SingleProject_BLL().GetModel(tSingleProjectID); //获取工程Model
                Comm.SetValueToPage(spMdl, tablemain);                                            //将Model值赋给控件
                int ConstructionProjectID = Common.ConvertEx.ToInt(spMdl.ConstructionProjectID);  //获取项目ID
                gcdd.Text = spMdl.gcqy + spMdl.gcdd;

                if (ConstructionProjectID > 0)
                {
                    T_Construction_Project_MDL cpMdl = new T_Construction_Project_BLL().GetModel(ConstructionProjectID);
                    if (cpMdl != null)
                    {
                        int CompanyID = Common.ConvertEx.ToInt(cpMdl.CompanyID);                        //通过项目获取单位ID
                        if (CompanyID > 0)
                        {
                            T_Company_MDL cMdl = new T_Company_BLL().GetModel(CompanyID);
                            Comm.SetValueToPage(cMdl, table_Company);
                        }
                    }

                    StringBuilder ghxkz = new StringBuilder();
                    StringBuilder sgxkz = new StringBuilder();
                    StringBuilder other = new StringBuilder();

                    //获取工程对应的所有上传证件的附件
                    List <T_FileAttach_MDL> lt_ftMdl = new T_FileAttach_BLL().GetModelList("PriKeyValue=" + tSingleProjectID.ToString());
                    foreach (T_FileAttach_MDL ftMdl in lt_ftMdl)
                    {
                        if (ftMdl.AttachCode == "ghxkz")
                        {
                            ghxkz.Append("&nbsp;&nbsp;<a style=\"color:black;\" href=\"" + ftMdl.AttachPath + "\" title='点击查看' target=\"_blank\">" + ftMdl.AttachName + "</a>&nbsp;");
                        }
                        else if (ftMdl.AttachCode == "sgxkz")
                        {
                            sgxkz.Append("&nbsp;&nbsp;<a style=\"color:black;\" href=\"" + ftMdl.AttachPath + "\" title='点击查看' target=\"_blank\">" + ftMdl.AttachName + "</a>&nbsp;");
                        }
                        else if (ftMdl.AttachCode == "other")
                        {
                            other.Append("&nbsp;&nbsp;<a style=\"color:black;\" href=\"" + ftMdl.AttachPath + "\" title='点击查看' target=\"_blank\">" + ftMdl.AttachName + "</a>&nbsp;");
                        }
                    }
                    if (ghxkz.Length > 0)
                    {
                        ltghxkz.Text = ghxkz.ToString();
                    }
                    if (sgxkz.Length > 0)
                    {
                        ltsgxkz.Text = sgxkz.ToString();
                    }
                    if (other.Length > 0)
                    {
                        ltother.Text = other.ToString();
                    }
                }
            }
        }