Example #1
0
        private void fix_Super_Super_Deliveryman_Salesman(BuySellDoc bsd)
        {
            if (bsd.DeliverymanSalesmanId.IsNullOrWhiteSpace())
            {
                return;
            }

            if (bsd.DeliverymanSalesman.IsNull())
            {
                throw new Exception("Deliveryman Salesman is null.");
            }


            if (bsd.DeliverymanSalesman.ParentSalesmanId.IsNullOrWhiteSpace())
            {
                return;
            }

            if (bsd.DeliverymanSalesman.ParentSalesman.IsNull())
            {
                throw new Exception("Deliveryman Salesman Parent is null.");
            }

            if (bsd.DeliverymanSalesman.ParentSalesman.ParentSalesmanId.IsNullOrWhiteSpace())
            {
                return;
            }

            bsd.DeliverymanSalesman.ParentSalesman.ParentSalesman = SalesmanBiz.Find(bsd.DeliverymanSalesman.ParentSalesman.ParentSalesmanId);
            bsd.DeliverymanSalesman.ParentSalesman.ParentSalesman.IsNullThrowException();
        }
Example #2
0
 private void fixOwnerSalesman(BuySellDoc buySellDoc)
 {
     //do we want to allow empty orders??
     if (buySellDoc.OwnerSalesmanId.IsNullOrWhiteSpace())
     {
         buySellDoc.OwnerSalesmanId = null;
     }
     else
     {
         buySellDoc.OwnerSalesman = SalesmanBiz.Find(buySellDoc.OwnerSalesmanId);
         buySellDoc.OwnerSalesman.IsNullThrowException("Salesman not found!");
     }
 }
Example #3
0
        private void fix_Super_Customer_Salesman(BuySellDoc bsd)
        {
            if (bsd.CustomerSalesmanId.IsNullOrWhiteSpace())
            {
                return;
            }

            if (bsd.CustomerSalesman.IsNull())
            {
                throw new Exception("Customer Salesman is null.");
            }


            if (bsd.CustomerSalesman.ParentSalesmanId.IsNullOrWhiteSpace())
            {
                return;
            }

            if (bsd.CustomerSalesman.ParentSalesman.IsNull())
            {
                bsd.CustomerSalesman.ParentSalesman = SalesmanBiz.Find(bsd.CustomerSalesman.ParentSalesmanId);
                bsd.CustomerSalesman.ParentSalesman.IsNullThrowException();
            }
        }