protected void btnFind_Click(object sender, EventArgs e) { condObj = new V_SchedulingSchClass(); if (wucSelStaff1.Staff_ID > 0) { condObj.STAFF_ID = (int)wucSelStaff1.Staff_ID; } if (dll_Year.SelectedIndex >= 1) { condObj._SchYear = Convert.ToInt32(dll_Year.Text); } if (dll_Month.SelectedIndex >= 1) { condObj.SchMonth = Convert.ToInt16(dll_Month.Text); } if (dll_Day.SelectedIndex >= 1) { condObj.SchDay = Convert.ToInt16(dll_Day.Text); } if (dll_Type.SelectedIndex >= 1) { condObj.SchType = Convert.ToInt16(dll_Type.SelectedValue); } condObj.OrderBy(V_SchedulingSchClass.Attribute.SchDay, Order.Asc); BindList(condObj); }
protected void Page_Load(object sender, EventArgs e) { #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP1); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP2); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP1); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP2); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP3); #endregion condObj.OrderBy(V_SchedulingSchClass.Attribute.SchName, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "查询"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { V_SchedulingSchClass roleOld = new V_SchedulingSchClass(); roleOld.Where(V_SchedulingSchClass.Attribute.SchName, Request["ids"].ToString()); listObj = BLLTable <V_SchedulingSchClass> .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].SchName + "',Name:'" + listObj[i].SchName + "'}";//这里的Name用于显示在列表中,请自行重定义。 hidInitIDS.Value += listObj[i].SchName; } } try { listObj = BLLTable <V_SchedulingSchClass> .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 btnFind_Click(object sender, EventArgs e) { condObj = new V_SchedulingSchClass(); if (wucSelStaff1.Staff_ID > 0) condObj.STAFF_ID = (int)wucSelStaff1.Staff_ID; if(dll_Year.SelectedIndex >= 1) condObj._SchYear = Convert.ToInt32(dll_Year.Text); if (dll_Month.SelectedIndex >= 1) condObj.SchMonth = Convert.ToInt16(dll_Month.Text); if (dll_Day.SelectedIndex >= 1) condObj.SchDay = Convert.ToInt16(dll_Day.Text); if (dll_Type.SelectedIndex >= 1) condObj.SchType = Convert.ToInt16(dll_Type.SelectedValue); condObj.OrderBy(V_SchedulingSchClass.Attribute.SchDay, Order.Asc); BindList(condObj); }
protected void btnReset_Click(object sender, EventArgs e) { DateTime dt = DateTime.Now; dll_Year.Text = dt.Year.ToString(); dll_Month.Text = dt.Month.ToString(); dll_Type.SelectedIndex = 0; dll_Day.SelectedIndex = 0; wucSelStaff1.Staff_NAME = ""; wucSelStaff1.Staff_ID = 0; condObj = new V_SchedulingSchClass(); condObj._SchYear = Convert.ToInt32(dll_Year.Text); condObj._SchMonth = Convert.ToInt16(dll_Month.Text); condObj.OrderBy(V_SchedulingSchClass.Attribute.SchDay, Order.Asc); BindList(condObj); }
protected void Page_Load(object sender, EventArgs e) { #region//Ĭ�����ص��� //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP1); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP2); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP3); //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP1); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP2); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP3); #endregion title = "�Ű����"; repHead.ViewStateMode = System.Web.UI.ViewStateMode.Disabled; repList.ViewStateMode = System.Web.UI.ViewStateMode.Disabled; Page.Title = title; if (Request["PID"] != null) { pid = Request["PID"]; } if (!IsPostBack) { #region//Ĭ�����Գ�ʼ�� dll_Year.Items.Clear(); dll_Month.Items.Clear(); dll_Day.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.Text = 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.Text = dt.Month.ToString(); DateTime ddt = new DateTime(dt.Year, dt.Month, 1); dll_Day.Items.Add(new ListItem("δѡ��", "0")); while (ddt.Month == dt.Month) { dll_Day.Items.Add(new ListItem(ddt.Day.ToString(), ddt.Day.ToString())); ddt = ddt.AddDays(1); } //dll_Day.Text = dt.Day.ToString(); dll_Type.Items.AddRange(FormHelper.GetListItem(HR_Scheduling.Attribute.SchType)); #endregion #region//���ݳ�ʼ�� #endregion condObj = new V_SchedulingSchClass(); condObj._SchYear = Convert.ToInt32(dll_Year.Text); condObj._SchMonth = Convert.ToInt16(dll_Month.Text); condObj.OrderBy(V_SchedulingSchClass.Attribute.SchDay, Order.Asc); BindList(condObj); } }
protected void Page_Load(object sender, EventArgs e) { #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP1); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP2); //hideTableColumnList.Add(V_SchedulingSchClass.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP1); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP2); //hideFindColumnList.Add(V_SchedulingSchClass.Attribute.EXP3); #endregion title = "排版管理"; repHead.ViewStateMode = System.Web.UI.ViewStateMode.Disabled; repList.ViewStateMode = System.Web.UI.ViewStateMode.Disabled; Page.Title = title; if (Request["PID"] != null) { pid = Request["PID"]; } if (!IsPostBack) { #region//默认属性初始化 dll_Year.Items.Clear(); dll_Month.Items.Clear(); dll_Day.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.Text = 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.Text = dt.Month.ToString(); DateTime ddt = new DateTime(dt.Year, dt.Month, 1); dll_Day.Items.Add(new ListItem("未选择", "0")); while (ddt.Month == dt.Month) { dll_Day.Items.Add(new ListItem(ddt.Day.ToString(), ddt.Day.ToString())); ddt = ddt.AddDays(1); } //dll_Day.Text = dt.Day.ToString(); dll_Type.Items.AddRange(FormHelper.GetListItem(HR_Scheduling.Attribute.SchType)); #endregion #region//数据初始化 #endregion condObj = new V_SchedulingSchClass(); condObj._SchYear = Convert.ToInt32(dll_Year.Text); condObj._SchMonth = Convert.ToInt16(dll_Month.Text); condObj.OrderBy(V_SchedulingSchClass.Attribute.SchDay, Order.Asc); BindList(condObj); } }
private Dictionary<DateTime, List<V_SchedulingSchClass>> GetScheduling(DateTime startTime, DateTime endTime, int type) { Dictionary<DateTime, List<V_SchedulingSchClass>> vsDic = new Dictionary<DateTime, List<V_SchedulingSchClass>>(); Dictionary<DateTime, List<int>> vsidDic = new Dictionary<DateTime, List<int>>(); V_SchedulingSchClass val = new V_SchedulingSchClass(); val.SchYear = 0; val.SchMonth = 0; val.SchDay = 0; val.SchClassid = 0; val.SchType = 0; val.SchName = "";//(50) Unchecked val.StartHour = 0;// Unchecked val.StartMin = 0;// Unchecked val.EndHour = 0;// Unchecked val.EndMin = 0;// Unchecked val.LateMinutes = 0;// Checked val.EarlyMinutes = 0;// Checked val.CheckIn = false;// Checked val.CheckOut = false;// Checked val.CheckInHour1 = 0;// Checked val.CheckInMin1 = 0;// Checked val.CheckInHour2 = 0;// Checked val.CheckInMin2 = 0;// Checked val.CheckOutHour1 = 0;// Checked val.CheckOutMin1 = 0;// Checked val.CheckOutHour2 = 0;// Checked val.CheckOutMin2 = 0;// Checked val.Color = "";//(10) Checked val.IsOverTime = false;// Unchecked val.SchNumber = 0;// Unchecked val.SchUnit = 0;// Unchecked V_SchedulingSchClass con = new V_SchedulingSchClass(); if (type > 0) con.SchType = type; int staffidd = -1; if (staffid.Trim() != "" && int.TryParse(staffid, out staffidd)) con.STAFF_ID = staffidd; else if (deptid.Trim() != "") con.Like(V_SchedulingSchClass.Attribute.DEPT_ID, deptid); else if (orgid.Trim() != "") con.Like(V_SchedulingSchClass.Attribute.ORG_ID, orgid); else con.STAFF_ID = (int)userBase.StaffID; string wher = " CAST(CAST({0} AS char(4)) + '-' + CAST({1} AS char(2)) + '-' + CAST({2} AS char(2)) as datetime) >= '{3}-{4}-{5}' and CAST(CAST({6} AS char(4)) + '-' + CAST({7} AS char(2)) + '-' + CAST({8} AS char(2)) as datetime) <= '{9}-{10}-{11}' "; con.Where(wher, V_SchedulingSchClass.Attribute.SchYear, V_SchedulingSchClass.Attribute.SchMonth, V_SchedulingSchClass.Attribute.SchDay, startTime.Year, startTime.Month, startTime.Day, V_SchedulingSchClass.Attribute.SchYear, V_SchedulingSchClass.Attribute.SchMonth, V_SchedulingSchClass.Attribute.SchDay, endTime.Year, endTime.Month, endTime.Day); val.Distinct = true; con.Distinct = true; con.OrderBy(new List<OrderByItem>(new OrderByItem[] { new OrderByItem(V_SchedulingSchClass.Attribute.StartHour, Order.Asc), new OrderByItem(V_SchedulingSchClass.Attribute.StartMin, Order.Asc), new OrderByItem(V_SchedulingSchClass.Attribute.EndHour, Order.Asc), new OrderByItem(V_SchedulingSchClass.Attribute.EndMin, Order.Asc) })); List<V_SchedulingSchClass> vsList = BLLTable<V_SchedulingSchClass>.Factory(conn).Select(val, con); foreach (V_SchedulingSchClass vs in vsList) { DateTime date = new DateTime(vs.SchYear, vs.SchMonth, vs.SchDay); if (!vsDic.ContainsKey(date)) vsDic.Add(date, new List<V_SchedulingSchClass>()); if (!vsidDic.ContainsKey(date)) vsidDic.Add(date, new List<int>()); if (!vsidDic[date].Contains(vs.SchClassid)) { vsidDic[date].Add(vs.SchClassid); vsDic[date].Add(vs); } } return vsDic; }
private Dictionary <DateTime, List <V_SchedulingSchClass> > GetScheduling(DateTime startTime, DateTime endTime, int type) { Dictionary <DateTime, List <V_SchedulingSchClass> > vsDic = new Dictionary <DateTime, List <V_SchedulingSchClass> >(); Dictionary <DateTime, List <int> > vsidDic = new Dictionary <DateTime, List <int> >(); V_SchedulingSchClass val = new V_SchedulingSchClass(); val.SchYear = 0; val.SchMonth = 0; val.SchDay = 0; val.SchClassid = 0; val.SchType = 0; val.SchName = ""; //(50) Unchecked val.StartHour = 0; // Unchecked val.StartMin = 0; // Unchecked val.EndHour = 0; // Unchecked val.EndMin = 0; // Unchecked val.LateMinutes = 0; // Checked val.EarlyMinutes = 0; // Checked val.CheckIn = false; // Checked val.CheckOut = false; // Checked val.CheckInHour1 = 0; // Checked val.CheckInMin1 = 0; // Checked val.CheckInHour2 = 0; // Checked val.CheckInMin2 = 0; // Checked val.CheckOutHour1 = 0; // Checked val.CheckOutMin1 = 0; // Checked val.CheckOutHour2 = 0; // Checked val.CheckOutMin2 = 0; // Checked val.Color = ""; //(10) Checked val.IsOverTime = false; // Unchecked val.SchNumber = 0; // Unchecked val.SchUnit = 0; // Unchecked V_SchedulingSchClass con = new V_SchedulingSchClass(); if (type > 0) { con.SchType = type; } int staffidd = -1; if (staffid.Trim() != "" && int.TryParse(staffid, out staffidd)) { con.STAFF_ID = staffidd; } else if (deptid.Trim() != "") { con.Like(V_SchedulingSchClass.Attribute.DEPT_ID, deptid); } else if (orgid.Trim() != "") { con.Like(V_SchedulingSchClass.Attribute.ORG_ID, orgid); } else { con.STAFF_ID = (int)userBase.StaffID; } string wher = " CAST(CAST({0} AS char(4)) + '-' + CAST({1} AS char(2)) + '-' + CAST({2} AS char(2)) as datetime) >= '{3}-{4}-{5}' and CAST(CAST({6} AS char(4)) + '-' + CAST({7} AS char(2)) + '-' + CAST({8} AS char(2)) as datetime) <= '{9}-{10}-{11}' "; con.Where(wher, V_SchedulingSchClass.Attribute.SchYear, V_SchedulingSchClass.Attribute.SchMonth, V_SchedulingSchClass.Attribute.SchDay, startTime.Year, startTime.Month, startTime.Day, V_SchedulingSchClass.Attribute.SchYear, V_SchedulingSchClass.Attribute.SchMonth, V_SchedulingSchClass.Attribute.SchDay, endTime.Year, endTime.Month, endTime.Day); val.Distinct = true; con.Distinct = true; con.OrderBy(new List <OrderByItem>(new OrderByItem[] { new OrderByItem(V_SchedulingSchClass.Attribute.StartHour, Order.Asc), new OrderByItem(V_SchedulingSchClass.Attribute.StartMin, Order.Asc), new OrderByItem(V_SchedulingSchClass.Attribute.EndHour, Order.Asc), new OrderByItem(V_SchedulingSchClass.Attribute.EndMin, Order.Asc) })); List <V_SchedulingSchClass> vsList = BLLTable <V_SchedulingSchClass> .Factory(conn).Select(val, con); foreach (V_SchedulingSchClass vs in vsList) { DateTime date = new DateTime(vs.SchYear, vs.SchMonth, vs.SchDay); if (!vsDic.ContainsKey(date)) { vsDic.Add(date, new List <V_SchedulingSchClass>()); } if (!vsidDic.ContainsKey(date)) { vsidDic.Add(date, new List <int>()); } if (!vsidDic[date].Contains(vs.SchClassid)) { vsidDic[date].Add(vs.SchClassid); vsDic[date].Add(vs); } } return(vsDic); }