internal static CheckListWebPartDataContract GetCheckListWebPartDataContract(WebsiteModel.Linq.Entities entities, WebsiteModel.Linq.DisposalRequestLib disposalRequestLib)
        {
            List <DisposalDescription> _dda = new List <DisposalDescription>();

            foreach (CustomsWarehouseDisposal _cwdx in disposalRequestLib.CustomsWarehouseDisposal(entities, false))
            {
                CustomsWarehouse _cw = _cwdx.CWL_CWDisposal2CustomsWarehouseID;
                if (_cw == null)
                {
                    throw new ArgumentNullException("CWL_CWDisposal2CustomsWarehouseID", "CustomsWarehouseDisposal is not connected to CustomsWarehouse");
                }
                DisposalDescription _new = new DisposalDescription
                {
                    OGLDate        = _cw.CustomsDebtDate.GetValueOrDefault(),
                    OGLNumber      = _cw.DocumentNo,
                    PackageToClear = Convert.ToInt32(_cw.AccountBalance.Value / _cw.CW_MassPerPackage.Value)
                };
                _dda.Add(_new);
            }
            CheckListWebPartDataContract _ret = new CheckListWebPartDataContract
            {
                Today         = DateTime.Today,
                DisposalsList = _dda.ToArray()
            };

            return(_ret);
        }
Esempio n. 2
0
 private void NewDataEventHandler(object sender, DisposalInterconnectionData e)
 {
     if (string.IsNullOrEmpty(e.ID))
     {
         return;
     }
     EnsureChildControls();
     m_SelectedItemTitle.Text = e.Title;
     using (Entities _edx = new Entities())
     {
         DisposalRequestLib           _drl = Element.GetAtIndex <DisposalRequestLib>(_edx.DisposalRequestLibrary, e.ID);
         CheckListWebPartDataContract _dc  = CheckListWebPartDataContract.GetCheckListWebPartDataContract(_edx, _drl);
         m_HiddenFieldData.Value = _dc.Serialize();
     }
 }