Ejemplo n.º 1
0
        public void InsertForwarder(ForwarderDTO forwarder)
        {
            Forwarder newForwarder = ForwarderFactory.Create(forwarder.Name, forwarder.Tel, forwarder.Fax,
                forwarder.Attn,
                forwarder.Email,
                forwarder.Addr);

            _forwarderRepository.Add(newForwarder);
        }
Ejemplo n.º 2
0
        public void ModifyForwarder(ForwarderDTO forwarder)
        {
            Forwarder updateForwarder = _forwarderRepository.Get(forwarder.ForwarderId); //获取需要更新的对象。

            //更新。
            updateForwarder.CnName = forwarder.Name;
            updateForwarder.Tel = forwarder.Tel;
            updateForwarder.Fax = forwarder.Fax;
            updateForwarder.Attn = forwarder.Attn;
            updateForwarder.Email = forwarder.Email;
            updateForwarder.Address = new Address(null, null, forwarder.Addr, null);
            _forwarderRepository.Modify(updateForwarder);
        }
Ejemplo n.º 3
0
 public void DeleteForwarder(ForwarderDTO forwarder)
 {
     Forwarder newForwarder = _forwarderRepository.Get(forwarder.ForwarderId); //获取需要删除的对象。
     _forwarderRepository.Remove(newForwarder); //删除承运人。
 }