protected void Page_Load(object sender, EventArgs e) { title = "排班管理"; Page.Title = title; if (!IsPostBack) { #region//默认属性初始化 dll_Year.Items.Clear(); dll_Month.Items.Clear(); DateTime dt = DateTime.Now; for (int y = dt.Year - 25; y < dt.Year + 25; y++) { dll_Year.Items.Add(new ListItem(y.ToString(), y.ToString())); } dll_Year.Value = dt.Year.ToString(); dll_Month.Items.Add(new ListItem("未选择", "0")); for (int y = 1; y < 13; y++) { dll_Month.Items.Add(new ListItem(y.ToString(), y.ToString())); } dll_Month.Value = dt.Month.ToString(); //dll_Day.Text = dt.Day.ToString(); dll_Type.Items.AddRange(FormHelper.GetListItem(HR_Scheduling.Attribute.SchType)); #endregion HR_SchClass con = new HR_SchClass(); con.OrderBy(HR_SchClass.Attribute.StartHour.FieldName + " desc "); con.OrderBy(false, HR_SchClass.Attribute.StartMin.FieldName + " desc "); List <HR_SchClass> schs = BLLTable <HR_SchClass> .Factory(conn).Select(new HR_SchClass(), con); repList.DataSource = schs; repList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { title = "排班管理"; Page.Title = title; if (!IsPostBack) { #region//默认属性初始化 dll_Year.Items.Clear(); dll_Month.Items.Clear(); DateTime dt = DateTime.Now; for (int y = dt.Year - 25; y < dt.Year + 25; y++) { dll_Year.Items.Add(new ListItem(y.ToString(), y.ToString())); } dll_Year.Value = dt.Year.ToString(); dll_Month.Items.Add(new ListItem("未选择", "0")); for (int y = 1; y < 13; y++) { dll_Month.Items.Add(new ListItem(y.ToString(), y.ToString())); } dll_Month.Value = dt.Month.ToString(); //dll_Day.Text = dt.Day.ToString(); dll_Type.Items.AddRange(FormHelper.GetListItem(HR_Scheduling.Attribute.SchType)); #endregion HR_SchClass con = new HR_SchClass(); con.OrderBy(HR_SchClass.Attribute.StartHour.FieldName + " desc "); con.OrderBy(false, HR_SchClass.Attribute.StartMin.FieldName + " desc "); List<HR_SchClass> schs = BLLTable<HR_SchClass>.Factory(conn).Select(new HR_SchClass(), con); repList.DataSource = schs; repList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { title = "排班查看"; Page.Title = title; if (Request["staffid"] != null) { hidstaffid.Value = Request["staffid"]; } if (Request["deptid"] != null) { hiddeptid.Value = Request["deptid"]; } if (Request["orgid"] != null) { hidorgid.Value = Request["orgid"]; } if (Request["name"] != null) { title += "--" + System.Uri.UnescapeDataString(Request["name"]); hidname.Value = System.Uri.UnescapeDataString(Request["name"]); } else if (hidname.Value != "") title += System.Uri.UnescapeDataString(hidname.Value); else title += "--" + userBase.StaffName; if (!IsPostBack) { #region//默认属性初始化 dll_Year.Items.Clear(); dll_Month.Items.Clear(); DateTime dt = DateTime.Now; for (int y = dt.Year - 25; y < dt.Year + 25; y++) { dll_Year.Items.Add(new ListItem(y.ToString(), y.ToString())); } dll_Year.Value = dt.Year.ToString(); dll_Month.Items.Add(new ListItem("未选择", "0")); for (int y = 1; y < 13; y++) { dll_Month.Items.Add(new ListItem(y.ToString(), y.ToString())); } dll_Month.Value = dt.Month.ToString(); //dll_Day.Text = dt.Day.ToString(); dll_Type.Items.AddRange(FormHelper.GetListItem(HR_Scheduling.Attribute.SchType)); #endregion HR_SchClass con = new HR_SchClass(); con.OrderBy(new List<OrderByItem>(new OrderByItem[] { new OrderByItem(HR_SchClass.Attribute.StartHour, Order.Asc), new OrderByItem(HR_SchClass.Attribute.StartMin, Order.Asc), new OrderByItem(HR_SchClass.Attribute.EndHour, Order.Asc), new OrderByItem(HR_SchClass.Attribute.EndMin, Order.Asc) })); repList.DataSource = BLLTable<HR_SchClass>.Factory(conn).Select(new HR_SchClass(), con); repList.DataBind(); } }
protected void aspPager_PageChanged(object sender, EventArgs e) { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<HR_SchClass>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void aspPager_PageChanged(object sender, EventArgs e) { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <HR_SchClass>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void btnSetPageSize_Click(object sender, EventArgs e) { aspPager.PageSize = int.Parse(txtPageSize.Value); if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <HR_SchClass>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
private void LoadSCH() { HR_SchClass con = new HR_SchClass(); con.OrderBy(HR_SchClass.Attribute.StartHour, Order.Asc); con.OrderBy(HR_SchClass.Attribute.StartMin, Order.Asc); List <HR_SchClass> listObj = BLLTable <HR_SchClass> .Factory(conn).Select(new HR_SchClass(), con); repList.DataSource = listObj; repList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(HR_SchClass.Attribute.EXP1); //hideTableColumnList.Add(HR_SchClass.Attribute.EXP2); //hideTableColumnList.Add(HR_SchClass.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(HR_SchClass.Attribute.EXP1); //hideFindColumnList.Add(HR_SchClass.Attribute.EXP2); //hideFindColumnList.Add(HR_SchClass.Attribute.EXP3); #endregion condObj.OrderBy(HR_SchClass.Attribute.SchClassid, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "查询"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { HR_SchClass roleOld = new HR_SchClass(); roleOld.Where(HR_SchClass.Attribute.SchClassid, Request["ids"].ToString()); listObj = BLLTable <HR_SchClass> .Factory(conn).Select(valObj, roleOld); for (int i = 0; i < listObj.Count; i++) { if (i > 0) { hidOld.Value += ","; hidInitIDS.Value += ","; } hidOld.Value += "{ID:'" + listObj[i].SchClassid + "',Name:'" + listObj[i].SchClassid + "'}";//这里的Name用于显示在列表中,请自行重定义。 hidInitIDS.Value += listObj[i].SchClassid; } } try { listObj = BLLTable <HR_SchClass> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; } catch (Exception ex) { litWarn.Text = ex.Message; } } }
private void BindList(HR_SchClass condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(HR_SchClass.Attribute.SchClassid, Order.Desc); } #region//数据权限条件 #endregion //condObj.PID = decimal.Parse(pid); listObj = BLLTable <HR_SchClass> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }
protected void aspPager_PageChanged(object sender, EventArgs e) { try { recount = aspPager.RecordCount; if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<HR_SchClass>(hidCondition.Value); } List<HR_SchClass> listVal = BLLTable<HR_SchClass>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount); repList.DataSource = listVal; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void aspPager_PageChanged(object sender, EventArgs e) { try { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <HR_SchClass>(hidCondition.Value); } listObj = BLLTable <HR_SchClass> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount); repCus.DataSource = listObj; repCus.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
private void LoadSCH() { HR_SchClass con = new HR_SchClass(); con.OrderBy(new List<OrderByItem>(new OrderByItem[] { new OrderByItem(HR_SchClass.Attribute.StartHour, Order.Asc), new OrderByItem(HR_SchClass.Attribute.StartMin, Order.Asc), new OrderByItem(HR_SchClass.Attribute.EndHour, Order.Asc), new OrderByItem(HR_SchClass.Attribute.EndMin, Order.Asc) })); List<HR_SchClass> listObj = BLLTable<HR_SchClass>.Factory(conn).Select(new HR_SchClass(), con); repList.DataSource = listObj; repList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "±à¼"; Page.Title = title; if (!string.IsNullOrEmpty(Request["SchClassid"])) { keyid = Request["SchClassid"]; } if (!string.IsNullOrEmpty(Request["KeyID"])) { keyid = Request["KeyID"]; } if (!IsPostBack) { txtSchUnit.Items.AddRange(FormHelper.GetListItem(HR_SchClass.Attribute.SchUnit)); txtSchUnit.Items.RemoveAt(0); this.txtSchClassid.Disabled = true; this.txtSchClassid.Attributes["class"] = "dis"; for (int i = 0; i < 24; i++) { txtStartHour.Items.Add(new ListItem(i.ToString(), i.ToString())); txtEndHour.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckInHour1.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckInHour2.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckOutHour1.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckOutHour2.Items.Add(new ListItem(i.ToString(), i.ToString())); } for (int i = 0; i < 60; i++) { txtStartMin.Items.Add(new ListItem(i.ToString(), i.ToString())); txtEndMin.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckInMin1.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckInMin2.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckOutMin1.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckOutMin2.Items.Add(new ListItem(i.ToString(), i.ToString())); } for (int i = 1; i <= 120; i++) { txtEarlyMinutes.Items.Add(new ListItem(i.ToString(), i.ToString())); txtLateMinutes.Items.Add(new ListItem(i.ToString(), i.ToString())); } txtSchNumber.Items.Add(new ListItem("0.5", "0.5")); txtSchNumber.Items.Add(new ListItem("1", "1")); txtSchNumber.Items.Add(new ListItem("1.5", "1.5")); txtSchNumber.Items.Add(new ListItem("2", "2")); txtSchNumber.Items.Add(new ListItem("2.5", "2.5")); txtSchNumber.Items.Add(new ListItem("3", "3")); txtSchNumber.Items.Add(new ListItem("0.1", "0.1")); txtSchNumber.Items.Add(new ListItem("0.2", "0.2")); txtSchNumber.Items.Add(new ListItem("0.3", "0.3")); txtSchNumber.Items.Add(new ListItem("0.4", "0.4")); txtSchNumber.Items.Add(new ListItem("0.6", "0.6")); txtSchNumber.Items.Add(new ListItem("0.7", "0.7")); txtSchNumber.Items.Add(new ListItem("0.8", "0.8")); txtSchNumber.Items.Add(new ListItem("0.9", "0.9")); try { if (keyid != "") { valObj = BLLTable <HR_SchClass> .Factory(conn).GetRowData(HR_SchClass.Attribute.SchClassid, keyid); if (valObj == null) { return; } txtSchClassid.Value = Convert.ToString(valObj.SchClassid); //Convert.ToInt32 txtSchName.Value = Convert.ToString(valObj.SchName); //Convert.ToString txtStartHour.Value = Convert.ToString(valObj.StartHour); //Convert.ToInt32 txtStartMin.Value = Convert.ToString(valObj.StartMin); //Convert.ToInt32 txtEndHour.Value = Convert.ToString(valObj.EndHour); //Convert.ToInt32 txtEndMin.Value = Convert.ToString(valObj.EndMin); //Convert.ToInt32 txtLateMinutes.Value = Convert.ToString(valObj.LateMinutes); //Convert.ToInt32 txtEarlyMinutes.Value = Convert.ToString(valObj.EarlyMinutes); //Convert.ToInt32 txtCheckIn.Checked = valObj.CheckIn; txtCheckOut.Checked = valObj.CheckOut; txtCheckInHour1.Value = Convert.ToString(valObj.CheckInHour1); //Convert.ToInt32 txtCheckInMin1.Value = Convert.ToString(valObj.CheckInMin1); //Convert.ToInt32 txtCheckInHour2.Value = Convert.ToString(valObj.CheckInHour2); //Convert.ToInt32 txtCheckInMin2.Value = Convert.ToString(valObj.CheckInMin2); //Convert.ToInt32 txtCheckOutHour1.Value = Convert.ToString(valObj.CheckOutHour1); //Convert.ToInt32 txtCheckOutMin1.Value = Convert.ToString(valObj.CheckOutMin1); //Convert.ToInt32 txtCheckOutHour2.Value = Convert.ToString(valObj.CheckOutHour2); //Convert.ToInt32 txtCheckOutMin2.Value = Convert.ToString(valObj.CheckOutMin2); //Convert.ToInt32 txtColor.Value = Convert.ToString(valObj.Color); //Convert.ToInt32 txtIsOvertime.Checked = valObj.IsOverTime; txtSchNumber.Value = valObj.SchNumber.ToString(); txtSchUnit.SelectedValue = valObj.SchUnit.ToString(); } } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void btnOK_Click(object sender, EventArgs e) { try { HR_SchClass valObj = new HR_SchClass(); if (txtSchClassid.Value != "") { valObj.SchClassid = Convert.ToInt32(txtSchClassid.Value); } if (txtSchName.Value != "") { valObj.SchName = Convert.ToString(txtSchName.Value); } if (txtStartHour.Value != "") { valObj.StartHour = Convert.ToInt32(txtStartHour.Value); } if (txtStartMin.Value != "") { valObj.StartMin = Convert.ToInt32(txtStartMin.Value); } if (txtEndHour.Value != "") { valObj.EndHour = Convert.ToInt32(txtEndHour.Value); } if (txtEndMin.Value != "") { valObj.EndMin = Convert.ToInt32(txtEndMin.Value); } if (txtLateMinutes.Value != "") { valObj.LateMinutes = Convert.ToInt32(txtLateMinutes.Value); } if (txtEarlyMinutes.Value != "") { valObj.EarlyMinutes = Convert.ToInt32(txtEarlyMinutes.Value); } valObj.CheckIn = Convert.ToBoolean(txtCheckIn.Checked); valObj.CheckOut = Convert.ToBoolean(txtCheckOut.Checked); if (valObj.CheckIn) { if (txtCheckInHour1.Value != "") { valObj.CheckInHour1 = Convert.ToInt32(txtCheckInHour1.Value); } if (txtCheckInMin1.Value != "") { valObj.CheckInMin1 = Convert.ToInt32(txtCheckInMin1.Value); } if (txtCheckInHour2.Value != "") { valObj.CheckInHour2 = Convert.ToInt32(txtCheckInHour2.Value); } if (txtCheckInMin2.Value != "") { valObj.CheckInMin2 = Convert.ToInt32(txtCheckInMin2.Value); } } else { valObj.CheckInHour1 = valObj.StartHour; valObj.CheckInMin1 = valObj.StartMin; valObj.CheckInHour2 = valObj.StartHour; valObj.CheckInMin2 = valObj.StartMin; } if (valObj.CheckOut) { if (txtCheckOutHour1.Value != "") { valObj.CheckOutHour1 = Convert.ToInt32(txtCheckOutHour1.Value); } if (txtCheckOutMin1.Value != "") { valObj.CheckOutMin1 = Convert.ToInt32(txtCheckOutMin1.Value); } if (txtCheckOutHour2.Value != "") { valObj.CheckOutHour2 = Convert.ToInt32(txtCheckOutHour2.Value); } if (txtCheckOutMin2.Value != "") { valObj.CheckOutMin2 = Convert.ToInt32(txtCheckOutMin2.Value); } } else { valObj.CheckOutHour1 = valObj.EndHour; valObj.CheckOutMin1 = valObj.EndMin; valObj.CheckOutHour2 = valObj.EndHour; valObj.CheckOutMin2 = valObj.EndMin; } if (txtColor.Value != "") { valObj.Color = Convert.ToString(txtColor.Value); } valObj.IsOverTime = Convert.ToBoolean(txtIsOvertime.Checked); float num = -1; if (float.TryParse(txtSchNumber.Value, out num)) { valObj.SchNumber = num; } else { valObj.SchNumber = 0.5; } valObj.SchUnit = Convert.ToInt32(txtSchUnit.SelectedValue); if (keyid != "") { valObj.SchClassid = Convert.ToInt32(keyid); count = BLLTable <HR_SchClass> .Factory(conn).Update(valObj, HR_SchClass.Attribute.SchClassid); } else { count = BLLTable <HR_SchClass> .Factory(conn).Insert(valObj, HR_SchClass.Attribute.SchClassid); keyid = valObj.SchClassid.ToString(); } if (count > 0) { StringBuilder sbData = new StringBuilder("({valObj:''"); List <AttributeItem> lstCol = valObj.af_AttributeItemList; for (int i = 0; i < lstCol.Count; i++) { object val = valObj.GetValue(lstCol[i]); if (val != null) { sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'"); } } sbData.Append("})"); Button btn = (Button)sender; if (btn.ID == "btnOK" || btn.ID == "_btnOK") { ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "window.close();", true); //if (ViewState["hadSave"] == null) //{ // ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = '" + sbData.ToString() + "';}else{window.returnValue = '" + sbData.ToString() + "';}window.close();", true); //} //else //{ // ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = 're';}else{window.returnValue = 're';}window.close();", true); //} } else { txtSchClassid.Value = ""; txtSchName.Value = ""; txtStartHour.Value = "0"; txtStartMin.Value = "0"; txtEndHour.Value = "0"; txtEndMin.Value = "0"; txtLateMinutes.Value = "0"; txtEarlyMinutes.Value = "0"; txtCheckIn.Checked = false; txtCheckOut.Checked = false; txtCheckInHour1.Value = "0"; txtCheckInMin1.Value = "0"; txtCheckInHour2.Value = "0"; txtCheckInMin2.Value = "0"; txtCheckOutHour1.Value = "0"; txtCheckOutMin1.Value = "0"; txtCheckOutHour2.Value = "0"; txtCheckOutMin2.Value = "0"; txtColor.Value = "#009"; txtIsOvertime.Checked = false; txtSchNumber.Value = "0.5"; txtSchUnit.SelectedIndex = 1; } } } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void btnFind_Click(object sender, EventArgs e) { condObj = new HR_SchClass(); if(txtSchClassid.Value !="" ) condObj.Like(HR_SchClass.Attribute.SchClassid, Convert.ToInt32(txtSchClassid.Value)); if(txtSchName.Value !="" ) condObj.Like(HR_SchClass.Attribute.SchName, Convert.ToString(txtSchName.Value)); if(txtStartHour.Value !="" ) condObj.Like(HR_SchClass.Attribute.StartHour, Convert.ToInt32(txtStartHour.Value)); if(txtStartMin.Value !="" ) condObj.Like(HR_SchClass.Attribute.StartMin, Convert.ToInt32(txtStartMin.Value)); if(txtEndHour.Value !="" ) condObj.Like(HR_SchClass.Attribute.EndHour, Convert.ToInt32(txtEndHour.Value)); if(txtEndMin.Value !="" ) condObj.Like(HR_SchClass.Attribute.EndMin, Convert.ToInt32(txtEndMin.Value)); if(txtLateMinutes.Value !="" ) condObj.Like(HR_SchClass.Attribute.LateMinutes, Convert.ToInt32(txtLateMinutes.Value)); if(txtEarlyMinutes.Value !="" ) condObj.Like(HR_SchClass.Attribute.EarlyMinutes, Convert.ToInt32(txtEarlyMinutes.Value)); if(txtCheckIn.Value !="" ) condObj.CheckIn = Convert.ToBoolean(txtCheckIn.Checked); if(txtCheckOut.Value !="" ) condObj.CheckOut = Convert.ToBoolean(txtCheckOut.Checked); if(txtCheckInHour1.Value !="" ) condObj.Like(HR_SchClass.Attribute.CheckInHour1, Convert.ToInt32(txtCheckInHour1.Value)); if(txtCheckInMin1.Value !="" ) condObj.Like(HR_SchClass.Attribute.CheckInMin1, Convert.ToInt32(txtCheckInMin1.Value)); if(txtCheckInHour2.Value !="" ) condObj.Like(HR_SchClass.Attribute.CheckInHour2, Convert.ToInt32(txtCheckInHour2.Value)); if(txtCheckInMin2.Value !="" ) condObj.Like(HR_SchClass.Attribute.CheckInMin2, Convert.ToInt32(txtCheckInMin2.Value)); if(txtCheckOutHour1.Value !="" ) condObj.Like(HR_SchClass.Attribute.CheckOutHour1, Convert.ToInt32(txtCheckOutHour1.Value)); if(txtCheckOutMin1.Value !="" ) condObj.Like(HR_SchClass.Attribute.CheckOutMin1, Convert.ToInt32(txtCheckOutMin1.Value)); if(txtCheckOutHour2.Value !="" ) condObj.Like(HR_SchClass.Attribute.CheckOutHour2, Convert.ToInt32(txtCheckOutHour2.Value)); if(txtCheckOutMin2.Value !="" ) condObj.Like(HR_SchClass.Attribute.CheckOutMin2, Convert.ToInt32(txtCheckOutMin2.Value)); if(txtColor.Value !="" ) condObj.Like(HR_SchClass.Attribute.Color, Convert.ToInt32(txtColor.Value)); if(txtIsOvertime.Value !="" ) condObj.IsOverTime = Convert.ToBoolean(txtIsOvertime.Checked); hidCondition.Value = condObj.ToJson(20); BindList(condObj, 1); }
protected void Page_Load(object sender, EventArgs e) { #region//Ĭ�����ص��� //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(HR_SchClass.Attribute.EXP1); //hideTableColumnList.Add(HR_SchClass.Attribute.EXP2); //hideTableColumnList.Add(HR_SchClass.Attribute.EXP3); //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(HR_SchClass.Attribute.EXP1); //hideFindColumnList.Add(HR_SchClass.Attribute.EXP2); //hideFindColumnList.Add(HR_SchClass.Attribute.EXP3); #endregion condObj.OrderBy(HR_SchClass.Attribute.SchClassid, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "��ѯ"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { HR_SchClass roleOld = new HR_SchClass(); roleOld.Where(HR_SchClass.Attribute.SchClassid, Request["ids"].ToString()); listObj = BLLTable<HR_SchClass>.Factory(conn).Select(valObj, roleOld); for (int i = 0; i < listObj.Count; i++) { if (i > 0) { hidOld.Value += ","; hidInitIDS.Value += ","; } hidOld.Value += "{ID:'" + listObj[i].SchClassid + "',Name:'" + listObj[i].SchClassid + "'}";//�����Name������ʾ���б��У��������ض��塣 hidInitIDS.Value += listObj[i].SchClassid; } } try { listObj = BLLTable<HR_SchClass>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void Page_Load(object sender, EventArgs e) { title = "排班查看"; Page.Title = title; if (Request["staffid"] != null) { hidstaffid.Value = Request["staffid"]; } if (Request["deptid"] != null) { hiddeptid.Value = Request["deptid"]; } if (Request["orgid"] != null) { hidorgid.Value = Request["orgid"]; } if (Request["name"] != null) { title += "--" + System.Uri.UnescapeDataString(Request["name"]); hidname.Value = System.Uri.UnescapeDataString(Request["name"]); } else if (hidname.Value != "") { title += System.Uri.UnescapeDataString(hidname.Value); } else { title += "--" + userBase.StaffName; } if (!IsPostBack) { #region//默认属性初始化 dll_Year.Items.Clear(); dll_Month.Items.Clear(); DateTime dt = DateTime.Now; for (int y = dt.Year - 25; y < dt.Year + 25; y++) { dll_Year.Items.Add(new ListItem(y.ToString(), y.ToString())); } dll_Year.Value = dt.Year.ToString(); dll_Month.Items.Add(new ListItem("未选择", "0")); for (int y = 1; y < 13; y++) { dll_Month.Items.Add(new ListItem(y.ToString(), y.ToString())); } dll_Month.Value = dt.Month.ToString(); //dll_Day.Text = dt.Day.ToString(); dll_Type.Items.AddRange(FormHelper.GetListItem(HR_Scheduling.Attribute.SchType)); #endregion HR_SchClass con = new HR_SchClass(); con.OrderBy(new List <OrderByItem>(new OrderByItem[] { new OrderByItem(HR_SchClass.Attribute.StartHour, Order.Asc), new OrderByItem(HR_SchClass.Attribute.StartMin, Order.Asc), new OrderByItem(HR_SchClass.Attribute.EndHour, Order.Asc), new OrderByItem(HR_SchClass.Attribute.EndMin, Order.Asc) })); repList.DataSource = BLLTable <HR_SchClass> .Factory(conn).Select(new HR_SchClass(), con); repList.DataBind(); } }
protected void btnSetPageSize_Click(object sender, EventArgs e) { aspPager.PageSize = int.Parse(txtPageSize.Value); if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<HR_SchClass>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "详细"; Page.Title = title; if (!IsPostBack) { try { if (!string.IsNullOrEmpty(Request["SchClassid"])) { valObj = BLLTable <HR_SchClass> .Factory(conn).GetRowData(HR_SchClass.Attribute.SchClassid, Request["SchClassid"]); if (valObj == null) { return; } txtSchClassid.Text = Convert.ToString(valObj.SchClassid);//Convert.ToInt32 txtSchName.Text = Convert.ToString(valObj.SchName);//Convert.ToString txtStartHour.Text = Convert.ToString(valObj.StartHour);//Convert.ToInt32 txtStartMin.Text = Convert.ToString(valObj.StartMin);//Convert.ToInt32 txtEndHour.Text = Convert.ToString(valObj.EndHour);//Convert.ToInt32 txtEndMin.Text = Convert.ToString(valObj.EndMin);//Convert.ToInt32 txtLateMinutes.Text = Convert.ToString(valObj.LateMinutes);//Convert.ToInt32 txtEarlyMinutes.Text = Convert.ToString(valObj.EarlyMinutes);//Convert.ToInt32 txtCheckIn.Checked = valObj.CheckIn; txtCheckOut.Checked = valObj.CheckOut; txtCheckInHour1.Text = Convert.ToString(valObj.CheckInHour1);//Convert.ToInt32 txtCheckInMin1.Text = Convert.ToString(valObj.CheckInMin1);//Convert.ToInt32 txtCheckInHour2.Text = Convert.ToString(valObj.CheckInHour2);//Convert.ToInt32 txtCheckInMin2.Text = Convert.ToString(valObj.CheckInMin2);//Convert.ToInt32 txtCheckOutHour1.Text = Convert.ToString(valObj.CheckOutHour1);//Convert.ToInt32 txtCheckOutMin1.Text = Convert.ToString(valObj.CheckOutMin1);//Convert.ToInt32 txtCheckOutHour2.Text = Convert.ToString(valObj.CheckOutHour2);//Convert.ToInt32 txtCheckOutMin2.Text = Convert.ToString(valObj.CheckOutMin2);//Convert.ToInt32 txtColor.Text = Convert.ToString(valObj.Color);//Convert.ToInt32 txtIsOvertime.Checked = valObj.IsOverTime; } } catch (Exception ex) { litWarn.Text = ex.Message; } if (Request["ajax"] != null) { Response.Clear(); Response.Buffer = true; Response.Charset = "utf-8"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");//设置输出流为简体中文 //Response.ContentType = "html/text"; this.EnableViewState = false; System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-CN", true); System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad); System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter); divC.RenderControl(oHtmlTextWriter); Response.Write(oStringWriter.ToString()); Response.End(); } } }
protected void btnOK_Click(object sender, EventArgs e) { try { HR_SchClass valObj = new HR_SchClass(); if(txtSchClassid.Value !="" ) valObj.SchClassid = Convert.ToInt32(txtSchClassid.Value); if(txtSchName.Value !="" ) valObj.SchName = Convert.ToString(txtSchName.Value); if(txtStartHour.Value !="" ) valObj.StartHour = Convert.ToInt32(txtStartHour.Value); if(txtStartMin.Value !="" ) valObj.StartMin = Convert.ToInt32(txtStartMin.Value); if(txtEndHour.Value !="" ) valObj.EndHour = Convert.ToInt32(txtEndHour.Value); if(txtEndMin.Value !="" ) valObj.EndMin = Convert.ToInt32(txtEndMin.Value); if(txtLateMinutes.Value !="" ) valObj.LateMinutes = Convert.ToInt32(txtLateMinutes.Value); if(txtEarlyMinutes.Value !="" ) valObj.EarlyMinutes = Convert.ToInt32(txtEarlyMinutes.Value); valObj.CheckIn = Convert.ToBoolean(txtCheckIn.Checked); valObj.CheckOut = Convert.ToBoolean(txtCheckOut.Checked); if (valObj.CheckIn) { if (txtCheckInHour1.Value != "") valObj.CheckInHour1 = Convert.ToInt32(txtCheckInHour1.Value); if (txtCheckInMin1.Value != "") valObj.CheckInMin1 = Convert.ToInt32(txtCheckInMin1.Value); if (txtCheckInHour2.Value != "") valObj.CheckInHour2 = Convert.ToInt32(txtCheckInHour2.Value); if (txtCheckInMin2.Value != "") valObj.CheckInMin2 = Convert.ToInt32(txtCheckInMin2.Value); } else { valObj.CheckInHour1 = valObj.StartHour; valObj.CheckInMin1 = valObj.StartMin; valObj.CheckInHour2 = valObj.StartHour; valObj.CheckInMin2 = valObj.StartMin; } if (valObj.CheckOut) { if (txtCheckOutHour1.Value != "") valObj.CheckOutHour1 = Convert.ToInt32(txtCheckOutHour1.Value); if (txtCheckOutMin1.Value != "") valObj.CheckOutMin1 = Convert.ToInt32(txtCheckOutMin1.Value); if (txtCheckOutHour2.Value != "") valObj.CheckOutHour2 = Convert.ToInt32(txtCheckOutHour2.Value); if (txtCheckOutMin2.Value != "") valObj.CheckOutMin2 = Convert.ToInt32(txtCheckOutMin2.Value); } else { valObj.CheckOutHour1 = valObj.EndHour; valObj.CheckOutMin1 = valObj.EndMin; valObj.CheckOutHour2 = valObj.EndHour; valObj.CheckOutMin2 = valObj.EndMin; } if (txtColor.Value != "") valObj.Color = Convert.ToString(txtColor.Value); valObj.IsOverTime = Convert.ToBoolean(txtIsOvertime.Checked); float num = -1; if (float.TryParse(txtSchNumber.Value, out num)) { valObj.SchNumber = num; } else { valObj.SchNumber = 0.5; } valObj.SchUnit = Convert.ToInt32(txtSchUnit.SelectedValue); if (keyid != "") { valObj.SchClassid = Convert.ToInt32(keyid); count = BLLTable<HR_SchClass>.Factory(conn).Update(valObj, HR_SchClass.Attribute.SchClassid); } else { count = BLLTable<HR_SchClass>.Factory(conn).Insert(valObj, HR_SchClass.Attribute.SchClassid); keyid = valObj.SchClassid.ToString(); } if (count > 0) { StringBuilder sbData = new StringBuilder("({valObj:''"); List<AttributeItem> lstCol = valObj.af_AttributeItemList; for (int i = 0; i < lstCol.Count; i++) { object val = valObj.GetValue(lstCol[i]); if (val != null) { sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'"); } } sbData.Append("})"); Button btn = (Button)sender; if (btn.ID == "btnOK" || btn.ID == "_btnOK") { ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "window.close();", true); //if (ViewState["hadSave"] == null) //{ // ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = '" + sbData.ToString() + "';}else{window.returnValue = '" + sbData.ToString() + "';}window.close();", true); //} //else //{ // ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = 're';}else{window.returnValue = 're';}window.close();", true); //} } else { txtSchClassid.Value = ""; txtSchName.Value =""; txtStartHour.Value ="0"; txtStartMin.Value ="0"; txtEndHour.Value ="0"; txtEndMin.Value ="0"; txtLateMinutes.Value ="0"; txtEarlyMinutes.Value ="0"; txtCheckIn.Checked=false; txtCheckOut.Checked=false; txtCheckInHour1.Value ="0"; txtCheckInMin1.Value ="0"; txtCheckInHour2.Value ="0"; txtCheckInMin2.Value ="0"; txtCheckOutHour1.Value ="0"; txtCheckOutMin1.Value ="0"; txtCheckOutHour2.Value ="0"; txtCheckOutMin2.Value ="0"; txtColor.Value ="#009"; txtIsOvertime.Checked=false; txtSchNumber.Value = "0.5"; txtSchUnit.SelectedIndex = 1; } } } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "�༭"; Page.Title = title; if (!string.IsNullOrEmpty(Request["SchClassid"])) { keyid = Request["SchClassid"]; } if (!string.IsNullOrEmpty(Request["KeyID"])) { keyid = Request["KeyID"]; } if (!IsPostBack) { txtSchUnit.Items.AddRange(FormHelper.GetListItem(HR_SchClass.Attribute.SchUnit)); txtSchUnit.Items.RemoveAt(0); this.txtSchClassid.Disabled = true; this.txtSchClassid.Attributes["class"] = "dis"; for (int i = 0; i < 24; i++) { txtStartHour.Items.Add(new ListItem(i.ToString(), i.ToString())); txtEndHour.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckInHour1.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckInHour2.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckOutHour1.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckOutHour2.Items.Add(new ListItem(i.ToString(), i.ToString())); } for (int i = 0; i < 60; i++) { txtStartMin.Items.Add(new ListItem(i.ToString(), i.ToString())); txtEndMin.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckInMin1.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckInMin2.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckOutMin1.Items.Add(new ListItem(i.ToString(), i.ToString())); txtCheckOutMin2.Items.Add(new ListItem(i.ToString(), i.ToString())); } for (int i = 1; i <= 120; i++) { txtEarlyMinutes.Items.Add(new ListItem(i.ToString(), i.ToString())); txtLateMinutes.Items.Add(new ListItem(i.ToString(), i.ToString())); } txtSchNumber.Items.Add(new ListItem("0.5", "0.5")); txtSchNumber.Items.Add(new ListItem("1", "1")); txtSchNumber.Items.Add(new ListItem("1.5", "1.5")); txtSchNumber.Items.Add(new ListItem("2", "2")); txtSchNumber.Items.Add(new ListItem("2.5", "2.5")); txtSchNumber.Items.Add(new ListItem("3", "3")); txtSchNumber.Items.Add(new ListItem("0.1", "0.1")); txtSchNumber.Items.Add(new ListItem("0.2", "0.2")); txtSchNumber.Items.Add(new ListItem("0.3", "0.3")); txtSchNumber.Items.Add(new ListItem("0.4", "0.4")); txtSchNumber.Items.Add(new ListItem("0.6", "0.6")); txtSchNumber.Items.Add(new ListItem("0.7", "0.7")); txtSchNumber.Items.Add(new ListItem("0.8", "0.8")); txtSchNumber.Items.Add(new ListItem("0.9", "0.9")); try { if (keyid != "") { valObj = BLLTable<HR_SchClass>.Factory(conn).GetRowData(HR_SchClass.Attribute.SchClassid, keyid); if (valObj == null) return; txtSchClassid.Value = Convert.ToString(valObj.SchClassid);//Convert.ToInt32 txtSchName.Value = Convert.ToString(valObj.SchName);//Convert.ToString txtStartHour.Value = Convert.ToString(valObj.StartHour);//Convert.ToInt32 txtStartMin.Value = Convert.ToString(valObj.StartMin);//Convert.ToInt32 txtEndHour.Value = Convert.ToString(valObj.EndHour);//Convert.ToInt32 txtEndMin.Value = Convert.ToString(valObj.EndMin);//Convert.ToInt32 txtLateMinutes.Value = Convert.ToString(valObj.LateMinutes);//Convert.ToInt32 txtEarlyMinutes.Value = Convert.ToString(valObj.EarlyMinutes);//Convert.ToInt32 txtCheckIn.Checked = valObj.CheckIn; txtCheckOut.Checked = valObj.CheckOut; txtCheckInHour1.Value = Convert.ToString(valObj.CheckInHour1);//Convert.ToInt32 txtCheckInMin1.Value = Convert.ToString(valObj.CheckInMin1);//Convert.ToInt32 txtCheckInHour2.Value = Convert.ToString(valObj.CheckInHour2);//Convert.ToInt32 txtCheckInMin2.Value = Convert.ToString(valObj.CheckInMin2);//Convert.ToInt32 txtCheckOutHour1.Value = Convert.ToString(valObj.CheckOutHour1);//Convert.ToInt32 txtCheckOutMin1.Value = Convert.ToString(valObj.CheckOutMin1);//Convert.ToInt32 txtCheckOutHour2.Value = Convert.ToString(valObj.CheckOutHour2);//Convert.ToInt32 txtCheckOutMin2.Value = Convert.ToString(valObj.CheckOutMin2);//Convert.ToInt32 txtColor.Value = Convert.ToString(valObj.Color);//Convert.ToInt32 txtIsOvertime.Checked = valObj.IsOverTime; txtSchNumber.Value = valObj.SchNumber.ToString(); txtSchUnit.SelectedValue = valObj.SchUnit.ToString(); } } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void btnFind_Click(object sender, EventArgs e) { condObj = new HR_SchClass(); if(txtSchClassid.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.SchClassid, Convert.ToInt32(txtSchClassid.Value)); if(txtSchName.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.SchName, Convert.ToString(txtSchName.Value)); if(txtStartHour.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.StartHour, Convert.ToInt32(txtStartHour.Value)); if(txtStartMin.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.StartMin, Convert.ToInt32(txtStartMin.Value)); if(txtEndHour.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.EndHour, Convert.ToInt32(txtEndHour.Value)); if(txtEndMin.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.EndMin, Convert.ToInt32(txtEndMin.Value)); if(txtLateMinutes.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.LateMinutes, Convert.ToInt32(txtLateMinutes.Value)); if(txtEarlyMinutes.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.EarlyMinutes, Convert.ToInt32(txtEarlyMinutes.Value)); if(txtCheckIn.Value !="" ) condObj.CheckIn = Convert.ToBoolean(txtCheckIn.Checked); if(txtCheckOut.Value !="" ) condObj.CheckOut = Convert.ToBoolean(txtCheckOut.Checked); if(txtCheckInHour1.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.CheckInHour1, Convert.ToInt32(txtCheckInHour1.Value)); if(txtCheckInMin1.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.CheckInMin1, Convert.ToInt32(txtCheckInMin1.Value)); if(txtCheckInHour2.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.CheckInHour2, Convert.ToInt32(txtCheckInHour2.Value)); if(txtCheckInMin2.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.CheckInMin2, Convert.ToInt32(txtCheckInMin2.Value)); if(txtCheckOutHour1.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.CheckOutHour1, Convert.ToInt32(txtCheckOutHour1.Value)); if(txtCheckOutMin1.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.CheckOutMin1, Convert.ToInt32(txtCheckOutMin1.Value)); if(txtCheckOutHour2.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.CheckOutHour2, Convert.ToInt32(txtCheckOutHour2.Value)); if(txtCheckOutMin2.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.CheckOutMin2, Convert.ToInt32(txtCheckOutMin2.Value)); if(txtColor.Value !="" ) condObj.Like_OR(HR_SchClass.Attribute.Color, Convert.ToInt32(txtColor.Value)); if(txtIsOvertime.Value !="" ) condObj.IsOverTime = Convert.ToBoolean(txtIsOvertime.Checked); try { hidCondition.Value = condObj.ToJson(20); listObj = BLLTable<HR_SchClass>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { //���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼ if (Request["DelSchClassid"] != null) { int re = BLLTable<HR_SchClass>.Factory(conn).Delete(HR_SchClass.Attribute.SchClassid, Request["DelSchClassid"]); HR_Scheduling sdcond = new HR_Scheduling(); sdcond.Top(500); sdcond.Where(" {0} = {1} ", HR_Scheduling.Attribute.SchClassid, Request["DelSchClassid"]); while (BLLTable<HR_Scheduling>.Factory(conn).Delete(sdcond) > 0) { continue; } if (re > 0) { Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ } else { Response.Write("ɾ��ʧ�ܣ�"); } } //���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼ if (Request["DelKeyIDS"] != null) { HR_SchClass cond = new HR_SchClass(); cond.In(HR_SchClass.Attribute.SchClassid, Request["DelKeyIDS"]); int re = BLLTable<HR_SchClass>.Factory(conn).Delete(cond); HR_Scheduling sdcond = new HR_Scheduling(); sdcond.Top(500); sdcond.In(HR_Scheduling.Attribute.SchClassid, Request["DelKeyIDS"]); while (BLLTable<HR_Scheduling>.Factory(conn).Delete(sdcond) > 0) { continue; } if (re > 0) { Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ } else { Response.Write("ɾ��ʧ�ܣ�"); } } //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ��� if (Request["saveInfo"] != null) { HR_SchClass val = new HR_SchClass(); val.SchClassid = int.Parse(Request["FieldKeyID"]); List<AttributeItem> lstCol = val.af_AttributeItemList; for (int i = 0; i < lstCol.Count; i++) { if (!string.IsNullOrEmpty(Request["txt" + lstCol[i].FieldName])) { val.SetValue(lstCol[i].FieldName,Request["txt" + lstCol[i].FieldName]); } } BLLTable<HR_SchClass>.Factory(conn).Update(val, HR_SchClass.Attribute.SchClassid); Response.Write("���û���Ϣ�ɹ�"); } Response.End(); }
protected void btnFind_Click(object sender, EventArgs e) { condObj = new HR_SchClass(); if (txtSchClassid.Value != "") { condObj.Like(HR_SchClass.Attribute.SchClassid, Convert.ToInt32(txtSchClassid.Value)); } if (txtSchName.Value != "") { condObj.Like(HR_SchClass.Attribute.SchName, Convert.ToString(txtSchName.Value)); } if (txtStartHour.Value != "") { condObj.Like(HR_SchClass.Attribute.StartHour, Convert.ToInt32(txtStartHour.Value)); } if (txtStartMin.Value != "") { condObj.Like(HR_SchClass.Attribute.StartMin, Convert.ToInt32(txtStartMin.Value)); } if (txtEndHour.Value != "") { condObj.Like(HR_SchClass.Attribute.EndHour, Convert.ToInt32(txtEndHour.Value)); } if (txtEndMin.Value != "") { condObj.Like(HR_SchClass.Attribute.EndMin, Convert.ToInt32(txtEndMin.Value)); } if (txtLateMinutes.Value != "") { condObj.Like(HR_SchClass.Attribute.LateMinutes, Convert.ToInt32(txtLateMinutes.Value)); } if (txtEarlyMinutes.Value != "") { condObj.Like(HR_SchClass.Attribute.EarlyMinutes, Convert.ToInt32(txtEarlyMinutes.Value)); } if (txtCheckIn.Value != "") { condObj.CheckIn = Convert.ToBoolean(txtCheckIn.Checked); } if (txtCheckOut.Value != "") { condObj.CheckOut = Convert.ToBoolean(txtCheckOut.Checked); } if (txtCheckInHour1.Value != "") { condObj.Like(HR_SchClass.Attribute.CheckInHour1, Convert.ToInt32(txtCheckInHour1.Value)); } if (txtCheckInMin1.Value != "") { condObj.Like(HR_SchClass.Attribute.CheckInMin1, Convert.ToInt32(txtCheckInMin1.Value)); } if (txtCheckInHour2.Value != "") { condObj.Like(HR_SchClass.Attribute.CheckInHour2, Convert.ToInt32(txtCheckInHour2.Value)); } if (txtCheckInMin2.Value != "") { condObj.Like(HR_SchClass.Attribute.CheckInMin2, Convert.ToInt32(txtCheckInMin2.Value)); } if (txtCheckOutHour1.Value != "") { condObj.Like(HR_SchClass.Attribute.CheckOutHour1, Convert.ToInt32(txtCheckOutHour1.Value)); } if (txtCheckOutMin1.Value != "") { condObj.Like(HR_SchClass.Attribute.CheckOutMin1, Convert.ToInt32(txtCheckOutMin1.Value)); } if (txtCheckOutHour2.Value != "") { condObj.Like(HR_SchClass.Attribute.CheckOutHour2, Convert.ToInt32(txtCheckOutHour2.Value)); } if (txtCheckOutMin2.Value != "") { condObj.Like(HR_SchClass.Attribute.CheckOutMin2, Convert.ToInt32(txtCheckOutMin2.Value)); } if (txtColor.Value != "") { condObj.Like(HR_SchClass.Attribute.Color, Convert.ToInt32(txtColor.Value)); } if (txtIsOvertime.Value != "") { condObj.IsOverTime = Convert.ToBoolean(txtIsOvertime.Checked); } hidCondition.Value = condObj.ToJson(20); BindList(condObj, 1); }
private void BindList(HR_SchClass condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(HR_SchClass.Attribute.SchClassid, Order.Desc); #region//����Ȩ������ #endregion //condObj.PID = decimal.Parse(pid); listObj = BLLTable<HR_SchClass>.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) { condObj = new HR_SchClass(); if (txtSchClassid.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.SchClassid, Convert.ToInt32(txtSchClassid.Value)); } if (txtSchName.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.SchName, Convert.ToString(txtSchName.Value)); } if (txtStartHour.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.StartHour, Convert.ToInt32(txtStartHour.Value)); } if (txtStartMin.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.StartMin, Convert.ToInt32(txtStartMin.Value)); } if (txtEndHour.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.EndHour, Convert.ToInt32(txtEndHour.Value)); } if (txtEndMin.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.EndMin, Convert.ToInt32(txtEndMin.Value)); } if (txtLateMinutes.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.LateMinutes, Convert.ToInt32(txtLateMinutes.Value)); } if (txtEarlyMinutes.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.EarlyMinutes, Convert.ToInt32(txtEarlyMinutes.Value)); } if (txtCheckIn.Value != "") { condObj.CheckIn = Convert.ToBoolean(txtCheckIn.Checked); } if (txtCheckOut.Value != "") { condObj.CheckOut = Convert.ToBoolean(txtCheckOut.Checked); } if (txtCheckInHour1.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.CheckInHour1, Convert.ToInt32(txtCheckInHour1.Value)); } if (txtCheckInMin1.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.CheckInMin1, Convert.ToInt32(txtCheckInMin1.Value)); } if (txtCheckInHour2.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.CheckInHour2, Convert.ToInt32(txtCheckInHour2.Value)); } if (txtCheckInMin2.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.CheckInMin2, Convert.ToInt32(txtCheckInMin2.Value)); } if (txtCheckOutHour1.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.CheckOutHour1, Convert.ToInt32(txtCheckOutHour1.Value)); } if (txtCheckOutMin1.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.CheckOutMin1, Convert.ToInt32(txtCheckOutMin1.Value)); } if (txtCheckOutHour2.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.CheckOutHour2, Convert.ToInt32(txtCheckOutHour2.Value)); } if (txtCheckOutMin2.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.CheckOutMin2, Convert.ToInt32(txtCheckOutMin2.Value)); } if (txtColor.Value != "") { condObj.Like_OR(HR_SchClass.Attribute.Color, Convert.ToInt32(txtColor.Value)); } if (txtIsOvertime.Value != "") { condObj.IsOverTime = Convert.ToBoolean(txtIsOvertime.Checked); } try { hidCondition.Value = condObj.ToJson(20); listObj = BLLTable <HR_SchClass> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "��ϸ"; Page.Title = title; if (!IsPostBack) { try { if (!string.IsNullOrEmpty(Request["SchClassid"])) { valObj = BLLTable<HR_SchClass>.Factory(conn).GetRowData(HR_SchClass.Attribute.SchClassid, Request["SchClassid"]); if(valObj==null) return ; txtSchClassid.Text = Convert.ToString(valObj.SchClassid);//Convert.ToInt32 txtSchName.Text = Convert.ToString(valObj.SchName);//Convert.ToString txtStartHour.Text = Convert.ToString(valObj.StartHour);//Convert.ToInt32 txtStartMin.Text = Convert.ToString(valObj.StartMin);//Convert.ToInt32 txtEndHour.Text = Convert.ToString(valObj.EndHour);//Convert.ToInt32 txtEndMin.Text = Convert.ToString(valObj.EndMin);//Convert.ToInt32 txtLateMinutes.Text = Convert.ToString(valObj.LateMinutes);//Convert.ToInt32 txtEarlyMinutes.Text = Convert.ToString(valObj.EarlyMinutes);//Convert.ToInt32 txtCheckIn.Checked = valObj.CheckIn; txtCheckOut.Checked = valObj.CheckOut; txtCheckInHour1.Text = Convert.ToString(valObj.CheckInHour1);//Convert.ToInt32 txtCheckInMin1.Text = Convert.ToString(valObj.CheckInMin1);//Convert.ToInt32 txtCheckInHour2.Text = Convert.ToString(valObj.CheckInHour2);//Convert.ToInt32 txtCheckInMin2.Text = Convert.ToString(valObj.CheckInMin2);//Convert.ToInt32 txtCheckOutHour1.Text = Convert.ToString(valObj.CheckOutHour1);//Convert.ToInt32 txtCheckOutMin1.Text = Convert.ToString(valObj.CheckOutMin1);//Convert.ToInt32 txtCheckOutHour2.Text = Convert.ToString(valObj.CheckOutHour2);//Convert.ToInt32 txtCheckOutMin2.Text = Convert.ToString(valObj.CheckOutMin2);//Convert.ToInt32 txtColor.Text = Convert.ToString(valObj.Color);//Convert.ToInt32 txtIsOvertime.Checked = valObj.IsOverTime; } } catch (Exception ex) { litWarn.Text = ex.Message; } if (Request["ajax"] != null) { Response.Clear(); Response.Buffer = true; Response.Charset = "utf-8"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");//���������Ϊ�������� //Response.ContentType = "html/text"; this.EnableViewState = false; System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-CN", true); System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad); System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter); divC.RenderControl(oHtmlTextWriter); Response.Write(oStringWriter.ToString()); Response.End(); } } }