protected void Page_Load(object sender, EventArgs e) { valObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); if (Request["PID"] != null) { pid = Request["PID"]; } if (Request["DEPT_ID"] != null) { deptid = Request["DEPT_ID"]; condObj.DEPT_ID = deptid; } title = valObj._ZhName + "选择"; Page.Title = title; if (!string.IsNullOrEmpty(Request[hidSelID.Name])) { pid = Request[hidSelID.Name]; } if (!IsPostBack) { if (valObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { valObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); } txtGENDER.Items.AddRange(FormHelper.GetListItem(HR_STAFF.Attribute.GENDER)); if (pid == "" || pid == "0") { a_top.Visible = false; } aspPager.CurrentPageIndex = 1; aspPager.PageSize = 15; try { condObj.PID = decimal.Parse(pid); listObj = BLLTable <HR_STAFF> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repCus.DataSource = listObj; repCus.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } aspPager.RecordCount = recount; } //Response.Write(Request[hidSelID.Name]); }
protected void ddlSort_SelectedIndexChanged(object sender, EventArgs e) { string[] sortArr = ddlSort.SelectedValue.Split('|'); AttributeItem item = new AttributeItem(sortArr[0]); if (sortArr[1].ToLower() == "asc") { condObj.af_PageBy(item, Order.Asc); } else { condObj.af_PageBy(item, Order.Desc); } BindList(condObj, 1); }
private void BindList(HR_STAFF condObj) { if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); listObj = BLLTable<HR_STAFF>.Factory(conn).Select(valObj, condObj); repList.DataSource = listObj; repList.DataBind(); }
private void BindList(HR_STAFF condObj) { if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); } listObj = BLLTable <HR_STAFF> .Factory(conn).Select(valObj, condObj); repList.DataSource = listObj; repList.DataBind(); }
private void BindList(HR_STAFF condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); } listObj = BLLTable <HR_STAFF> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }
protected void btnFind_Click(object sender, EventArgs e) { try { condObj = new HR_STAFF(); condObj.PID = decimal.Parse(pid); if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); if (txtSNAME.Value != "") condObj.Like(HR_STAFF.Attribute.SNAME, Convert.ToDecimal(txtSNAME.Value)); if (txtRNAME.Value != "") condObj.Like(HR_STAFF.Attribute.RNAME, Convert.ToDecimal(txtRNAME.Value)); if (txtSTAFF_NO.Value != "") condObj.Like(HR_STAFF.Attribute.STAFF_NO, Convert.ToString(txtSTAFF_NO.Value)); if (txtNAME.Value != "") condObj.Like(HR_STAFF.Attribute.STAFF_NAME, Convert.ToString(txtNAME.Value)); if (txtGENDER.Value != "") condObj.GENDER = Convert.ToString(txtGENDER.Value); if (txtSTATION_CODE.Value != "") condObj.Like(HR_STAFF.Attribute.STATION_CODE, Convert.ToString(txtSTATION_CODE.Value)); if (txtMOBILE.Value != "") condObj.Like(HR_STAFF.Attribute.MOBILE, Convert.ToString(txtMOBILE.Value)); if (txtTITLE_CODE.Value != "") condObj.Like(HR_STAFF.Attribute.TITLE_CODE, Convert.ToString(txtTITLE_CODE.Value)); if (txtEMAIL.Value != "") condObj.Like(HR_STAFF.Attribute.EMAIL, Convert.ToString(txtEMAIL.Value)); listObj = BLLTable<HR_STAFF>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } aspPager.RecordCount = recount; }
private void BindList(HR_STAFF condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); } if (deptid != "") { condObj.DEPT_ID = deptid; //Response.Write(deptid); } //condObj.PID = decimal.Parse(pid); valObj.LoadAllAttributes(false); showTableColumnList.Add(HR_STAFF.Attribute.PATH); showTableColumnList.Add(HR_STAFF.Attribute.PNAME); showTableColumnList.Add(HR_STAFF.Attribute.GENDER); valObj.Add(showTableColumnList.ToArray()); listObj = BLLTable <HR_STAFF> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; //部门领导 HR_DEPT_MANAGER valObj2 = new HR_DEPT_MANAGER(); HR_DEPT_MANAGER condObj2 = new HR_DEPT_MANAGER(); condObj2.DEPT_ID = deptid; List <HR_DEPT_MANAGER> listObj2 = BLLTable <HR_DEPT_MANAGER> .Factory(conn).Select(valObj2, condObj2); repList_DEPT_MANAGER.DataSource = listObj2; repList_DEPT_MANAGER.DataBind(); //岗位信息 HR_STATION valObj3 = new HR_STATION(); HR_STATION condObj3 = new HR_STATION(); condObj3.DEPT_ID = deptid; List <HR_STATION> listObj3 = BLLTable <HR_STATION> .Factory(conn).Select(valObj3, condObj3); repList_HR_STATION.DataSource = listObj3; repList_HR_STATION.DataBind(); }
private void BindList(HR_STAFF condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); listObj = BLLTable<HR_STAFF>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }
private void BindList(HR_STAFF condObj, int curPage) { if (valObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { valObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); } if (deptid != "") { condDep.DEPT_ID = deptid; //Response.Write(deptid); } else { condDep.Where("HR_DEPT_STAFF.DEPT_ID = '' or HR_DEPT_STAFF.DEPT_ID is null"); } //condObj.PID = decimal.Parse(pid); valObj.LoadAllAttributes(false); showTableColumnList.Add(HR_STAFF.Attribute.PATH); showTableColumnList.Add(HR_STAFF.Attribute.PNAME); showTableColumnList.Add(HR_STAFF.Attribute.GENDER); valObj.Add(showTableColumnList.ToArray()); Relation rel = new Relation(HR_STAFF.Attribute.STAFF_ID, HR_DEPT_STAFF.Attribute.STAFF_ID); List <ITableImplement> lst = new List <ITableImplement>(); lst.Add(condDep); lst.Add(condObj); listObj = BLLTable <HR_STAFF> .Factory(conn).SelectByPage(valObj, rel, new HR_DEPT_STAFF(), lst, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; //部门领导 HR_DEPT_MANAGER valObj2 = new HR_DEPT_MANAGER(); HR_DEPT_MANAGER condObj2 = new HR_DEPT_MANAGER(); valObj2.Top(1); condObj2.DEPT_ID = deptid; List <HR_DEPT_MANAGER> listObj2 = BLLTable <HR_DEPT_MANAGER> .Factory(conn).Select(valObj2, condObj2); repList_DEPT_MANAGER.DataSource = listObj2; repList_DEPT_MANAGER.DataBind(); //岗位信息 HR_STATION valObj3 = new HR_STATION(); HR_STATION condObj3 = new HR_STATION(); Relation r1 = new Relation(HR_STATION.Attribute.LEVEL_ID, HR_STATION_LEVEL.Attribute.LEVEL_ID); Relation r2 = new Relation(HR_STATION.Attribute.TYPE_ID, HR_STATION_TYPE.Attribute.TYPE_ID); List <Relation> lstRelatio = new List <Relation>(); lstRelatio.Add(r1); lstRelatio.Add(r2); HR_STATION_TYPE valType = new HR_STATION_TYPE(); valType.TYPE_NAME = ""; HR_STATION_LEVEL valLevel = new HR_STATION_LEVEL(); valLevel.LEVEL_NAME = ""; List <ITableImplement> lstTable = new List <ITableImplement>(); lstTable.Add(valType); lstTable.Add(valLevel); condObj3.DEPT_ID = deptid; List <ITableImplement> lstCond = new List <ITableImplement>(); lstCond.Add(condObj3); List <HR_STATION> listObj3 = BLLTable <HR_STATION> .Factory(conn).Select(valObj3, lstRelatio, lstTable, lstCond); repList_HR_STATION.DataSource = listObj3; repList_HR_STATION.DataBind(); }
protected void btnFind_Click(object sender, EventArgs e) { try { condObj = new HR_STAFF(); condObj.PID = decimal.Parse(pid); if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); } if (txtSNAME.Value != "") { condObj.Like(HR_STAFF.Attribute.SNAME, Convert.ToDecimal(txtSNAME.Value)); } if (txtRNAME.Value != "") { condObj.Like(HR_STAFF.Attribute.RNAME, Convert.ToDecimal(txtRNAME.Value)); } if (txtSTAFF_NO.Value != "") { condObj.Like(HR_STAFF.Attribute.STAFF_NO, Convert.ToString(txtSTAFF_NO.Value)); } if (txtNAME.Value != "") { condObj.Like(HR_STAFF.Attribute.STAFF_NAME, Convert.ToString(txtNAME.Value)); } if (txtGENDER.Value != "") { condObj.GENDER = Convert.ToString(txtGENDER.Value); } if (txtSTATION_CODE.Value != "") { condObj.Like(HR_STAFF.Attribute.STATION_CODE, Convert.ToString(txtSTATION_CODE.Value)); } if (txtMOBILE.Value != "") { condObj.Like(HR_STAFF.Attribute.MOBILE, Convert.ToString(txtMOBILE.Value)); } if (txtTITLE_CODE.Value != "") { condObj.Like(HR_STAFF.Attribute.TITLE_CODE, Convert.ToString(txtTITLE_CODE.Value)); } if (txtEMAIL.Value != "") { condObj.Like(HR_STAFF.Attribute.EMAIL, Convert.ToString(txtEMAIL.Value)); } listObj = BLLTable <HR_STAFF> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } aspPager.RecordCount = recount; }
private void BindList(HR_STAFF condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc); if (deptid != "") { condObj.DEPT_ID = deptid; //Response.Write(deptid); } //condObj.PID = decimal.Parse(pid); valObj.LoadAllAttributes(false); showTableColumnList.Add(HR_STAFF.Attribute.PATH); showTableColumnList.Add(HR_STAFF.Attribute.PNAME); showTableColumnList.Add(HR_STAFF.Attribute.GENDER); valObj.Add(showTableColumnList.ToArray()); listObj = BLLTable<HR_STAFF>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; //�����쵼 HR_DEPT_MANAGER valObj2 = new HR_DEPT_MANAGER(); HR_DEPT_MANAGER condObj2 = new HR_DEPT_MANAGER(); condObj2.DEPT_ID = deptid; List<HR_DEPT_MANAGER> listObj2 = BLLTable<HR_DEPT_MANAGER>.Factory(conn).Select(valObj2, condObj2); repList_DEPT_MANAGER.DataSource = listObj2; repList_DEPT_MANAGER.DataBind(); //��λ��Ϣ HR_STATION valObj3 = new HR_STATION(); HR_STATION condObj3 = new HR_STATION(); condObj3.DEPT_ID = deptid; List<HR_STATION> listObj3 = BLLTable<HR_STATION>.Factory(conn).Select(valObj3, condObj3); repList_HR_STATION.DataSource = listObj3; repList_HR_STATION.DataBind(); }