WorkFlowConfigureNew.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:5k
源码类别:

.net编程

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using com.etong.DAL.FC;
  12. public partial class Workflow_WorkFlowConfigureNew : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         if (!IsPostBack)
  17.         {
  18.             EtongFlyChouWF EFlyWF = new EtongFlyChouWF();
  19.             DataView dv = new DataView();
  20.             dv=EFlyWF.GetWFKind();
  21.             StartWFOwn.DataSource = dv;
  22.             StartWFOwn.DataTextField = "KindName";
  23.             StartWFOwn.DataValueField = "KindID";
  24.             StartWFOwn.DataBind();
  25.             dv = EFlyWF.GetWFStaticPage();
  26.             StartWFPage.DataSource = dv;
  27.             StartWFPage.DataTextField = "PageUrl";
  28.             StartWFPage.DataValueField = "StaticPageID";
  29.             StartWFPage.DataBind();
  30.             StartControlVisible(2);
  31.         }
  32.     }
  33.     /// <summary>
  34.     /// 设置控键的可见属性
  35.     /// </summary>
  36.     /// <param name="flag">
  37.     ///1、可见;2、不可见; 
  38.     ///</param>
  39.     protected void StartControlVisible(int flag)
  40.     {
  41.         if (flag == 1)
  42.         {
  43.             StartID.Visible = true;
  44.             StartWFDecs.Visible = true;
  45.             StartWFName.Visible = true;
  46.             StartWFOwn.Visible = true;
  47.             StartWFPage.Visible = true;
  48.             LStartWFDecs.Visible = true;
  49.             LStartWFName.Visible = true;
  50.             LStartWFOwn.Visible = true;
  51.             LStartWFPage.Visible = true;
  52.             AddActive.Enabled = false;
  53.         }
  54.         else
  55.         {
  56.             StartID.Visible = false;
  57.             StartWFDecs.Visible = false;
  58.             StartWFName.Visible = false;
  59.             StartWFOwn.Visible = false;
  60.             StartWFPage.Visible = false;
  61.             LStartWFDecs.Visible = false;
  62.             LStartWFName.Visible = false;
  63.             LStartWFOwn.Visible = false;
  64.             LStartWFPage.Visible = false;
  65.             AddActive.Enabled = true;
  66.         }
  67.     }
  68.     protected void AddActive_Click(object sender, ImageClickEventArgs e)
  69.     {
  70.         StartControlVisible(1);
  71.     }
  72.     //protected void ImgOffset_Click(object sender, ImageClickEventArgs e)
  73.     //{
  74.     //    string strscript;
  75.     //    //strscript = "<script> var i=0;var R=TBStart.insertRow();var C1=R.insertCell();C1.innerHTML=" + "<input type='text' name='TB_EquipmentName" + "+i+" + "'>";
  76.     //    //ClientScript.RegisterStartupScript(this.GetType(), "", strscript, true);
  77.     //    //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>var i=0;function   insert_row() { var R=TBStart.insertRow();" +
  78.     //    //+ "var C1=R.insertCell();C1.innerHTML=" + "<input type='text'   name='TB_EquipmentName" + "+i+" + "'>" + ";" + 
  79.     //    //+ "document.getElementById('TB_EquipmentName' + i).innerText='TB_EquipmentName'+i;" +  
  80.     //    //+ "document.getElementById('TB_EquipmentName' + i).style.width='120px';" +
  81.     //    //+ "C1.style.width='120px';}</script>",true);
  82.     //}
  83.     protected void ImgSave_Click(object sender, ImageClickEventArgs e)
  84.     {
  85.         //int icount;
  86.         TextBox ActBox = new TextBox();
  87.         ActBox.ID = "ActName";
  88.         ActBox.Text = "actName";
  89.         Pnl.Controls.Add(ActBox);
  90.         TextBox actn = new TextBox();
  91.         actn.ID = "aa";
  92.         actn.Text = "11";
  93.         Pnl.Controls.Add(actn);
  94.         //TBStart
  95.     }
  96.     /// <summary>
  97.     /// 获得控件个数
  98.     /// </summary>
  99.     public int iAddCount { 
  100.         get 
  101.         { 
  102.             return ViewState["Counts"]!=null?(int)ViewState["Counts"]:0;
  103.         } 
  104.         set 
  105.         { 
  106.             ViewState["Counts"]=value;
  107.         }
  108.     } 
  109.     /// <summary>
  110.     /// 动态增加控件
  111.     /// </summary>
  112.     /// <param name="i"></param>
  113.     public void AddControls(int i) 
  114.     { 
  115.         TextBox t=new TextBox(); 
  116.         t.ID="TextBox"+i.ToString(); 
  117.         this.Pnl.Controls.Add(t); 
  118.     } 
  119.     //private void btnAddCtl_Click(object sender, System.EventArgs e) { 
  120.     //    TextBox t=new TextBox(); 
  121.     //    t.ID="TextBox"+Convert.ToString(this.Pnl.Controls.Count+1); 
  122.     //    this.Pnl.Controls.Add(t); 
  123.     //    iAddCount=this.Pnl.Controls.Count; 
  124.     //} 
  125.     private void btnSave(object sender,EventArgs e) 
  126.     {
  127.         #region //保存电影地址
  128.         foreach(Control o in this.Pnl.Controls) 
  129.         { 
  130.             if(o.GetType()==typeof(TextBox)) 
  131.             { 
  132.                 //ObjVodUrlTB vod=new ObjVodUrlTB();
  133.                 //vod.NewsID=NewsID; 
  134.                 //vod.MovieUrl=((TextBox)o).Text.Trim(); 
  135.                 //vod.Save(); 
  136.             } 
  137.         } 
  138.         #endregion 
  139.     } 
  140.     //private void Page_Load(object sender, System.EventArgs e) 
  141.     //{ 
  142.     //    //动态添加的控件 
  143.     //    for(int i=1;i<=this.iAddCount;i++)
  144.     //    { 
  145.     //        this.AddControls(i); 
  146.     //    } 
  147.     //} 
  148. }