private void BindText() { Staff staff = new Staff(); staff.Staffinfo_id = Convert.ToInt32(id); StaffProvider provider = new StaffProvider(); DataTable table = new DataTable(); table = provider.Select(staff); this.txt_staffinfo_position.Text = table.Rows[0]["staffinfo_position"].ToString(); this.txt_staffinfo_num.Text = table.Rows[0]["staffinfo_num"].ToString(); this.txt_staffinfo_cell.Text = table.Rows[0]["staffinfo_cell"].ToString(); this.txt_staffinfo_exp.Text = table.Rows[0]["staffinfo_exp"].ToString(); this.ddl_sex.SelectedValue = table.Rows[0]["staffinfo_sex"].ToString(); }
private void BindText() { Staff staff = new Staff(); staff.Staffinfo_id = Convert.ToInt32(id); StaffProvider provider = new StaffProvider(); DataTable table = new DataTable(); table = provider.Select(staff); this.txt_staffinfo_name.Text = table.Rows[0]["staffinfo_name"].ToString(); this.txt_staffinfo_cell.Text = table.Rows[0]["staffinfo_cell"].ToString(); this.ddl_sex.SelectedValue = table.Rows[0]["staffinfo_sex"].ToString(); this.txt_NewPass.Text = ""; this.txt_NewPassConfirm.Text = ""; this.txt_OldPass.Text = ""; }
private int IsSame() { Staff staff = new Staff(); StaffProvider provider = new StaffProvider(); staff.Staffinfo_num = this.txt_staffinfo_num.Text; DataTable table = new DataTable(); table = provider.Select(staff); if (table.Rows.Count != 0) { this.Alert("该员工号已经存在,请重新输入!!!"); return(1); } else { return(0); } }
/// <summary> /// 绑定Staff信息的数据源 /// </summary> private void BindSource(int start, string position) { if (position != null) { Staff staff = new Staff(); staff.Staffionfo_position = position; StaffProvider provider = new StaffProvider(); DataTable table = provider.Select(staff, start, this.ListPager1.PageSize); this.GridView1.DataSource = table.DefaultView; this.GridView1.DataBind(); } else { StaffProvider provider = new StaffProvider(); DataTable table = provider.GetAll(start, this.ListPager1.PageSize); this.GridView1.DataSource = table.DefaultView; this.GridView1.DataBind(); } }