WorkFlowConfigureNew.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:5k
源码类别:
.net编程
开发平台:
C#
- 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 com.etong.DAL.FC;
- public partial class Workflow_WorkFlowConfigureNew : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- EtongFlyChouWF EFlyWF = new EtongFlyChouWF();
- DataView dv = new DataView();
- dv=EFlyWF.GetWFKind();
- StartWFOwn.DataSource = dv;
- StartWFOwn.DataTextField = "KindName";
- StartWFOwn.DataValueField = "KindID";
- StartWFOwn.DataBind();
- dv = EFlyWF.GetWFStaticPage();
- StartWFPage.DataSource = dv;
- StartWFPage.DataTextField = "PageUrl";
- StartWFPage.DataValueField = "StaticPageID";
- StartWFPage.DataBind();
- StartControlVisible(2);
- }
- }
- /// <summary>
- /// 设置控键的可见属性
- /// </summary>
- /// <param name="flag">
- ///1、可见;2、不可见;
- ///</param>
- protected void StartControlVisible(int flag)
- {
- if (flag == 1)
- {
- StartID.Visible = true;
- StartWFDecs.Visible = true;
- StartWFName.Visible = true;
- StartWFOwn.Visible = true;
- StartWFPage.Visible = true;
- LStartWFDecs.Visible = true;
- LStartWFName.Visible = true;
- LStartWFOwn.Visible = true;
- LStartWFPage.Visible = true;
- AddActive.Enabled = false;
- }
- else
- {
- StartID.Visible = false;
- StartWFDecs.Visible = false;
- StartWFName.Visible = false;
- StartWFOwn.Visible = false;
- StartWFPage.Visible = false;
- LStartWFDecs.Visible = false;
- LStartWFName.Visible = false;
- LStartWFOwn.Visible = false;
- LStartWFPage.Visible = false;
- AddActive.Enabled = true;
- }
- }
- protected void AddActive_Click(object sender, ImageClickEventArgs e)
- {
- StartControlVisible(1);
- }
- //protected void ImgOffset_Click(object sender, ImageClickEventArgs e)
- //{
- // string strscript;
- // //strscript = "<script> var i=0;var R=TBStart.insertRow();var C1=R.insertCell();C1.innerHTML=" + "<input type='text' name='TB_EquipmentName" + "+i+" + "'>";
- // //ClientScript.RegisterStartupScript(this.GetType(), "", strscript, true);
- // //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>var i=0;function insert_row() { var R=TBStart.insertRow();" +
- // //+ "var C1=R.insertCell();C1.innerHTML=" + "<input type='text' name='TB_EquipmentName" + "+i+" + "'>" + ";" +
- // //+ "document.getElementById('TB_EquipmentName' + i).innerText='TB_EquipmentName'+i;" +
- // //+ "document.getElementById('TB_EquipmentName' + i).style.width='120px';" +
- // //+ "C1.style.width='120px';}</script>",true);
- //}
- protected void ImgSave_Click(object sender, ImageClickEventArgs e)
- {
- //int icount;
- TextBox ActBox = new TextBox();
- ActBox.ID = "ActName";
- ActBox.Text = "actName";
- Pnl.Controls.Add(ActBox);
- TextBox actn = new TextBox();
- actn.ID = "aa";
- actn.Text = "11";
- Pnl.Controls.Add(actn);
- //TBStart
- }
- /// <summary>
- /// 获得控件个数
- /// </summary>
- public int iAddCount {
- get
- {
- return ViewState["Counts"]!=null?(int)ViewState["Counts"]:0;
- }
- set
- {
- ViewState["Counts"]=value;
- }
- }
- /// <summary>
- /// 动态增加控件
- /// </summary>
- /// <param name="i"></param>
- public void AddControls(int i)
- {
- TextBox t=new TextBox();
- t.ID="TextBox"+i.ToString();
- this.Pnl.Controls.Add(t);
- }
- //private void btnAddCtl_Click(object sender, System.EventArgs e) {
- // TextBox t=new TextBox();
- // t.ID="TextBox"+Convert.ToString(this.Pnl.Controls.Count+1);
- // this.Pnl.Controls.Add(t);
- // iAddCount=this.Pnl.Controls.Count;
- //}
- private void btnSave(object sender,EventArgs e)
- {
- #region //保存电影地址
- foreach(Control o in this.Pnl.Controls)
- {
- if(o.GetType()==typeof(TextBox))
- {
- //ObjVodUrlTB vod=new ObjVodUrlTB();
- //vod.NewsID=NewsID;
- //vod.MovieUrl=((TextBox)o).Text.Trim();
- //vod.Save();
- }
- }
- #endregion
- }
- //private void Page_Load(object sender, System.EventArgs e)
- //{
- // //动态添加的控件
- // for(int i=1;i<=this.iAddCount;i++)
- // {
- // this.AddControls(i);
- // }
- //}
- }