Esempio n. 1
0
        public void Insert(int SalesPersonID, int TerritoryID, DateTime StartDate, DateTime?EndDate, Guid Rowguid, DateTime ModifiedDate)
        {
            SalesTerritoryHistory item = new SalesTerritoryHistory();

            item.SalesPersonID = SalesPersonID;

            item.TerritoryID = TerritoryID;

            item.StartDate = StartDate;

            item.EndDate = EndDate;

            item.Rowguid = Rowguid;

            item.ModifiedDate = ModifiedDate;


            item.Save(UserName);
        }
Esempio n. 2
0
        public static void SaveSalesPersonMap(int varTerritoryID, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM SalesTerritoryHistory WHERE TerritoryID=@TerritoryID", SalesTerritory.Schema.Provider.Name);

            cmdDel.AddParameter("@TerritoryID", varTerritoryID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    SalesTerritoryHistory varSalesTerritoryHistory = new SalesTerritoryHistory();
                    varSalesTerritoryHistory.SetColumnValue("TerritoryID", varTerritoryID);
                    varSalesTerritoryHistory.SetColumnValue("SalesPersonID", l.Value);
                    varSalesTerritoryHistory.Save();
                }
            }
        }
Esempio n. 3
0
 public bool Destroy(object SalesPersonID)
 {
     return(SalesTerritoryHistory.Destroy(SalesPersonID) == 1);
 }