private void InitLoan() { DEVKINDFORLONGRESVREQ req = new DEVKINDFORLONGRESVREQ(); req.dwClassKind = (uint)UNIDEVCLS.DWKIND.CLSKIND_LOAN; req.szLabIDs = labId.Value; req.dwResvPurpose = (uint)UNIRESERVE.DWPURPOSE.USEFOR_PERSONNAL | (uint)UNIRESERVE.DWPURPOSE.USEFOR_TEACHING | (uint)UNIRESERVE.DWPURPOSE.USEFOR_RESERVED; req.dwStartDate = ToUInt(DateTime.Now.ToString("yyyyMMdd")); req.dwEndDate = req.dwStartDate; DEVKINDFORRESV[] rlt; if (m_Request.Device.GetDevKindForLongResv(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < rlt.Length; i++) { DEVKINDFORRESV kind = rlt[i]; GetDevStatList(kind.dwKindID); string num = kind.szUsableNumArray; if (num == "A") { num = "9+"; } else if (num == "U") { num = "<span class='grey'>不开放</span>"; } loanList += "<tr><td><a class='click_detail' kind='" + kind.dwKindID + "'>" + kind.szKindName + "</a></td><td class='text-center'>" + kind.szModel + "</td>" + "<td class='text-center'>" + kind.dwTotalNum + "</td><td class='text-center'>" + num + "</td><td class='text-center'><a onclick='loanResv(" + kind.dwKindID + ")'>租借</a></td></tr>"; } } else { MsgBoxH(m_Request.szErrMsg); } }
protected int newGroup() { REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL; object obj = Session["LOGIN_ACCINFO"]; UNIACCOUNT acc = new UNIACCOUNT(); if (obj != null) { acc = (UNIACCOUNT)(obj); } else { MsgBox("你还未登录!"); return(0); } UNIGROUP setValue = new UNIGROUP(); setValue.dwKind = ((uint)UNIGROUP.DWKIND.GROUPKIND_RERV); setValue.szName = acc.szLogonName.ToString() + DateTime.Now.ToLongTimeString(); setValue.dwEnrollDeadline = uint.Parse(DateTime.Now.AddYears(10).ToString("yyyyMMdd")); if (Session["DEVKINDFORRESV"] != null) { DEVKINDFORRESV kindf = (DEVKINDFORRESV)Session["DEVKINDFORRESV"]; setValue.dwMinUsers = kindf.dwMinUsers; setValue.dwMaxUsers = kindf.dwMaxUsers; } uResponse = m_Request.Group.SetGroup(setValue, out setValue); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && setValue.dwGroupID != null) { groupIDHidden.Value = setValue.dwGroupID.ToString(); GROUPMEMBER setValueMember = new GROUPMEMBER(); setValueMember.dwKind = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL; setValueMember.dwMemberID = acc.dwAccNo; setValueMember.szName = acc.szTrueName.ToString(); setValueMember.szMemo = acc.szLogonName; setValueMember.dwStatus = (uint)GROUPMEMBER.DWSTATUS.GROUPMEMBERSTAT_FORCE; setValueMember.dwGroupID = setValue.dwGroupID; //SetGroup(setValueMember); uResponse = m_Request.Group.SetGroupMember(setValueMember); return((int)setValue.dwGroupID); } else { MsgBox(m_Request.szErrMsg); return(0); } }
protected void Page_Load(object sender, EventArgs e) { base.LoadPage(); Bind ddlBind = new Bind(); if (!this.Page.IsPostBack) { REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL; string szKindID = Request["devkind"]; string szDate = Request["date"]; string szTime = Request["time"]; DEVKINDFORRESVREQ vrGet = new DEVKINDFORRESVREQ(); vrGet.szKindIDs = szKindID; vrGet.dwDate = ToUInt(szDate); lblDate.Text = (int.Parse(szDate)) / 10000 + "-" + ((int.Parse(szDate)) % 10000) / 100 + "-" + ((int.Parse(szDate)) % 10000) % 100; DateTime dtNow = DateTime.Now; DateTime dtSelect; try { dtSelect = DateTime.Parse(lblDate.Text + " " + szTime); } catch { dtSelect = dtNow; } TimeSpan sp = dtNow - dtSelect; if (dtNow.Date == dtSelect.Date && sp.TotalMinutes > 0) { int nNowMin = dtNow.Minute; if (nNowMin > 0 && nNowMin <= 30) { szTime = dtNow.Hour + ":" + "30"; } else if (nNowMin > 30 && nNowMin <= 60) { szTime = dtNow.AddHours(1.0).Hour + ":" + "00"; } } vrGet.dwResvPurpose = (uint)UNIRESERVE.DWPURPOSE.USEFOR_PERSONNAL; DEVKINDFORRESV[] vtRes; uResponse = m_Request.Device.GetDevKindForResv(vrGet, out vtRes); if (uResponse == REQUESTCODE.EXECUTE_FAIL || vtRes == null || vtRes.Length == 0) { return; } DEVKINDFORRESV setValue = new DEVKINDFORRESV(); setValue = vtRes[0]; UNIRESVRULE setResvRule = new UNIRESVRULE(); setResvRule = setValue.szRuleInfo; DAYOPENRULE[] vtDayOpenRule = setValue.szOpenInfo; bool bIsLongTime = false; bool bIsLease = false; if ((((uint)setValue.dwProperty) & ((uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV)) > 0) { ViewState["bIsLongTime"] = "true"; bIsLongTime = true; } else { ViewState["bIsLongTime"] = "false"; } if ((((uint)setValue.dwProperty) & ((uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LEASE)) > 0) { ViewState["bIsLease"] = "true"; bIsLease = true; } else { ViewState["bIsLease"] = "false"; } string content = "人数限制:最少" + setValue.dwMinUsers.ToString() + "人 " + "最多:" + setValue.dwMaxUsers.ToString() + "人" + "<br />";; int intDate = 0; if (bIsLongTime) { divFreeTime.Style.Add("display", "none"); divLimit.Style.Add("display", "none"); divLongTime.Style.Add("display", "block"); int nDate = int.Parse(szDate); DateTime dtDate = new DateTime(nDate / 10000, (nDate % 10000) / 100, nDate % 100); //提前预约具体时间 content += "预约限制:" + DateTime.Now.AddDays((uint)setResvRule.dwLatestResvTime / 1440).ToString("yyyy-MM-dd") + "到" + DateTime.Now.AddDays((uint)setResvRule.dwEarliestResvTime / 1440).ToString("yyyy-MM-dd") + " 每次预约不少于" + ((uint)setResvRule.dwMinResvTime / 1440) + "天" + " " + "不大于" + ((uint)setResvRule.dwMaxResvTime / 1440) + "天"; content += "<br />"; } else { ViewState["dwMaxResvTime"] = (uint)setResvRule.dwMaxResvTime; content += "预约限制:" + DateTime.Now.AddDays((uint)setResvRule.dwLatestResvTime / 1440).ToString("yyyy-MM-dd") + "到" + DateTime.Now.AddDays((uint)setResvRule.dwEarliestResvTime / 1440).ToString("yyyy-MM-dd") + " 每次预约不少于" + ((uint)setResvRule.dwMinResvTime / 60) + "小时" + " " + "不大于" + ((uint)setResvRule.dwMaxResvTime / 60) + "个小时"; content += "<br />"; } string szCheck = ""; //20140504前服务为 if (((uint)setResvRule.dwLimit & (uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_CENSOR) > 0) if (setResvRule.CheckTbl != null) { szCheck += "需管理员审核<br />"; } if (((uint)setResvRule.dwLimit & (uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_NEEDAPP) > 0) { // AppDocDiv.Style.Add("display", "block"); szCheck += " 需提交申请报告"; } else { divUpLoadFile.Style.Add("display", "none"); } if (szCheck != "") { content += "<br />审核要求:" + szCheck; } int nLimit = (int)setValue.dwOpenLimit; ViewState["nLimit"] = nLimit; if ((((uint)setValue.dwProperty) & ((uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LEASE)) > 0) { ViewState["isLoad"] = "true"; ViewState["isAutoAssign"] = "false"; } DEVKINDREQ vrGetDevCls = new DEVKINDREQ(); vrGetDevCls.dwKindID = ToUInt(szKindID); UNIDEVKIND[] vtDevCls; uResponse = m_Request.Device.DevKindGet(vrGetDevCls, out vtDevCls); if (vtDevCls != null && vtDevCls.Length > 0) { szMemo.Text = vtDevCls[0].szMemo.ToString(); int nKind = (int)vtDevCls[0].dwClassKind; if (((nKind) & ((int)UNIDEVCLS.DWKIND.CLSKIND_COMPUTER)) > 0 || ((nKind) & ((int)UNIDEVCLS.DWKIND.CLSKIND_SEAT)) > 0) { ViewState["isAutoAssign"] = "false"; } if (((nKind) & ((int)UNIDEVCLS.DWKIND.CLSKIND_COMMONS)) > 0) { string szlblMemo = ""; if (vtRes[0].szKindName.ToString().IndexOf("研究") >= 0) { szlblMemo = "研讨内容:"; } else if (vtRes[0].szKindName.ToString().IndexOf("体验") >= 0) { szlblMemo = "体验内容:"; } else { szlblMemo = "申请说明:"; } ViewState["szlblMemo"] = szlblMemo; ViewState["IsMemo"] = "true"; lblszMemo.Text = szlblMemo; } else { ViewState["IsMemo"] = "false"; divMemo.Style.Add("display", "none"); } } if (setValue.dwMaxUsers <= 1) { divMemberAdd1.Style.Add("display", "none"); divMemberAdd2.Style.Add("display", "none"); } if (!bIsLongTime && vtDayOpenRule != null && vtDayOpenRule.Length > 0 && (nLimit & (uint)GROUPOPENRULE.DWOPENLIMIT.OPENLIMIT_FIXEDTIME) == 0) { divFreeTime.Style.Add("display", "block"); divLimit.Style.Add("display", "none"); divLongTime.Style.Add("display", "none"); int nStart = (int)vtDayOpenRule[0].dwBegin; int nEnd = (int)vtDayOpenRule[0].dwEnd; ArrayList alistStart = new ArrayList(); string szUse = setValue.szUsableNumArray.ToString(); ViewState["szUsableNumArray"] = szUse; ViewState["dwEnd"] = nEnd; uint n = uint.Parse(szTime.Replace(":", "")); alistStart = ddlBind.GetBeginTimeList(n / 100 * 60 + n % 100, (uint)(nEnd / 100 * 60 + nEnd % 100), (uint)setResvRule.dwMinResvTime, 30, szUse); if (n < nEnd) { for (int i = 0; i <= alistStart.Count - 1; i++) { uint nTemp = (uint)alistStart[i]; ListItem item = new ListItem((nTemp / 100).ToString("00") + ":" + (nTemp % 100).ToString("00"), nTemp.ToString()); ddlHourStart.Items.Add(item); } if (alistStart.Count == 0) { ListItem item = new ListItem("无合适时间", "0"); ddlHourStart.Items.Add(item); } } else { ListItem item = new ListItem("无合适时间", "0"); ddlHourStart.Items.Add(item); } string szEndF = ddlHourStart.SelectedValue.ToString(); uint nEndF = 0; if (szEndF != null && szEndF != "") { nEndF = uint.Parse(szEndF); } ArrayList alistEnd = new ArrayList(); uint nEndReal = 0; if ((nEndF / 100 * 60 + nEndF % 100 + (uint)setResvRule.dwMaxResvTime) < (nEnd / 100 * 60 + nEnd % 100)) { nEndReal = nEndF / 100 * 60 + nEndF % 100 + (uint)setResvRule.dwMaxResvTime; } else { nEndReal = (uint)(nEnd / 100 * 60 + nEnd % 100); } alistEnd = ddlBind.GetEndTimeList(nEndF / 100 * 60 + nEndF % 100, nEndReal, (uint)setResvRule.dwMinResvTime, 30, szUse); if (nEndF != 0) { for (int i = 0; i <= alistEnd.Count - 1; i++) { uint nTemp = (uint)alistEnd[i]; ListItem item = new ListItem((nTemp / 100).ToString("00") + ":" + (nTemp % 100).ToString("00"), nTemp.ToString()); Logger.trace("end1:" + item.Value.ToString()); ddlHourEnd.Items.Add(item); } if (alistEnd.Count == 0) { ListItem item = new ListItem("无合适时间", "0"); ddlHourEnd.Items.Add(item); } } else { ListItem item = new ListItem("无合适时间", "0"); ddlHourEnd.Items.Add(item); } content += "开放时间:" + nStart / 100 + ":" + (nStart % 100).ToString("00") + "到" + nEnd / 100 + ":" + (nEnd % 100).ToString("00"); } else if (!bIsLongTime && vtDayOpenRule != null && vtDayOpenRule.Length > 0 && (nLimit & (uint)GROUPOPENRULE.DWOPENLIMIT.OPENLIMIT_FIXEDTIME) > 0) { divFreeTime.Style.Add("display", "none"); divLimit.Style.Add("display", "block"); divLongTime.Style.Add("display", "none"); int len = vtDayOpenRule.Length; List <DAYOPENRULE> list = new List <DAYOPENRULE>(); for (int i = 0; i < len; i++) { uint nStart = (uint)vtDayOpenRule[i].dwBegin; nStart = (nStart / 100) * 60 + nStart % 100; uint nEnd = (uint)vtDayOpenRule[i].dwEnd; nEnd = (nEnd / 100) * 60 + nEnd % 100; if (!ddlBind.GetIsReserve(nStart, nEnd, setValue.szUsableNumArray.ToString())) { list.Add(vtDayOpenRule[i]); } } len = list.Count; vtDayOpenRule = list.ToArray(); if (len >= 0) { for (int i = 0; i < len; i++) { string szTimedll = ddlBind.GetTimeToDisplay((int)vtDayOpenRule[i].dwBegin, (int)vtDayOpenRule[i].dwEnd); int intValue = (int)vtDayOpenRule[i].dwBegin * 10000 + (int)vtDayOpenRule[i].dwEnd; ListItem item = new ListItem(szTimedll, intValue.ToString()); ddlPartTime.Items.Add(item); if (i < len - 1) { szTimedll = ddlBind.GetTimeToDisplay((int)vtDayOpenRule[i].dwBegin, (int)vtDayOpenRule[i + 1].dwEnd); intValue = (int)vtDayOpenRule[i].dwBegin * 10000 + (int)vtDayOpenRule[i].dwEnd; item = new ListItem(szTimedll, intValue.ToString()); ddlPartTime.Items.Add(item); } } string szTimeALL = ddlBind.GetTimeToDisplay((int)vtDayOpenRule[0].dwBegin, (int)vtDayOpenRule[len - 1].dwEnd); int intValueAll = (int)vtDayOpenRule[0].dwBegin * 10000 + (int)vtDayOpenRule[len - 1].dwEnd; ListItem itemAll = new ListItem(szTimeALL, intValueAll.ToString()); ddlPartTime.Items.Add(itemAll); } else { ListItem itemAll = new ListItem("无合适时间", "0"); ddlPartTime.Items.Add(itemAll); } } divUserLimit.InnerHtml = content; // aBack.Attributes.Add("href",(string)Session["szBackPage"]); } }
protected void Page_Load(object sender, EventArgs e) { base.LoadPage(); Bind ddlBind = new Bind(); if (!string.IsNullOrEmpty(Request["ddlHourStart"]) && !string.IsNullOrEmpty(Request["ddlHourEnd"])) { old_start.Value = Request["ddlHourStart"]; old_end.Value = Request["ddlHourEnd"]; } if (!this.Page.IsPostBack) { REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL; string szKindID = Request["devkind"]; string szDate = Request["date"]; string szTime = Request["time"]; if (string.IsNullOrEmpty(szTime)) { szTime = DateTime.Now.Hour + ":00"; } string szRoomID = ""; uint clsKind = 0; string szDevid = Request["dev"]; if (szDevid != null && szDevid != "") { DEVREQ vrDevGet = new DEVREQ(); vrDevGet.dwDevID = uint.Parse(szDevid); UNIDEVICE[] vtDevRes; if (m_Request.Device.Get(vrDevGet, out vtDevRes) == REQUESTCODE.EXECUTE_SUCCESS && vtDevRes != null && vtDevRes.Length > 0) { hint.InnerHtml = vtDevRes[0].szDevURL; szRoomID = vtDevRes[0].dwRoomID.ToString(); curObj.Text = vtDevRes[0].szLabName + " " + vtDevRes[0].szDevName; clsKind = (uint)vtDevRes[0].dwClassKind; } } DEVKINDFORRESVREQ vrGet = new DEVKINDFORRESVREQ(); if (szRoomID != "") { vrGet.szRoomIDs = szRoomID; } vrGet.szKindIDs = szKindID; vrGet.dwDate = uint.Parse(szDate); lblDate.Text = (uint.Parse(szDate)) / 10000 + "-" + ((uint.Parse(szDate)) % 10000) / 100 + "-" + ((uint.Parse(szDate)) % 10000) % 100; DateTime dtNow = DateTime.Now; DateTime dtSelect; try { dtSelect = DateTime.Parse(lblDate.Text + " " + szTime); } catch { dtSelect = dtNow; } TimeSpan sp = dtNow - dtSelect; if (dtNow.Date == dtSelect.Date && sp.TotalMinutes > 0) { int nNowMin = dtNow.Minute; if (nNowMin > 0 && nNowMin <= 30) { szTime = dtNow.Hour + ":" + "30"; } else if (nNowMin > 30 && nNowMin <= 60) { szTime = dtNow.AddHours(1.0).Hour + ":" + "00"; } } vrGet.dwResvPurpose = (uint)UNIRESERVE.DWPURPOSE.USEFOR_PERSONNAL; DEVKINDFORRESV[] vtRes; uResponse = m_Request.Device.GetDevKindForResv(vrGet, out vtRes); if (uResponse == REQUESTCODE.EXECUTE_FAIL || vtRes == null || vtRes.Length == 0) { return; } DEVKINDFORRESV setValue = new DEVKINDFORRESV(); setValue = vtRes[0]; Session["DEVKINDFORRESV"] = setValue; UNIRESVRULE setResvRule = setValue.szRuleInfo; vtDayOpenRule = setValue.szOpenInfo; bool bIsLongTime = false; ViewState["bIsLongTime"] = "false"; if ((((uint)setValue.dwProperty) & ((uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV)) > 0) { ViewState["bIsLongTime"] = "true"; bIsLongTime = true; } else { ViewState["bIsLongTime"] = "false"; } if ((((uint)setValue.dwProperty) & ((uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LEASE)) > 0) { //ViewState["bIsLease"] = "true"; //bIsLongTime = true; } else { ViewState["bIsLease"] = "false"; } if (string.IsNullOrEmpty(szDevid)) { curObj.Text = setValue.szLabName + " " + setValue.szKindName; } string content = "人数限制:最少" + setValue.dwMinUsers.ToString() + "人 " + "最多:" + setValue.dwMaxUsers.ToString() + "人" + "<br />";; string szFee = "不收费"; UNIFEE setFee = setValue.szFeeInfo; if (setFee.szFeeDetail != null) { FEEDETAIL[] vtFeeDetail = setFee.szFeeDetail; if (vtFeeDetail != null && vtFeeDetail.Length > 0) { szFee = ""; string szType = ""; uint uLenFeeDetail = (uint)vtFeeDetail.Length; switch (uLenFeeDetail) { case 1: szType = ":"; break; case 2: szType = "占用费:"; break; case 8: szType = ":"; break; default: szType = ""; break; } for (int k = 0; k < uLenFeeDetail; k++) { uint uKind = (uint)vtFeeDetail[k].dwFeeType; string szTimeFee = ""; if ((uint)vtFeeDetail[k].dwUnitTime == 0) { szFee += szType + "0元"; } else { szTimeFee = (((uint)vtFeeDetail[k].dwUnitFee / 100.0) / ((uint)vtFeeDetail[k].dwUnitTime / 60.0)).ToString(); szFee += szType + "";// "每小时" + szTimeFee + "元"; } } } } // content += szFee+"<br />"; //预约规则 latest.Value = setResvRule.dwLatestResvTime.ToString(); earliest.Value = setResvRule.dwEarliestResvTime.ToString(); max.Value = setResvRule.dwMaxResvTime.ToString(); min.Value = setResvRule.dwMinResvTime.ToString(); int intDate = 0; if (bIsLongTime) { divFreeTime.Style.Add("display", "none"); divLimit.Style.Add("display", "none"); divLongTime.Style.Add("display", "block"); startDate.Value = (new DateTime((int.Parse(szDate)) / 10000, ((int.Parse(szDate)) % 10000) / 100, (int.Parse(szDate) % 100))).ToString("yyyy-MM-dd"); int nDate = int.Parse(szDate); DateTime dtDate = new DateTime(nDate / 10000, (nDate % 10000) / 100, nDate % 100); //提前预约具体时间 content += "预约限制:" + DateTime.Now.AddDays((uint)setResvRule.dwLatestResvTime / 1440).ToString("yyyy-MM-dd") + "到" + DateTime.Now.AddDays(((uint)setResvRule.dwEarliestResvTime / 1440) - 1).ToString("yyyy-MM-dd") + " 每次预约不少于" + ((uint)setResvRule.dwMinResvTime / 1440) + "天" + " " + "不大于" + ((uint)setResvRule.dwMaxResvTime / 1440) + "天"; } else { ViewState["dwMaxResvTime"] = (uint)setResvRule.dwMaxResvTime; content += "预约限制:" + DateTime.Now.AddDays((uint)setResvRule.dwLatestResvTime / 1440).ToString("yyyy-MM-dd") + "到" + DateTime.Now.AddDays((uint)setResvRule.dwEarliestResvTime / 1440).ToString("yyyy-MM-dd") + " 每次预约不少于" + MinToHour((uint)setResvRule.dwMinResvTime) + " " + "不大于" + MinToHour((uint)setResvRule.dwMaxResvTime); } content += " 迟到 " + setResvRule.dwCancelTime + " 分钟取消预约"; content += "<br />"; string attach = GetConfig("showResvAttach"); string szCheck = ""; //20140504前服务为 if (((uint)setResvRule.dwLimit & (uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_CENSOR) > 0) if (setResvRule.CheckTbl != null && setResvRule.CheckTbl.Length > 0 && (setResvRule.CheckTbl[0].dwProperty & (uint)RULECHECKINFO.DWPROPERTY.CHECKPROP_MAIN) > 0) { ViewState["IsCheck"] = "true"; szCheck += "需管理员审核<br />"; } if (((uint)setResvRule.dwLimit & (uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_NEEDAPP) > 0) { szCheck += " 需提交申请报告"; need_file.Value = "true"; } else if (attach == null || attach != "1" || (clsKind & (uint)UNIDEVCLS.DWKIND.CLSKIND_COMMONS) == 0) { divUpLoadFile.Style.Add("display", "none"); } string downloadKinds = GetConfig("downloadKinds"); if (!string.IsNullOrEmpty(downloadKinds) && downloadKinds.IndexOf(szKindID) < 0) { divUpLoadFile.Style.Add("display", "none"); } if (szCheck != "") { content += "<br />审核要求:" + szCheck; } int nLimit = (int)setValue.dwOpenLimit; nLimit &= ~(int)GROUPOPENRULE.DWOPENLIMIT.OPENLIMIT_FIXEDTIME; ViewState["nLimit"] = nLimit; if ((((uint)setValue.dwProperty) & ((uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LEASE)) > 0) { ViewState["isLoad"] = "true"; ViewState["isAutoAssign"] = "false"; } DEVKINDREQ vrGetDevCls = new DEVKINDREQ(); vrGetDevCls.dwKindID = ToUInt(szKindID); UNIDEVKIND[] vtDevCls; uResponse = m_Request.Device.DevKindGet(vrGetDevCls, out vtDevCls); if (vtDevCls != null && vtDevCls.Length > 0) { // szMemo.Text = vtDevCls[0].szMemo.ToString(); int nKind = (int)vtDevCls[0].dwClassKind; if (((nKind) & ((int)UNIDEVCLS.DWKIND.CLSKIND_COMPUTER)) > 0 || ((nKind) & ((int)UNIDEVCLS.DWKIND.CLSKIND_SEAT)) > 0) { ViewState["isAutoAssign"] = "false"; } if ((((nKind) & ((int)UNIDEVCLS.DWKIND.CLSKIND_COMMONS)) > 0) && (GetConfig("resvTheme") == "1" || GetConfig("resvTheme") == "2"))//&& ((int)vtDevCls[0].dwMaxUsers < 2) { if (GetConfig("resvTheme") == "2") { txtMemo.Attributes["IsMust"] = "true"; } else { txtMemo.Attributes["IsMust"] = "false"; } string szlblMemo = ""; if (vtRes[0].szKindName.ToString().IndexOf("研究") >= 0) { szlblMemo = "研讨主题:"; } else if (vtRes[0].szKindName.ToString().IndexOf("体验") >= 0) { szlblMemo = "体验内容:"; } else { szlblMemo = "申请说明:"; } ViewState["szlblMemo"] = szlblMemo; ViewState["IsMemo"] = "true"; lblszMemo.Text = szlblMemo; } else { ViewState["IsMemo"] = "false"; divMemo.Style.Add("display", "none"); } } if (setValue.dwMaxUsers <= 1) { divMemberAdd1.Style.Add("display", "none"); divMemberAdd2.Style.Add("display", "none"); } if (vtDayOpenRule != null && vtDayOpenRule.Length > 0) { string ps = ""; string[] open = GetOpenArray(setValue.szOpenInfo, ref ps); if (open.Length > 1) { cls_time.Value = ps; open_start.Value = open[0]; open_end.Value = open[1]; string start = startDate.Value; if (!string.IsNullOrEmpty(start) && GetConfig("resvAllDay") != "1") { if (start == DateTime.Now.ToString("yyyy-MM-dd")) { start += " " + DateTime.Now.ToString("HH:mm"); } else { start += " " + open[0]; } startDate.Value = start; } } } if (vtDayOpenRule != null && vtDayOpenRule.Length > 0 && (nLimit & (uint)GROUPOPENRULE.DWOPENLIMIT.OPENLIMIT_FIXEDTIME) == 0) { content += "开放时间:"; uint uBeginTime = (uint)vtDayOpenRule[0].dwBegin; uint uEndTime = (uint)vtDayOpenRule[0].dwEnd; for (int i = 0; i < vtDayOpenRule.Length; i++) { if (vtDayOpenRule[i].dwBegin != null) { uint uBegin = (uint)vtDayOpenRule[i].dwBegin; uint uEnd = (uint)vtDayOpenRule[i].dwEnd; content += uBegin / 100 + ":" + (uBegin % 100).ToString("00") + "到" + uEnd / 100 + ":" + (uEnd % 100).ToString("00") + ","; uEndTime = uEnd; } } if (!bIsLongTime) { divFreeTime.Style.Add("display", "block"); divLimit.Style.Add("display", "none"); divLongTime.Style.Add("display", "none"); //int nStart = (int)(vtDayOpenRule[0].dwBegin); //int nEnd = (int)(vtDayOpenRule[0].dwEnd); ArrayList alistStart = new ArrayList(); string szUse = setValue.szUsableNumArray.ToString(); ViewState["szUsableNumArray"] = szUse; ViewState["dwEnd"] = uEndTime; uint n = uint.Parse(szTime.Replace(":", "")); uint unit = 10; if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["resvTimeUnit"])) { unit = Convert.ToUInt32(ConfigurationManager.AppSettings["resvTimeUnit"]); } string now = DateTime.Now.ToString("yyyyMMdd"); if (szDate == now) { uBeginTime = Convert.ToUInt32(DateTime.Now.ToString("HHmm")); uint u = uBeginTime % unit; if (u > 0) { uBeginTime = uBeginTime - u + unit; } } t_unit.Value = unit.ToString(); uint uBeginTimeInt = uBeginTime / 100 * 60 + uBeginTime % 100; uint uEndTimeInt = uEndTime / 100 * 60 + uEndTime % 100; for (uint i = uBeginTimeInt; i <= uEndTimeInt; i = i + unit) { uint nTemp = (uint)i / 60 * 100 + i % 60; ListItem item = new ListItem((nTemp / 100).ToString("00") + ":" + (nTemp % 100).ToString("00"), nTemp.ToString()); ddlHourStart.Items.Add(item); tempHourEnd.Items.Add(item); } string h = (dtSelect.Hour * 100).ToString(); ddlHourStart.SelectedValue = tempHourEnd.SelectedValue = h; tempHourEnd.Style.Add("display", "none"); } } else if (!bIsLongTime && vtDayOpenRule != null && vtDayOpenRule.Length > 0 && (nLimit & (uint)GROUPOPENRULE.DWOPENLIMIT.OPENLIMIT_FIXEDTIME) > 0) { divFreeTime.Style.Add("display", "none"); divLimit.Style.Add("display", "block"); divLongTime.Style.Add("display", "none"); int len = vtDayOpenRule.Length; List <DAYOPENRULE> list = new List <DAYOPENRULE>(); for (int i = 0; i < len; i++) { uint nStart = (uint)vtDayOpenRule[i].dwBegin; nStart = (nStart / 100) * 60 + nStart % 100; uint nEnd = (uint)vtDayOpenRule[i].dwEnd; nEnd = (nEnd / 100) * 60 + nEnd % 100; if (!ddlBind.GetIsReserve(nStart, nEnd, setValue.szUsableNumArray.ToString())) { list.Add(vtDayOpenRule[i]); } } len = list.Count; vtDayOpenRule = list.ToArray(); if (len >= 0) { for (int i = 0; i < len; i++) { string szTimedll = ddlBind.GetTimeToDisplay((int)vtDayOpenRule[i].dwBegin, (int)vtDayOpenRule[i].dwEnd); int intValue = (int)vtDayOpenRule[i].dwBegin * 10000 + (int)vtDayOpenRule[i].dwEnd; ListItem item = new ListItem(szTimedll, intValue.ToString()); ddlPartTime.Items.Add(item); if (i < len - 1) { szTimedll = ddlBind.GetTimeToDisplay((int)vtDayOpenRule[i].dwBegin, (int)vtDayOpenRule[i + 1].dwEnd); intValue = (int)vtDayOpenRule[i].dwBegin * 10000 + (int)vtDayOpenRule[i].dwEnd; item = new ListItem(szTimedll, intValue.ToString()); ddlPartTime.Items.Add(item); } } string szTimeALL = ddlBind.GetTimeToDisplay((int)vtDayOpenRule[0].dwBegin, (int)vtDayOpenRule[len - 1].dwEnd); int intValueAll = (int)vtDayOpenRule[0].dwBegin * 10000 + (int)vtDayOpenRule[len - 1].dwEnd; ListItem itemAll = new ListItem(szTimeALL, intValueAll.ToString()); ddlPartTime.Items.Add(itemAll); } else { ListItem itemAll = new ListItem("无合适时间", "0"); ddlPartTime.Items.Add(itemAll); } } divUserLimit.InnerHtml = content; // aBack.Attributes.Add("href",(string)Session["szBackPage"]); } if (groupIDHidden.Value != "") { showGroupMember(groupIDHidden.Value); } }