コード例 #1
0
        private void m_TrailerDropDown_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListItem _li = m_TrailerDropDown.SelectedItem;

            if (_li == null)
            {
                return;
            }
            try
            {
                Shipping _sh = Element.GetAtIndex <Shipping>(EDC.Shipping, m_ControlState.ShippingIdx);
                if (String.IsNullOrEmpty(_li.Value))
                {
                    _sh.TrailerTitle = null;
                }
                else
                {
                    _sh.TrailerTitle = Element.GetAtIndex <Trailer>(EDC.Trailer, _li.Value);
                }
                _sh.CalculateState(EDC, x => { });
                EDC.SubmitChanges();
            }
            catch (Exception _ex)
            {
                SignalException("m_TrailerDropDown_SelectedIndexChanged", "TrailerDropDownErrorMessage".GetShepherdLocalizedString(), _ex);
            }
        }
コード例 #2
0
 private void m_RemoveDriverButton_Click(object sender, EventArgs e)
 {
     try
     {
         ListItem _sel = m_DriversTeamListBox.SelectedItem;
         if (_sel == null)
         {
             return;
         }
         ShippingDriversTeam _cd = Element.GetAtIndex <ShippingDriversTeam>(EDC.DriversTeam, _sel.Value);
         Shipping            _sh = _cd.ShippingIndex;
         _cd.DriverTitle   = null;
         _cd.ShippingIndex = null;
         EDC.DriversTeam.DeleteOnSubmit(_cd);
         EDC.SubmitChanges();
         _sh.CalculateState(EDC, x => { });
         EDC.SubmitChanges();
         UpdateUserInterface(EDC);
     }
     catch (Exception ex)
     {
         SignalException("TransportResourcesUserControl.m_RemoveDriverButton_Click", "RemoveDriverButtonErrorMessage".GetShepherdLocalizedString(), ex);
     }
 }