<%@ Page Title="" Language="C#" MasterPageFile="~/Book/Book.master"     AutoEventWireup="true" CodeBehind="WeeklyView.aspx.cs" Inherits="Book.Book.WeeklyView" %>
<%@ Register src="../UserControls/area.ascx" tagname="area" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cont_form" runat="server">
 
      
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
     
      
    



 
     
    <link href="style/themes.css" rel="stylesheet" type="text/css" /> 
    <script src="../Javascript/modal.js" type="text/javascript"></script>


     



   


    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

        <ContentTemplate>
 
     
   
 
   

 选择日期：<input type="text" class="form-control _dt" style=" width:160px; display:inline-block" id="txt_startdate" runat="server"     />

  
      &nbsp;&nbsp;
     <uc1:area ID="area1" runat="server" OnAreaChanged="area1_changed" />
    &nbsp;&nbsp;
    <asp:Button ID="btn_Search" runat="server" Text="查看" class="btn btn-primary btn-sm" 
        onclick="btn_Search_click"  />
   
      

      &nbsp;&nbsp; | &nbsp;&nbsp;
               <div class="btn-group">
                  <asp:Button ID="btn_pre"  CssClass="btn btn-primary btn-sm"  runat="server" Text="前7天" OnClick="btn_pre_Click" />
                  <asp:Button ID="btn_today"  CssClass="btn btn-danger  btn-sm "   runat="server" Text="今天" OnClick="btn_today_Click" />
                  <asp:Button ID="btn_next" CssClass="btn btn-primary btn-sm" runat="server" Text="后7天" OnClick="btn_next_Click" />
              </div>

 &nbsp;&nbsp; | &nbsp;&nbsp;
 
         <span class="btn btn-flat btn-xs " title="红色背景表示内部会议" style="background-color:#3399cc;  cursor:help; color:#ffffff">内部会议</span>
         <span class="btn btn-flat  btn-xs"  title="蓝色背景表示外部会议"  style="background-color:#ff99cc; cursor:help; color:#ffffff">外部会议</span> 
         <span class="btn btn-flat  btn-xs"   style="background-color:#808080;   color:#ffffff">鼠标右键快速预定</span> 

    
       
             



            
      <div style="display:flex; margin-top:20px;">
          <div id="left" style="width:200px">

  <div id="room">

  <asp:listbox   Height="620px"   Width="95%"   
       ID="rbl_meetingroom" runat="server"  
         AutoPostBack="True"   
        onselectedindexchanged="rbl_meetingroom_SelectedIndexChanged"     >
     
  </asp:listbox>
   
                   </div>

          </div>

          <div id="right" style="width:100%">

     
               

         
             
       

    <daypilot:daypilotcalendar  
                    ContextMenuSelectionID="DayPilotMenuSelection"
                    ContextMenuID="DayPilotMenuSelection"  
                    TimeFormat="Auto" 
                    CellHeight="25"
                    Width="95%"
                    id="DayPilotCalendar1" 
                    runat="server" 
                    
                    datastartfield="begintime" 
                    dataendfield="endtime" 
                    datatextfield="title" 
                    datavaluefield="id" 
                    DataTagFields="others2"
                    DataRecurrenceField="rec"
                    EventCorners="Regular" 
                 
                      
                    CssClassPrefix="calendar_silver_"
                    Days="7" 
                    ClientObjectName="dpc1" 
                   
                    TimeRangeSelectedHandling="Hold" 
                   
                   BusinessBeginsHour="8"
                   BusinessEndsHour="20"
                    
   
                   
                
                    EventClickHandling="JavaScript"
                    EventClickJavaScript="window.open('details.aspx?id='+e.value());" 
                 
                   
                    EventDoubleClickHandling="Disabled" 
                  
                       
                      
                    BackColor="white"
                    NonBusinessBackColor = "#FFFFCE"
                    EventBackColor="#638EDE"
                    EventBorderColor="#2951A5"
                    HourNameBackColor="#F3F3F9"
                    HourFontColor="#42658C"
                    HeaderFontColor="#42658C"
                    EventFontColor="white"
                    EventFontFamily="Tahoma,Verdana,Sans-serif"
                    BorderColor="#CED2CE"
                    CellBorderColor="#DEDFDE"
                    AllDayEventBackColor="#2951a5"
                    AllDayEventFontColor="#ffffff"
                    AllDayEventBorderColor="transparent"
                    HourBorderColor="#DEDFDE"
                    HourHalfBorderColor="#EBEDEB"
                    HourNameBorderColor="#DEDFDE" 
          
                    EventDeleteHandling="Disabled" 
        
                   
       
                   DurationBarVisible="False" 
                   ShowEventStartEnd="False"


                    OnBeforeEventRender="DayPilotCalendar1_BeforeEventRender"
                    OnBeforeHeaderRender="DayPilotCalendar1_BeforeHeaderRender"  
                    OnCommand="DayPilotCalendar1_Command"
                    ></daypilot:daypilotcalendar>
            
   



   
    <DayPilot:DayPilotMenu ID="DayPilotMenuSelection" runat="server" CssClassPrefix="menu_">
        <DayPilot:MenuItem Action="JavaScript"     JavaScript="createEvent(e.start, e.end,e.resource,1);"    Text="快速预定" />
        <DayPilot:MenuItem Action="JavaScript"     JavaScript="createEvent(e.start, e.end,e.resource,2);"    Text="常规预定" />
    </DayPilot:DayPilotMenu>




             

    <DayPilot:DayPilotBubble 
        ID="DayPilotBubble1" 
        runat="server"  
        ClientObjectName="bubble"
        ShowLoadingLabel="true"
        HideAfter="500"
        >
    </DayPilot:DayPilotBubble>
           

 
                
      </div>
                
           
  
     </div>

     </ContentTemplate>

    
    </asp:UpdatePanel>




   













    

<script type="text/javascript">


    function createEvent(start, end, resource, t) {

        resource = $("#room option:selected").val();

        var modal = new DayPilot.Modal();
        modal.top = 120;
        modal.width = 600;
        modal.height = 250;
        modal.opacity = 0;
        modal.border = "2px solid #aaaaaa";

        modal.closed = function () {
            if (this.result == "OK") {
                dpc1.commandCallBack('refresh');
            }
            dpc1.clearSelection();
        };

        if (t == 1) {
            modal.showUrl("quickbook.aspx?start=" + start.toStringSortable() + "&end=" + end.toStringSortable() + "&roomid=" + resource);
        }

        if (t == 2) {
            window.location = "addbook.aspx?from=" + start.toStringSortable() + "&to=" + end.toStringSortable() + "&roomid=" + resource + "&date=" + start.toStringSortable();
        }
    }






</script>

       
       
</asp:Content>
