예제 #1
0
        public void Update(int VendorID, int ContactID, int ContactTypeID, DateTime ModifiedDate)
        {
            VendorContact item = new VendorContact();

            item.VendorID = VendorID;

            item.ContactID = ContactID;

            item.ContactTypeID = ContactTypeID;

            item.ModifiedDate = ModifiedDate;

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

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                VendorContact varVendorContact = new VendorContact();
                varVendorContact.SetColumnValue("VendorID", varVendorID);
                varVendorContact.SetColumnValue("ContactTypeID", item);
                varVendorContact.Save();
            }
        }
예제 #3
0
        public static void SaveVendorMap(int varContactID, VendorCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorContact WHERE ContactID=@ContactID", Contact.Schema.Provider.Name);

            cmdDel.AddParameter("@ContactID", varContactID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Vendor item in items)
            {
                VendorContact varVendorContact = new VendorContact();
                varVendorContact.SetColumnValue("ContactID", varContactID);
                varVendorContact.SetColumnValue("VendorID", item.GetPrimaryKeyValue());
                varVendorContact.Save();
            }
        }
예제 #4
0
        public static void SaveContactMap(int varVendorID, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorContact 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)
                {
                    VendorContact varVendorContact = new VendorContact();
                    varVendorContact.SetColumnValue("VendorID", varVendorID);
                    varVendorContact.SetColumnValue("ContactID", l.Value);
                    varVendorContact.Save();
                }
            }
        }
예제 #5
0
 public bool Destroy(object VendorID)
 {
     return(VendorContact.Destroy(VendorID) == 1);
 }
예제 #6
0
 public bool Delete(object VendorID)
 {
     return(VendorContact.Delete(VendorID) == 1);
 }