예제 #1
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())
     {
         CustomsWarehouseDisposal _cwd = Element.GetAtIndex <CustomsWarehouseDisposal>(_edx.CustomsWarehouseDisposal, e.ID);
         ExitSheeDataContract     _dc  = ExitSheeDataContract.GetExitSheeDataContract(_edx, _cwd);
         m_HiddenFieldData.Value = _dc.Serialize();
     }
 }
예제 #2
0
        internal static ExitSheeDataContract GetExitSheeDataContract(Entities edc, WebsiteModel.Linq.CustomsWarehouseDisposal cwd)
        {
            Warehouse        _wrh           = (from _wrhx in edc.Warehouse where _wrhx.SPProcedure == cwd.CustomsProcedure select _wrhx).FirstOrDefault();
            string           _warehouseName = _wrh == null ? "N/A" : _wrh.WarehouseName;
            CustomsWarehouse _cw            = cwd.CWL_CWDisposal2CustomsWarehouseID;

            if (_cw == null)
            {
                throw new ArgumentNullException("CWL_CWDisposal2CustomsWarehouseID", "CustomsWarehouseDisposal is not connected to CustomsWarehouse");
            }
            ExitSheeDataContract _esdc = new ExitSheeDataContract
            {
                Grade             = cwd.CWL_CWDisposal2CustomsWarehouseID.Grade,
                OGLNumber         = _cw.DocumentNo,
                PackageToClear    = Convert.ToInt32(cwd.CW_PackageToClear.GetValueOrDefault()),
                RemainingPackage  = Convert.ToInt32(cwd.CW_RemainingPackage.GetValueOrDefault()),
                RemainingQuantity = cwd.RemainingQuantity.GetValueOrDefault(),
                SAD            = cwd.SADDocumentNo,
                SettledNetMass = cwd.CW_SettledNetMass.GetValueOrDefault(),
                WarehouseName  = _warehouseName
            };

            return(_esdc);
        }