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);
        }
Ejemplo n.º 2
0
 public CheckListWebPartDataContract()
 {
     Today         = DateTime.Today;
     DisposalsList = new DisposalDescription[]
     { new DisposalDescription()
       {
           OGLDate = DateTime.Today, OGLNumber = "N/A", PackageToClear = 0
       },
       new DisposalDescription()
       {
           OGLDate = DateTime.Today, OGLNumber = "N/A", PackageToClear = 1
       } };
 }