Ejemplo n.º 1
0
        public void UpdateSalesTerritoryHistory(SalesTerritoryHistory salesterritoryhistory)
        {
            SalesTerritoryHistoryData data = new SalesTerritoryHistoryData();

            try
            {
                SalesTerritoryHistory hist = data.GetSalesTerritoryHistory(salesterritoryhistory.ID);
                if (hist.SalesPersonID == salesterritoryhistory.SalesPersonID &&
                    hist.StartDate == salesterritoryhistory.StartDate)
                {
                    return;
                }
                hist.EndDate = salesterritoryhistory.StartDate;
                data.UpdateSalesTerritoryHistory(hist);
                data.AddSalesTerritoryHistory(salesterritoryhistory);
            }
            catch (Exception ex)
            {
                log.Write(ex.Message, "UpdateSalesTerritoryHistory");
                throw (ex);
            }
            finally
            {
                data = null;
            }
        }
Ejemplo n.º 2
0
        public bool AddSalesTerritoryHistory(SalesTerritoryHistory salesterritoryhistory)
        {
            SalesTerritoryHistoryData data = new SalesTerritoryHistoryData();
            bool ret = true;

            try
            {
                ret = data.AddSalesTerritoryHistory(salesterritoryhistory);
            }
            catch (Exception ex)
            {
                log.Write(ex.Message, "AddSalesTerritoryHistory");
                throw (ex);
            }
            finally
            {
                data = null;
            }
            return(ret);
        }