Inheritance: sp_VendorAddr_CON
Exemple #1
0
 public void TestVendorAddrDelete()
 {
     DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(cExcel.GetHelperFilesDir(), "VendorAddr.xlsx"));
     foreach (DataRow row in dt.Rows) // Loop over the rows.
     {
         Guid vendorID = new Guid(row["VendorID"].ToString());
         sp_VendorAddr_DM data = new sp_VendorAddr_DM();
         data.VendorID = vendorID;
         sp_VendorAddr_BLL vendor = new sp_VendorAddr_BLL();
         vendor.DeleteAddressContext(data);
         var newdata = vendor.ListAddresses(vendorID);
         Assert.IsNull(newdata);
     }
 }
Exemple #2
0
        public void TestVendorAddrCreate()
        {
            //create a vendor
            sp_Vendor_DM data = new sp_Vendor_DM();
            data.VendorID = new Guid();
            string vendorName = "My Name";
            data.VendorName = vendorName;
            data.ActiveFlg = true;
            sp_Vendor_BLL vendor = new sp_Vendor_BLL();
            vendor.InsertVendorContext(ref data);

            //Insert Vendor Addr
            sp_VendorAddr_DM data1 = new sp_VendorAddr_DM();
            data1.VendorID = data.VendorID;
            data1.AddrID = 1;
            sp_VendorAddr_BLL vendoraddr = new sp_VendorAddr_BLL();
            vendoraddr.InsertAddressContext(data1);

            //Read Vendor Add
            var newdata = vendoraddr.ListAddresses(data1.VendorID);

            Assert.AreEqual(newdata.VendorID, data.VendorID, "VendorID Not Set As Expected");
            Assert.AreEqual(newdata.AddrID, 1, "AddrID Not Set As Expected");
        }
Exemple #3
0
 public void TestVendorAddrRead()
 {
     DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(cExcel.GetHelperFilesDir(), "VendorAddr.xlsx"));
     foreach (DataRow row in dt.Rows) // Loop over the rows.
     {
         string vendorID = row["VendorID"].ToString();
         sp_VendorAddr_BLL vendor = new sp_VendorAddr_BLL();
         sp_VendorAddr_DM data = vendor.ListAddresses(new Guid(vendorID));
         Assert.AreEqual(row["AddrID"].ToString(), data.AddrID, "AddrID Not Set As Expected");
         Assert.AreEqual(row["HQ"].ToString(), data.HQ, "HQ Not Set As Expected");
     }
 }
Exemple #4
0
        public void TestVendorAddrReadAll()
        {
            //Pull our data from the excel file
            string helperDir = cExcel.GetHelperFilesDir();
            DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(helperDir, "VendorAddr.xlsx"));
            //Pull our data directly from the DB
            var numRows = cExcel.getNumRecordsFromDB("[Vend].[tblVendorAddr]");

            //Pull our data from the DB through the BLL
            sp_VendorAddr_BLL vendor = new sp_VendorAddr_BLL();
            var allVendors = vendor.ListAddresses();

            //Test the data from the BLL
            Assert.AreEqual(numRows, allVendors.Count);
        }
        protected void getAddresses()
        {
            sp_VendorAddr_BLL vendAddrBLL = new sp_VendorAddr_BLL();
            sp_VendAddress_BLL addressBLL = new sp_VendAddress_BLL();

            foreach (sp_VendorAddr_DM vendAddr in vendAddrBLL.ListAllAddresses((Guid)currentUser.ProviderUserKey))
            {
                addresses.Add(addressBLL.ListAddresses(vendAddr.AddrID));

            }
        }