设置子信息

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Salien.Utility.SUWF;
using Salien.Utility;

namespace SBExpandDevelop
{
    public partial class FactoryPage_PUPage : SlnSuwfPage
    {
        protected override void OnInit(EventArgs e)
        {
            this.InitPage();
            base.OnInit(e);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.SetCardFrame();
            }
        }
        private void InitPage()
        {
            //加载用户程序单元
            this.LoadUnit();
            //构造域控件
            this.BuildFieldControls();
        }

        protected void SetCardFrame()
        {
            string strPU = this.GetValueByName("PU");
            string strPKValue = this.GetValueByName("PKValue");
            string strIsQuery = this.GetValueByName("VisitedType"); //标示访问类型
            if (strIsQuery == "") strIsQuery = "-1";

            string strApplication = this.GetValueByName("AppID"); //修改申请单编码
            if (strApplication == "") strApplication = "-1";
            if (string.IsNullOrEmpty(strPKValue))
            {
                return;
            }

            string strFile = string.Empty;
            bool isFirst = true;

            string strSql = string.Format(@"select datainfo_pubm,a.u_name from obj_datainfo_tb a 
              where   a.class_id in (select sbxl_bm from jc_sb_tb where obj_id= {0} ) order by a.u_order", strPKValue);
            DataTable dt = SlnDataAccess.GetDataTable(strSql);
            foreach (DataRow row in dt.Rows)
            {
                HtmlInputButton  btnSubInfo = new HtmlInputButton();
                btnSubInfo.Value = row[1].ToString();
                btnSubInfo.Attributes.Add("class", "Button_tab");
                strFile = string.Format("CardPage.aspx?pu={0}&&pkvalue={1}&&VisitedType={2}&&AppID={3}", row[0].ToString(), strPKValue, strIsQuery, strApplication);
                if (isFirst)
                {
                    this.cardframe.Attributes.Add("src", strFile);
                    btnSubInfo.Attributes.Add("style", "color:red");
                    isFirst = false;
                }
                btnSubInfo.Attributes.Add("onclick", "SubInfoButtonClick(this,'" + strFile + "')");
                this.phSubInfo.Controls.Add(btnSubInfo);
            }
        }
    }
}

 

posted @ 2025-07-06 08:00  知行一体2  阅读(8)  评论(0)    收藏  举报