Exemple #1
0
        public void Update(int SalesOrderID, int SalesReasonID, DateTime ModifiedDate)
        {
            SalesOrderHeaderSalesReason item = new SalesOrderHeaderSalesReason();

            item.SalesOrderID = SalesOrderID;

            item.SalesReasonID = SalesReasonID;

            item.ModifiedDate = ModifiedDate;

            item.MarkOld();
            item.Save(UserName);
        }
Exemple #2
0
        public static void SaveSalesOrderHeaderMap(int varSalesReasonID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM SalesOrderHeaderSalesReason WHERE SalesReasonID=@SalesReasonID", SalesReason.Schema.Provider.Name);

            cmdDel.AddParameter("@SalesReasonID", varSalesReasonID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                SalesOrderHeaderSalesReason varSalesOrderHeaderSalesReason = new SalesOrderHeaderSalesReason();
                varSalesOrderHeaderSalesReason.SetColumnValue("SalesReasonID", varSalesReasonID);
                varSalesOrderHeaderSalesReason.SetColumnValue("SalesOrderID", item);
                varSalesOrderHeaderSalesReason.Save();
            }
        }
Exemple #3
0
        public static void SaveSalesReasonMap(int varSalesOrderID, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM SalesOrderHeaderSalesReason WHERE SalesOrderID=@SalesOrderID", SalesOrderHeader.Schema.Provider.Name);

            cmdDel.AddParameter("@SalesOrderID", varSalesOrderID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    SalesOrderHeaderSalesReason varSalesOrderHeaderSalesReason = new SalesOrderHeaderSalesReason();
                    varSalesOrderHeaderSalesReason.SetColumnValue("SalesOrderID", varSalesOrderID);
                    varSalesOrderHeaderSalesReason.SetColumnValue("SalesReasonID", l.Value);
                    varSalesOrderHeaderSalesReason.Save();
                }
            }
        }