private void DoInitData() { try { //Stage LPWeb.DAL.Template_Wfl_Stages stageMgr = new DAL.Template_Wfl_Stages(); this.ddlStage.DataValueField = "WflStageId"; this.ddlStage.DataTextField = "Name"; this.ddlStage.DataSource = stageMgr.GetList(" WflTemplId=" + this.iTemplateID.ToString()).Tables[0]; this.ddlStage.DataBind(); //Owner LPWeb.DAL.Roles roleMgr = new DAL.Roles(); this.ddlOwner.DataValueField = "RoleId"; this.ddlOwner.DataTextField = "Name"; this.ddlOwner.DataSource = roleMgr.GetList(" Name<>'Executive' AND Name <>'Branch Manager'").Tables[0]; this.ddlOwner.DataBind(); //Prerequisite Task this.ddlPrerequisiteTask.DataValueField = "TemplTaskId"; this.ddlPrerequisiteTask.DataTextField = "Name"; this.ddlPrerequisiteTask.DataSource = this.taskTmpMgr.GetList(" (PrerequisiteTaskId IS NULL OR PrerequisiteTaskId=0) AND WflStageId=" + this.iStageID.ToString() + " AND TemplTaskId <>" + this.iTaskID.ToString()).Tables[0]; this.ddlPrerequisiteTask.DataBind(); this.ddlPrerequisiteTask.Items.Insert(0, new ListItem("", "0")); //Email template LPWeb.DAL.Template_Email emlTmpMgr = new DAL.Template_Email(); DataSet dsEmailTemp = emlTmpMgr.GetList(" Enabled=1"); if (dsEmailTemp.Tables.Count > 0) { DataRow drEmailTmp = dsEmailTemp.Tables[0].NewRow(); drEmailTmp["TemplEmailId"] = 0; drEmailTmp["Enabled"] = true; drEmailTmp["Name"] = "-- select a Email Template --"; drEmailTmp["Content"] = ""; dsEmailTemp.Tables[0].Rows.InsertAt(drEmailTmp, 0); } DataView dvEmailTemp = new DataView(dsEmailTemp.Tables[0], "", "Name", DataViewRowState.CurrentRows); this.ddlWarningEmail.DataValueField = "TemplEmailId"; this.ddlWarningEmail.DataTextField = "Name"; this.ddlWarningEmail.DataSource = dvEmailTemp; this.ddlWarningEmail.DataBind(); //this.ddlCompletionEmail.DataValueField = "TemplEmailId"; //this.ddlCompletionEmail.DataTextField = "Name"; //this.ddlCompletionEmail.DataSource = dvEmailTemp; //this.ddlCompletionEmail.DataBind(); this.ddlOverdueEmail.DataValueField = "TemplEmailId"; this.ddlOverdueEmail.DataTextField = "Name"; this.ddlOverdueEmail.DataSource = dvEmailTemp; this.ddlOverdueEmail.DataBind(); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获得数据列表 /// </summary> public DataTable GetList(string strWhere) { return(dal.GetList(strWhere)); }