/// <summary> /// 绑定数据 /// </summary> public void bindtt() { DataTable dt = new ManageBll().GetManageType(); this.gvManageType.DataSource = dt; this.gvManageType.DataBind(); }
/// <summary> /// 用于绑定左侧菜单栏 /// </summary> public string BindLtr(int utid) { StringBuilder sb = new StringBuilder(); DataTable dt = new ManageBll().GetLeftMeauByUTID(utid); //获得一级菜单 DataRow[] first = dt.Select("ParentID=0"); sb.Append("<ul id='oneUl'>"); for (int i = 0; i < first.Length; i++) { sb.Append("<li onclick='changeDiv(this);' id='li" + first[i]["MID"] + "'>" + "<img src=\"lujing\" width='15px' height='15px' > " + first[i]["MenuName"]); //绑定二级菜单 DataRow[] two = dt.Select("ParentID=" + first[i]["MID"]); sb.Append("<ul onclick='changeDiv2(this);' style='display:none;' id='ul" + first[i]["MID"] + "'>"); for (int j = 0; j < two.Length; j++) { sb.Append("<a href='" + two[j]["WebUrl"] + "' target=\"iframe\"><li>" + two[j]["MenuName"]); sb.Append("</li></a>"); } sb.Append("</ul></li>"); } sb.Append("</ul>"); return(sb.ToString()); }
/// <summary> /// 为一级Repeater赋值 /// </summary> public void DataFuzhi() { DataTable dt = new ManageBll().BindPageName(); this.oneRepeater.DataSource = dt; this.oneRepeater.DataBind(); }
/// <summary> /// 查询所有 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnALL_Click(object sender, EventArgs e) { List <M_TaskInfo> ti = new ManageBll().SelTaskInfo(); CollectionPager1.DataSource = ti; CollectionPager1.BindToControl = RTaskInfo; this.RTaskInfo.DataSource = CollectionPager1.DataSourcePaged; this.RTaskInfo.DataBind(); }
/// <summary> /// 创建一个查询日志的方法 /// </summary> public void bind() { List <Model.M_JournalInfo> mj = new ManageBll().SelJournal(); CollectionPager1.DataSource = mj; CollectionPager1.BindToControl = GvJournal; this.GvJournal.DataSource = CollectionPager1.DataSourcePaged; this.GvJournal.DataBind(); }
/// <summary> /// 给textbox赋值 /// </summary> public void upd() { int I = int.Parse(Request.QueryString["TID"]); M_TaskInfo ti = new ManageBll().SelTaskInfox(I); this.TbName.Text = ti.TaskName; //this.DdlDids.Text = ti.DID.DName.ToString(); this.TbContent.Text = ti.Content; this.TbRemark.Text = ti.Remark; }
/// <summary> /// 通过部门进行查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnSelByDid_Click(object sender, EventArgs e) { int did = int.Parse(this.DdlDid.SelectedValue.ToString()); List <M_TaskInfo> ti = new ManageBll().M_SelTaskByDID(did); CollectionPager1.DataSource = ti; CollectionPager1.BindToControl = RTaskInfo; this.RTaskInfo.DataSource = CollectionPager1.DataSourcePaged; this.RTaskInfo.DataBind(); }
/// <summary> /// 页面赋值 /// </summary> public void BindData() { int PID = Convert.ToInt32(Request.QueryString["PID"]); // int PID=Convert.ToInt32( Server.UrlDecode(Request.QueryString["PID"])); U_Post up = new ManageBll().getPostInfo(PID); this.lblPName.Text = up.PName; this.txtSalary.Text = up.Salary; }
/// <summary> /// 根据名字进行迷糊查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnName_Click(object sender, EventArgs e) { string name = this.TbName.Value.Trim(); List <Model.M_JournalInfo> mj = new ManageBll().selJournalInfoByName(name); CollectionPager1.DataSource = mj; CollectionPager1.BindToControl = GvJournal; this.GvJournal.DataSource = CollectionPager1.DataSourcePaged; this.GvJournal.DataBind(); }
/// <summary> /// 获取任务信息 /// </summary> public void BindInfo(int u) { //int u = Convert.ToInt32(Request.QueryString["DID"]); DataTable dt = new ManageBll().selectDetailTaskInfo(u); this.lblTitle.Text = dt.Rows[0]["TaskName"].ToString(); this.lblAuthor.Text = "发布部门:" + dt.Rows[0]["DName"].ToString(); this.txtContent.Text = dt.Rows[0]["Content"].ToString(); this.lblReleaseTime.Text = "发布时间" + dt.Rows[0]["ReleaseTime"].ToString(); }
/// <summary> /// 详细信息 /// </summary> public void bind() { int I = int.Parse(Request.QueryString["TID"]); M_TaskInfo ti = new ManageBll().SelTaskInfox(I); this.LbTaskName.Text = ti.TaskName; this.LbDID.Text = ti.DID.DName.ToString(); this.LbTime.Text = ti.ReleaseTime.ToString(); this.LbContent.Text = ti.Content; this.LbRemark.Text = ti.Remark; }
public void bind() { List <M_TaskInfo> ti = new ManageBll().SelTaskInfo(); CollectionPager1.DataSource = ti; CollectionPager1.BindToControl = RTaskInfo; this.RTaskInfo.DataSource = CollectionPager1.DataSourcePaged; this.RTaskInfo.DataBind(); //为部门信息赋值 this.DdlDid.DataSource = new UserBll().U_SelDepartment(); this.DdlDid.DataTextField = "DName"; this.DdlDid.DataValueField = "DID"; this.DdlDid.DataBind(); }
public void bindRepLeave(int did) { this.repLeaveInfo.DataSource = new ManageBll().getUserTaskInfo(did); this.repLeaveInfo.DataBind(); //分页 DataTable ti = new ManageBll().getUserTaskInfo(did); CollectionPager1.DataSource = ti.DefaultView;///强转 CollectionPager1.BindToControl = repLeaveInfo; this.repLeaveInfo.DataSource = CollectionPager1.DataSourcePaged; this.repLeaveInfo.DataBind(); }
/// <summary> /// 为二级Repeater赋值 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void oneRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { try { int pid = Convert.ToInt32((e.Item.FindControl("hfPID") as HiddenField).Value); DataTable dt = new ManageBll().BindTwoPageName(pid); Repeater r = e.Item.FindControl("twoRepeater") as Repeater; r.DataSource = dt; r.DataBind(); } catch { } }
/// <summary> /// 保存用户修改的密码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { use = (U_User)Session["U_USER"]; int uid = use.UID; ///获取输入内容 string pwd = this.iptRePwd.Value.Trim(); string rePwd = this.iptNewPwd.Value.Trim(); string surePwd = this.iptSurePwd.Value.Trim(); if (rePwd != surePwd) { Common.JsMessage.jsAlert("两次新密码输入不一致!"); return; } if (pwd.Length == 0 || rePwd.Length == 0 || surePwd.Length == 0) { Common.JsMessage.jsAlert("输入不能为空!"); return; } if (pwd.Length < 6 || rePwd.Length < 6 || surePwd.Length < 6) { Common.JsMessage.jsAlert("密码至少为6位!"); return; } DataTable dt = new ManageBll().selectbeginPwd(uid, pwd); if (dt.Rows.Count > 0) { if (new ManageBll().updatePasswordByUID(uid, rePwd) > 0) { Common.JsMessage.jsAlert("修改成功!"); } else { Common.JsMessage.jsAlert("修改失败!"); } } else { Common.JsMessage.jsAlert("原密码不正确!"); } }
public void BindCheckBoxState() { //获取所有checkBox List <HtmlInputCheckBox> hicb = Utils.ReadAllControls <HtmlInputCheckBox>(this.oneRepeater); int UTID = Convert.ToInt32(Request.QueryString["UTID"]); //遍历所有的CheckBox foreach (HtmlInputCheckBox item in hicb) { //获取被选中数据 List <M_Permission> cc = new ManageBll().getCheckState(UTID); foreach (var yll in cc) { if (yll.MID.MID == Convert.ToInt32(item.Value)) { item.Checked = true; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ///默认txtUserName隐藏 this.txtUserName.Visible = false; this.dlSalary.DataSource = new ManageBll().getUserSalary(); this.dlSalary.DataBind(); this.ddlDepartment.DataSource = new ManageBll().getDepartment(); this.ddlDepartment.DataValueField = "DID"; this.ddlDepartment.DataTextField = "DName"; this.ddlDepartment.DataBind(); //分页 DataTable ti = new ManageBll().getUserSalary(); CollectionPager1.DataSource = ti.DefaultView;///强转 CollectionPager1.BindToControl = dlSalary; this.dlSalary.DataSource = CollectionPager1.DataSourcePaged; this.dlSalary.DataBind(); } }
public EnamineController(ManageBll bl) //依赖构造函数进行对象注入 { this.bl = bl; //在构造函数中初始化EnamineController控制器类的bll属性 (这个bll属性的类型是ManageBll) }