public void Bind_DDL() { DropDownListHelp ddlHelper = new DropDownListHelp(); DataTable dt = bll.GetList("").Tables[0]; ddlHelper.createDropDownTree(dt, "PARENT_ID", "-1", "CATEGORY_ID", "CATEGORY_NAME", "ID asc", ddlTypeList); }
protected void InitControls() { this.bName.Text = ""; this.bRemark.Text = ""; this.bOrder.Text = StringPlus.NullToString(dal.GetRecordCount("") + 1); DataSet ds = dal.GetList(""); DropDownListHelp ddlHelper = new DropDownListHelp(); this.bParent.Items.Clear(); ddlHelper.createDropDownTree(ds.Tables[0], "bParent", "0", "bId", "bName", "bId", this.bParent); this.bParent.Items.Insert(0, new ListItem("----作为一级栏目----", "0")); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { PaducnSoft.DAL.ay_prodclass dal_class = new PaducnSoft.DAL.ay_prodclass(); DataSet ds = dal_class.GetList(""); DropDownListHelp ddlHelper = new DropDownListHelp(); this.ddlbClassID.Items.Clear(); ddlHelper.createDropDownTree(ds.Tables[0], "bParent", "0", "bId", "bName", "bId", this.ddlbClassID); this.ddlbClassID.Items.Insert(0, new ListItem("--全部分类--", "0")); BindDataList(); } }
private void ShowInfo(int bId) { DataSet ds = dal.GetList(""); DropDownListHelp ddlHelper = new DropDownListHelp(); this.bParent.Items.Clear(); ddlHelper.createDropDownTree(ds.Tables[0], "bParent", "0", "bId", "bName", "bId", this.bParent); this.bParent.Items.Insert(0, new ListItem("----作为一级栏目----", "0")); PaducnSoft.Model.ay_prodclass model = dal.GetModel(bId); this.bId.Value = model.bId.ToString(); this.bName.Text = model.bName; this.bParent.SelectedValue = model.bParent.ToString(); this.bOrder.Text = model.bOrder.ToString(); this.bRemark.Text = model.bRemark; }
protected void InitControls() { this.bTitle.Text = ""; PaducnSoft.DAL.ay_prodclass dal_class = new PaducnSoft.DAL.ay_prodclass(); DataSet ds = dal_class.GetList(""); DropDownListHelp ddlHelper = new DropDownListHelp(); this.bClassID.Items.Clear(); ddlHelper.createDropDownTree(ds.Tables[0], "bParent", "0", "bId", "bName", "bId", this.bClassID); this.bClassID.Items.Insert(0, new ListItem("----选择分类----", "0")); this.bKeywords.Text = ""; this.bPic.Text = ""; this.bIsNew.Checked = false; this.bIsTop.Checked = false; this.bIsBest.Checked = false; this.bIsPass.Checked = true; this.bClick.Text = "0"; this.bContent.Text = ""; ScriptManager1.SetFocus(this.bTitle); }
private void ShowInfo(int bId) { PaducnSoft.DAL.ay_prodclass dal_class = new PaducnSoft.DAL.ay_prodclass(); DataSet ds = dal_class.GetList(""); DropDownListHelp ddlHelper = new DropDownListHelp(); this.bClassID.Items.Clear(); ddlHelper.createDropDownTree(ds.Tables[0], "bParent", "0", "bId", "bName", "bId", this.bClassID); this.bClassID.Items.Insert(0, new ListItem("----选择分类----", "0")); PaducnSoft.Model.ay_products model = dal.GetModel(bId); this.bId.Value = model.bId.ToString(); this.bTitle.Text = model.bTitle; this.bClassID.SelectedValue = model.bClassID.ToString(); this.bKeywords.Text = model.bKeywords; this.bPic.Text = model.bPic; this.bClick.Text = model.bClick.ToString(); this.bContent.Text = Server.HtmlDecode(model.bContent); this.bIsNew.Checked = model.bIsNew.ToString() == "1" ? true : false; this.bIsTop.Checked = model.bIsTop.ToString() == "1" ? true : false; this.bIsBest.Checked = model.bIsBest.ToString() == "1" ? true : false; this.bIsPass.Checked = model.bIsPass.ToString() == "1" ? true : false; }
protected void Page_Load(object sender, EventArgs e) { if (Session["userCode"] == null || Session["userCode"].ToString().Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "window.location.href='../Login.aspx','_self';", true); return; } string billCode = Request["billCode"]; if (string.IsNullOrEmpty(billCode)) { Response.Redirect("ybbxEditMain.aspx"); } string mainStr = ""; if (!string.IsNullOrEmpty(Request["type"]) && Request["type"] == "addmx") { btn_save.Visible = false; mainStr = "select a.billCode,a.billName,a.flowID,a.stepID,a.billUser,b.bxr,convert(varchar(10),a.billDate,121) as billDate,a.billDept,a.loopTimes,a.isgk,a.gkdept,b.bxmxlx,b.bxzy,b.bxsm from bill_main a inner join bill_ybbxmxb b on a.billCode=b.billCode and a.billCode=@billCode"; } else { btn_saveAndMx.Value = "保存并添加明细"; mainStr = "select * from ph_main where billCode=@billCode"; // btn_saveAndMx.Visible=false; } main = server.GetDataTable(mainStr, new SqlParameter[] { new SqlParameter("@billCode", billCode) }); //if (main.Rows.Count==0) //{ // main=server.GetDataTable("select * from ph_main where billCode='"+billCode+"'",null); //} //if(main.Rows.Count==0) //{ // main = server.GetDataTable("select a.billCode,a.billName,a.flowID,a.stepID,a.billUser,b.bxr,convert(varchar(10),a.billDate,121) as billDate,a.billDept,a.loopTimes,a.isgk,a.gkdept,b.bxmxlx,b.bxzy,b.bxsm from bill_main a inner join bill_ybbxmxb b on a.billCode=b.billCode and a.billCode='"+billCode+"'", null); //} Label1.Text = main.Rows[0]["billName"].ToString(); if (main.Rows.Count == 0) { Response.Redirect("../Login.aspx"); return; } if (!IsPostBack) { string sql = "";; if (Convert.ToString(main.Rows[0]["isgk"]) == "1") { sql += "select yskmCode,('['+yskmcode+']'+yskmMc)as yskmMc ,isnull(left(yskmCode,len(yskmCode)-2),'') as parentID,(case (select count(*) from bill_yskm where yskmcode like a.yskmcode+'%') when 1 then 1 else 0 end ) as islast from Bill_Yskm a where a.yskmcode in (select yskmcode from bill_yskm_dept where deptcode='" + Convert.ToString(main.Rows[0]["gkDept"]) + "') and kmStatus='1' and dydj='02' and gkfy='1' "; } else { sql += "select yskmCode, ('['+yskmcode+']'+yskmMc)as yskmMc ,isnull(left(yskmCode,len(yskmCode)-2),'') as parentID ,(case (select count(*) from bill_yskm where yskmcode like a.yskmcode+'%') when 1 then 1 else 0 end ) as islast from Bill_Yskm a where a.yskmcode in (select yskmcode from bill_yskm_dept where deptcode='" + Convert.ToString(main.Rows[0]["billDept"]) + "') and kmStatus='1' and dydj='02' "; } if (!string.IsNullOrEmpty(Request["type"]) && Request["type"] == "addmx") { sql += " and yskmCode not in(select fykm from bill_main a inner join bill_ybbxmxb_fykm b on a.billCode =b.billCode and a.billCode='" + billCode + "')"; } DataTable dt = server.GetDataTable(sql, null); DropDownListHelp ddlHelper = new DropDownListHelp(); ddlHelper.createDropDownTree(dt, "parentID", "", "yskmCode", "yskmMc", "yskmCode asc", DropDownList1); hfDept.Value = Convert.ToString(main.Rows[0]["billDept"]); hfIsgk.Value = Convert.ToString(main.Rows[0]["isgk"]); hfBillDate.Value = Convert.ToString(main.Rows[0]["billDate"]); hfDydj.Value = "02"; hfBxlx.Value = Convert.ToString(main.Rows[0]["bxmxlx"]); DropDownList1.Items[0].Text = "请选择报销费用"; } }