Пример #1
0
 public IWebPartRow GetConnectionInterface()
 {
     if (m_control == null)
     {
         return(new InterconnectionDataTable <TimeSlot>());
     }
     if (m_SelectedTimeSlot == null)
     {
         m_SelectedTimeSlot = m_control.GetSelectedTimeSlotInterconnectionData();
     }
     return(m_SelectedTimeSlot);
 }
 public IWebPartRow GetConnectionInterface()
 {
     if (m_Control == null)
     {
         return(new InterconnectionDataTable <Shipping>());
     }
     if (m_SelectedTimeSlot == null)
     {
         m_SelectedTimeSlot = m_Control.GetSelectedShippingOperationInboundInterconnectionData();
     }
     return(m_SelectedTimeSlot);
 }
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 /// <exception cref="System.ApplicationException">Page_Load exception:  + ex.Message</exception>
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             m_WarehouseDropDownList.DataSource = from _idx in EDC.Warehouse
                                                  orderby _idx.Title ascending
                                                  select new { Title = _idx.Title, ID = _idx.Id.Value };
             m_WarehouseDropDownList.DataTextField  = "Title";
             m_WarehouseDropDownList.DataValueField = "ID";
             m_WarehouseDropDownList.DataBind();
             //This best practice addresses the issue identified by the SharePoint Dispose Checker Tool as SPDisposeCheckID_210
             SPWeb   _currentWeb = SPControl.GetContextWeb(this.Context);
             Partner _Partner    = Partner.FindForUser(EDC, _currentWeb.CurrentUser);
             if (_Partner != null)
             {
                 m_WarehouseDropDownList.Select(_Partner.Partner2WarehouseTitle);
             }
             else
             {
                 m_WarehouseDropDownList.SelectedIndex = 0;
             }
             m_Calendar.VisibleDate  = DateTime.Today;
             m_Calendar.SelectedDate = DateTime.Today;
         }
         m_InterconnectionDataTable_TimeSlotTimeSlot = new InterconnectionDataTable <TimeSlotTimeSlot>(typeof(TimeSlot).Name);
         m_Calendar.DayRender                += new DayRenderEventHandler(m_Calendar_DayRender);
         m_Calendar.SelectionChanged         += new EventHandler(m_Calendar_SelectionChanged);
         m_Calendar.VisibleMonthChanged      += new MonthChangedEventHandler(m_Calendar_VisibleMonthChanged);
         m_TimeSlotList.SelectedIndexChanged += new EventHandler(m_TimeSlotList_SelectedIndexChanged);
     }
     catch (Exception ex)
     {
         throw new ApplicationException("Page_Load exception: " + ex.Message, ex);
     }
 }