Ejemplo n.º 1
0
        protected void ttbSearch1_Trigger2Click(object sender, EventArgs e)
        {
            //search
            Demo.BLL.tb_JC_Department   bll   = new Demo.BLL.tb_JC_Department();
            Demo.Model.tb_JC_Department model = new Demo.Model.tb_JC_Department();
            string deptname = ttbSearch1.Text.Trim();

            model = bll.GetModelList("DepartmentName = '" + deptname + "'")[0];

            if (model.DepartmentNO == null)
            {
                Alert.ShowInTop("未找到改部门!");
            }
            else
            {
                PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/Web/JC/deptment/listdeptmodify.aspx?id={0}&deptno={1}", model.ID, model.DepartmentNO), "编辑"));
            }
        }
Ejemplo n.º 2
0
        private void BindDataTableToDropDownList()
        {
            List <CustomClass> myList = new List <CustomClass>();

            Demo.BLL.tb_JC_Department bll = new Demo.BLL.tb_JC_Department();

            //泛型
            List <Demo.Model.tb_JC_Department> model = new List <Demo.Model.tb_JC_Department>();

            model = bll.GetModelList("");

            foreach (Demo.Model.tb_JC_Department temp in model)
            {
                myList.Add(new CustomClass(temp.DepartmentNO, temp.DepartmentName));
            }


            DropDownList1.DataTextField  = "Name";
            DropDownList1.DataValueField = "ID";
            DropDownList1.DataSource     = myList;
            DropDownList1.DataBind();
        }
Ejemplo n.º 3
0
        private void dept()
        {
            List <CustomClass> myList1 = new List <CustomClass>();

            Demo.BLL.tb_JC_Department bll = new Demo.BLL.tb_JC_Department();

            //泛型
            List <Demo.Model.tb_JC_Department> model = new List <Demo.Model.tb_JC_Department>();

            model = bll.GetModelList("");
            foreach (Demo.Model.tb_JC_Department temp in model)
            {
                myList1.Add(new CustomClass(temp.DepartmentNO, temp.DepartmentName));
            }

            DropDownList1.DataTextField  = "Name";
            DropDownList1.DataValueField = "ID";
            DropDownList1.DataSource     = myList1;
            DropDownList1.DataBind();

            DropDownList1.Items.Insert(0, new ListItem("请选择部门", "-1"));
            DropDownList1.SelectedValue = "-1";
        }