protected void btn_Result_Click(object sender, EventArgs e) { Staff staff = new Staff(); staff.Staffionfo_position = "%" + this.txt_Position.Text + "%"; StaffProvider provider = new StaffProvider(); this.ListPager1.RecordCount = provider.GetSize(staff); this.BindSource(0, "%" + this.txt_Position.Text + "%"); this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { StaffProvider provider = new StaffProvider(); this.ListPager1.RecordCount = provider.GetSize(); this.BindSource(0, null); } this.account.Text = Session["LOGINED"].ToString(); this.datetime.Text = this.BindDayWeek(); this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange); }
protected void btn_Result_Click(object sender, EventArgs e) { Staff staff = new Staff(); staff.User_id = user_id; staff.Role_id = role_id; staff.Role_Manage = user_manage; if (this.txt_Position.Text != "") { staff.Staffinfo_Name = "%" + this.txt_Position.Text + "%"; } staff.Role_id = Convert.ToInt32(Session["ROLEID"].ToString()); StaffProvider provider = new StaffProvider(); this.ListPager1.RecordCount = provider.GetSize(staff); this.BindSource(staff, 0); this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange); }
protected void Page_Load(object sender, EventArgs e) { role_id = Convert.ToInt32(Session["ROLEID"].ToString()); if (!IsPostBack) { user_manage = Convert.ToInt32(Session["USERMANAGE"].ToString()); user_id = Convert.ToInt32(Session["USERID"].ToString()); Staff staff = new Staff(); if (user_manage == 0) { this.btn_Result.Enabled = false; } staff.User_id = user_id; staff.Role_id = role_id; staff.Role_Manage = user_manage; BoundField sumField = new BoundField(); sumField.DataField = "sum"; if (role_id == 2) { sumField.HeaderText = "采购金额"; } else if (role_id == 3) { sumField.HeaderText = "销售金额"; } else if (role_id == 4) { sumField.HeaderText = "库存总额"; } this.GridView1.Columns.Insert(6, sumField); /* * if (role_id == 4) * { * this.GridView1.Columns.RemoveAt(6); * } */ //this.GridView1.Columns[7].Visible = false; //this.GridView1.Columns[9].Visible = false; StaffProvider provider = new StaffProvider(); this.ListPager1.RecordCount = provider.GetSize(); this.BindSource(staff, 0); if (this.GridView1.Rows.Count > 0) { for (int i = 0; i < this.GridView1.Rows.Count; i++) { if (Convert.ToInt32(this.GridView1.Rows[i].Cells[8].Text.ToString()) != user_id) { this.GridView1.Rows[i].Cells[7].Enabled = false; } } } //this.GridView1.Rows[1].Cells[7].Enabled = false; this.GridView1.Columns[8].Visible = false; } this.account.Text = GetAccout();//Session["LOGINED"].ToString(); this.datetime.Text = this.BindDayWeek(); this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange); }