Esempio n. 1
0
 private StateMachineEngine.ActionResult Update()
 {
     if (m_ControlState.LoadDescriptionID.IsNullOrEmpty())
     {
         return(StateMachineEngine.ActionResult.Success);
     }
     try
     {
         LoadDescription _ld = Element.GetAtIndex <LoadDescription>(EDC.LoadDescription, m_ControlState.LoadDescriptionID);
         List <string>   _ve = new List <string>();
         StateMachineEngine.ActionResult _res = Update(_ld, _ve);
         if (_res.ActionSucceeded)
         {
             //ReportAlert("LoadDescription updated");
             if (m_ControlState.m_POModified)
             {
                 CurrentShipping.UpdateLoadDescriptionInfo(EDC, null, null);
                 m_ControlState.m_POModified = false;
             }
             EDC.SubmitChanges();
             InitLoadDescriptionGridView(CurrentShipping, null);
         }
         return(_res);
     }
     catch (Exception ex)
     {
         return(new StateMachineEngine.ActionResult(ex));
     }
 }
Esempio n. 2
0
 private StateMachineEngine.ActionResult Create()
 {
     try
     {
         LoadDescription _ld = new LoadDescription();
         _ld.LoadDescription2ShippingIndex = CurrentShipping;
         List <string> _ve = new List <string>();
         StateMachineEngine.ActionResult _res = Update(_ld, _ve);
         if (_res.ActionSucceeded)
         {
             //ReportAlert("LoadDescription created");
             _ld.LoadDescription2PartnerTitle = CurrentShipping.PartnerTitle;
             EDC.LoadDescription.InsertOnSubmit(_ld);
             CurrentShipping.UpdateLoadDescriptionInfo(EDC, null, _ld);
             m_ControlState.m_POModified = false;
             EDC.SubmitChanges();
             m_ControlState.LoadDescriptionID = _ld.Id.Value.ToString();
             InitLoadDescriptionGridView(CurrentShipping, null);
         }
         return(_res);
     }
     catch (Exception ex)
     {
         return(new StateMachineEngine.ActionResult(ex));
     }
 }