Example #1
0
        public void Update(int ProductID, int VendorID, int AverageLeadTime, decimal StandardPrice, decimal?LastReceiptCost, DateTime?LastReceiptDate, int MinOrderQty, int MaxOrderQty, int?OnOrderQty, string UnitMeasureCode, DateTime ModifiedDate)
        {
            ProductVendor item = new ProductVendor();

            item.ProductID = ProductID;

            item.VendorID = VendorID;

            item.AverageLeadTime = AverageLeadTime;

            item.StandardPrice = StandardPrice;

            item.LastReceiptCost = LastReceiptCost;

            item.LastReceiptDate = LastReceiptDate;

            item.MinOrderQty = MinOrderQty;

            item.MaxOrderQty = MaxOrderQty;

            item.OnOrderQty = OnOrderQty;

            item.UnitMeasureCode = UnitMeasureCode;

            item.ModifiedDate = ModifiedDate;

            item.MarkOld();
            item.Save(UserName);
        }
Example #2
0
        public static void SaveUnitMeasureMap(int varVendorID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductVendor WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProductVendor varProductVendor = new ProductVendor();
                varProductVendor.SetColumnValue("VendorID", varVendorID);
                varProductVendor.SetColumnValue("UnitMeasureCode", item);
                varProductVendor.Save();
            }
        }
Example #3
0
        public static void SaveVendorMap(string varUnitMeasureCode, VendorCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductVendor WHERE UnitMeasureCode=@UnitMeasureCode", UnitMeasure.Schema.Provider.Name);

            cmdDel.AddParameter("@UnitMeasureCode", varUnitMeasureCode);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Vendor item in items)
            {
                ProductVendor varProductVendor = new ProductVendor();
                varProductVendor.SetColumnValue("UnitMeasureCode", varUnitMeasureCode);
                varProductVendor.SetColumnValue("VendorID", item.GetPrimaryKeyValue());
                varProductVendor.Save();
            }
        }
Example #4
0
        public static void SaveProductMap(int varVendorID, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductVendor WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    ProductVendor varProductVendor = new ProductVendor();
                    varProductVendor.SetColumnValue("VendorID", varVendorID);
                    varProductVendor.SetColumnValue("ProductID", l.Value);
                    varProductVendor.Save();
                }
            }
        }
Example #5
0
 public bool Destroy(object ProductID)
 {
     return(ProductVendor.Destroy(ProductID) == 1);
 }
Example #6
0
 public bool Delete(object ProductID)
 {
     return(ProductVendor.Delete(ProductID) == 1);
 }