void Filter2()
    {
        clsSupplierCollection Supplier = new clsSupplierCollection();

        Supplier.ThisSupplier.WorkNumber = txtFilterWorkNumber.Text;
        Supplier.FilterByWorkNumber(Supplier.ThisSupplier.WorkNumber);
        lstBoxListSupplier.DataSource     = Supplier.SupplierList;
        lstBoxListSupplier.DataValueField = "SupplierID";
        lstBoxListSupplier.DataTextField  = "SupplierName";
        lstBoxListSupplier.DataBind();
    }
    void Filter3()
    {
        clsSupplierCollection Supplier = new clsSupplierCollection();

        Supplier.ThisSupplier.SupplierName = txtFilterSupplierName.Text;
        Supplier.FilterBySupplierName(Supplier.ThisSupplier.SupplierName);
        lstBoxListSupplier.DataSource     = Supplier.SupplierList;
        lstBoxListSupplier.DataValueField = "SupplierID";
        lstBoxListSupplier.DataTextField  = "SupplierName";
        lstBoxListSupplier.DataBind();
    }
예제 #3
0
    void DisplaySuppliers()
    {
        clsSupplierCollection SupplierCollection = new clsSupplierCollection();

        SupplierCollection.ThisSupplier.Find(ID);
        txtID.Text        = Convert.ToString(ID);
        txtDelivery.Text  = Convert.ToString(SupplierCollection.ThisSupplier.LastDelivery.ToShortDateString());
        txtName.Text      = SupplierCollection.ThisSupplier.Name;
        txtEmail.Text     = SupplierCollection.ThisSupplier.Email;
        txtAddress.Text   = SupplierCollection.ThisSupplier.Address;
        cbxActive.Checked = SupplierCollection.ThisSupplier.Active;
    }
        public void CountPropertyOK()
        {
            //create an instance of the class we want to create
            clsSupplierCollection AllSuppliers = new clsSupplierCollection();
            //create some test data to assign to the property
            Int32 SomeCount = 3;

            //assign the data to the property
            AllSuppliers.Count = SomeCount;
            //test to see that the two values are the same
            Assert.AreEqual(AllSuppliers.Count, SomeCount);
        }
예제 #5
0
    void DisplayRecord()
    {
        //get the number of the Car to be processed.
        SupplierID = Convert.ToInt32(Session["SupplierID"]);
        //create an instance.
        clsSupplierCollection Supplier = new clsSupplierCollection();

        //find the record to be displayed.
        Supplier.ThisSupplier.Find(SupplierID);
        //copy properties into textboxes on web form.
        txtReceptionistSupplierID.Text = Supplier.ThisSupplier.SupplierID.ToString();
    }
예제 #6
0
    void DisplaySupplier()
    {
        //create an instance of supplier book
        clsSupplierCollection SupplierBook = new clsSupplierCollection();

        //find the record to update
        SupplierBook.ThisSupplier.Find(Supplier_Id);
        //display the data for this record
        txtSupplier_Address.Text  = SupplierBook.ThisSupplier.Supplier_Address;
        txtSupplier_Email.Text    = SupplierBook.ThisSupplier.Supplier_Email;
        txtSupplier_Name.Text     = SupplierBook.ThisSupplier.Supplier_Name;
        txtSupplier_Phone_No.Text = SupplierBook.ThisSupplier.Supplier_Phone_No;
        ddlCounty.SelectedValue   = SupplierBook.ThisSupplier.CountyNo.ToString();
        chkActive.Checked         = SupplierBook.ThisSupplier.Active;
    }
예제 #7
0
        public void ThisSupplierPropertyOk()
        {
            clsSupplierCollection AllSuppliers = new clsSupplierCollection();
            clsSuppliers          TestSupplier = new clsSuppliers();

            TestSupplier.Active       = true;
            TestSupplier.Address      = "123 WotC Lane";
            TestSupplier.Email        = "*****@*****.**";
            TestSupplier.ID           = 10;
            TestSupplier.LastDelivery = DateTime.Now.Date;
            TestSupplier.Name         = "WotC";

            AllSuppliers.ThisSupplier = TestSupplier;
            Assert.AreEqual(AllSuppliers.ThisSupplier, TestSupplier);
        }
예제 #8
0
        public void ThisSupplierPropertyOK()
        {
            clsSupplierCollection AllSupplier = new clsSupplierCollection();
            clsSupplier           TestItem    = new clsSupplier();

            TestItem.SupplierID      = 1;
            TestItem.CompanyName     = "teesLTD";
            TestItem.Product         = "tShirts";
            TestItem.PhoneNumber     = "07456332127";
            TestItem.EmailAddress    = "*****@*****.**";
            TestItem.Address         = "101 Second Avenue";
            TestItem.PostCode        = "LE1 1ST";
            AllSupplier.ThisSupplier = TestItem;
            Assert.AreEqual(AllSupplier.ThisSupplier, TestItem);
        }
예제 #9
0
        public void ThisSupplierPropertyOK()
        {
            clsSupplierCollection AllSuppliers = new clsSupplierCollection();

            clsSuppliers TestItem = new clsSuppliers();

            TestItem.ID           = 1;
            TestItem.Address      = "Test Address";
            TestItem.Email        = "*****@*****.**";
            TestItem.Name         = "Test Name";
            TestItem.LastDelivery = DateTime.Now.Date;
            TestItem.Active       = true;

            AllSuppliers.ThisSupplier = TestItem;
            Assert.AreEqual(AllSuppliers.ThisSupplier, TestItem);
        }
예제 #10
0
    void FilterBySupplierEmail()
    {
        //create an instance of the class.
        clsSupplierCollection Suppliers = new clsSupplierCollection();

        //get the supplier email the user wants to filter by.
        Suppliers.FilterBySupplierEmail(txtReceptionistSearchSupplier.Text);
        //Set the data source to the list of cars in the collection.
        lstBoxReceptionistListCars.DataSource = Suppliers.SupplierList;
        //Set the name of the primary
        lstBoxReceptionistListCars.DataValueField = "SupplierID";
        //set the data field to display.
        lstBoxReceptionistListCars.DataTextField = "SupplierEmail";
        //Bind the data to the list.
        lstBoxReceptionistListCars.DataBind();
    }
예제 #11
0
        public void ListAndCountOK()
        {
            clsSupplierCollection AllSupplier = new clsSupplierCollection();
            List <clsSupplier>    TestList    = new List <clsSupplier>();
            clsSupplier           TestItem    = new clsSupplier();

            TestItem.SupplierID   = 1;
            TestItem.CompanyName  = "teesLTD";
            TestItem.Product      = "tShirts";
            TestItem.PhoneNumber  = "07456332127";
            TestItem.EmailAddress = "*****@*****.**";
            TestItem.Address      = "101 Second Avenue";
            TestItem.PostCode     = "LE1 1ST";
            TestList.Add(TestItem);
            AllSupplier.SupplierList = TestList;
            Assert.AreEqual(AllSupplier.Count, TestList.Count);
        }
예제 #12
0
    protected void btnApply_click(Object sender, EventArgs e)
    {
        clsSupplierCollection Supplier = new clsSupplierCollection();

        Supplier.ReportBySupplierId(filterBox.Text);

        ListBox1.DataTextField = "CompanyName";

        ListBox1.DataTextField = "Address";

        ListBox1.DataTextField = "PostalCode";

        ListBox1.DataTextField = "Phone";

        ListBox1.DataTextField = "StockAvaliablity";

        ListBox1.DataBind();
    }
예제 #13
0
    void DisplaySupplier()
    {
        clsSupplierCollection supplier = new clsSupplierCollection();

        ListBox1.DataValueField = "SupplierId";

        ListBox1.DataTextField = "CompanyName";

        ListBox1.DataTextField = "Address";

        ListBox1.DataTextField = "PostalCode";

        ListBox1.DataTextField = "Phone";

        ListBox1.DataTextField = "StockAvaliablity";

        ListBox1.DataBind();
    }
예제 #14
0
        public void SupplierListOK()
        {
            clsSupplierCollection AllSuppliers = new clsSupplierCollection();

            List <clsSuppliers> TestList = new List <clsSuppliers>();

            clsSuppliers TestItem = new clsSuppliers();

            TestItem.ID           = 1;
            TestItem.Address      = "Test Address";
            TestItem.Email        = "*****@*****.**";
            TestItem.Name         = "Test Name";
            TestItem.LastDelivery = DateTime.Now.Date;
            TestItem.Active       = true;

            TestList.Add(TestItem);
            AllSuppliers.SupplierList = TestList;
            Assert.AreEqual(AllSuppliers.SupplierList, TestList);
        }
예제 #15
0
        public void FilterByCompanyNameTestDataFound()
        {
            clsSupplierCollection FilteredSupplier = new clsSupplierCollection();
            Boolean OK = true;

            FilteredSupplier.FilterByCompanyName("d");
            if (FilteredSupplier.Count == 1)
            {
                if (FilteredSupplier.SupplierList[0].SupplierID != 2)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #16
0
        public void AddMethodOK()
        {
            clsSupplierCollection AllSupplier = new clsSupplierCollection();
            clsSupplier           TestItem    = new clsSupplier();
            Int32 PrimaryKey = 0;

            TestItem.SupplierID      = 1;
            TestItem.CompanyName     = "teesLTD";
            TestItem.Product         = "tShirts";
            TestItem.PhoneNumber     = "07456332127";
            TestItem.EmailAddress    = "*****@*****.**";
            TestItem.Address         = "101 Second Avenue";
            TestItem.PostCode        = "LE1 1ST";
            AllSupplier.ThisSupplier = TestItem;
            PrimaryKey          = AllSupplier.Add();
            TestItem.SupplierID = PrimaryKey;
            AllSupplier.ThisSupplier.Find(PrimaryKey);
            Assert.AreEqual(AllSupplier.ThisSupplier, TestItem);
        }
예제 #17
0
    protected void btnClear_click(Object sender, EventArgs e)
    {
        clsSupplierCollection staff = new clsSupplierCollection();

        filterBox.Text          = "";
        ListBox1.DataValueField = "SupplierId";

        ListBox1.DataTextField = "CompanyName";

        ListBox1.DataTextField = "Address";

        ListBox1.DataTextField = "PostalCode";

        ListBox1.DataTextField = "Phone";

        ListBox1.DataTextField = "StockAvaliablity";

        ListBox1.DataBind();
    }
예제 #18
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        clsSuppliers ASupplier = new clsSuppliers();

        string Name         = txtName.Text;
        string Address      = txtAddress.Text;
        string Email        = txtEmail.Text;
        string LastDelivery = txtDelivery.Text;

        string Error = "";

        Error = ASupplier.Valid(Name, Email, Address, LastDelivery);


        if (Error == "")
        {
            ASupplier.Name         = Name;
            ASupplier.Address      = Address;
            ASupplier.Email        = Email;
            ASupplier.LastDelivery = Convert.ToDateTime(LastDelivery);
            ASupplier.Active       = cbxActive.Checked;

            clsSupplierCollection SupplierList = new clsSupplierCollection();

            if (ID == -1)
            {
                SupplierList.ThisSupplier = ASupplier;
                SupplierList.Add();
            }
            else
            {
                SupplierList.ThisSupplier.Find(ID);
                SupplierList.ThisSupplier = ASupplier;
                SupplierList.Update();
            }

            Response.Redirect("SupplierList.aspx");
        }
        else
        {
            lblResult.Text = Error;
        }
    }
        public void ThisSupplierPropertyOK()
        {
            clsSupplierCollection AllSupplier  = new clsSupplierCollection();
            clsSupplier           TestSupplier = new clsSupplier();

            TestSupplier.Address           = "1b";
            TestSupplier.City              = "Birmingham";
            TestSupplier.County            = "eastmidlands";
            TestSupplier.DateAdded         = System.DateTime.Now.Date;
            TestSupplier.Mobile            = "078";
            TestSupplier.Name              = "Mark";
            TestSupplier.Postcode          = "CV6";
            TestSupplier.PositionInCompany = "1bbbbbbbbbbbbbbbbbbbbbb25";
            TestSupplier.SupplierName      = "Audi";
            TestSupplier.Title             = "Mr";
            TestSupplier.WorkExt           = "312";
            TestSupplier.WorkNumber        = "12134";
            AllSupplier.ThisSupplier       = TestSupplier;
            Assert.AreEqual(AllSupplier.ThisSupplier, TestSupplier);
        }
예제 #20
0
        public void ThisSupplierPropertyOK()
        {
            //create an instance of the class we want to create
            clsSupplierCollection AllSuppliers = new clsSupplierCollection();
            //create some test data to assign to the property
            clsSupplier TestSupplier = new clsSupplier();

            //set the properties of the test object
            TestSupplier.Active            = true;
            TestSupplier.Supplier_Address  = "Some Supplier Address ";
            TestSupplier.CountyNo          = 1;
            TestSupplier.Supplier_Email    = "*****@*****.**";
            TestSupplier.Supplier_Id       = 001;
            TestSupplier.Supplier_Name     = "Game.net";
            TestSupplier.Supplier_Phone_No = "07331415589";
            //assign the data to the property
            AllSuppliers.ThisSupplier = TestSupplier;
            //test to see that the two values are the same
            Assert.AreEqual(AllSuppliers.ThisSupplier, TestSupplier);
        }
예제 #21
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        clsSupplier supplier = new clsSupplier();

        String SupplierId = TextBox2.Text;

        String CompanyName = TextBox3.Text;

        String StockAvaliablity = TextBox1.Text;

        Boolean active = Active.Checked;

        String Error = "";

        Error = supplier.Valid(SupplierId, CompanyName, StockAvaliablity, active);

        if (Error == "")
        {
            supplier.active            = active;
            supplier.SupplierId        = SupplierId;
            supplier.Company_name      = Company_Name;
            supplier.stock_avaliablity = StockAvaliablity;

            Session["supplier"] = supplier;

            clsSupplierCollection staffList = new clsSupplierCollection();

            {
            }
            {
            }



            Response.Redirect("SupplierList.aspx");
        }
        else
        {
            lblError.Text = Error;
        }
    }
    void Delete()
    {
        SupplierID = Convert.ToInt32(Session["SupplierID"]);
        clsSupplierCollection SupplierBook = new clsSupplierCollection();

        SupplierBook.ThisSupplier.Find(SupplierID);
        txtAddress.Text           = SupplierBook.ThisSupplier.Address;
        txtCity.Text              = SupplierBook.ThisSupplier.City;
        txtCounty.Text            = SupplierBook.ThisSupplier.County;
        txtDateAdded.Text         = SupplierBook.ThisSupplier.DateAdded.ToString();
        txtMobile.Text            = SupplierBook.ThisSupplier.Mobile;
        txtName.Text              = SupplierBook.ThisSupplier.Name;
        txtPostcode.Text          = SupplierBook.ThisSupplier.Postcode;
        txtPositionInCompany.Text = SupplierBook.ThisSupplier.PositionInCompany;
        txtSupplierName.Text      = SupplierBook.ThisSupplier.SupplierName;
        txtTitle.Text             = SupplierBook.ThisSupplier.Title;
        txtWorkExt.Text           = SupplierBook.ThisSupplier.WorkExt;
        txtWorkNumber.Text        = SupplierBook.ThisSupplier.WorkNumber;

        SupplierBook.Delete();
    }
예제 #23
0
        public void AddMethodOK()
        {
            clsSupplierCollection Suppliers = new clsSupplierCollection();

            clsSuppliers Supplier1 = new clsSuppliers();

            Int32 PrimaryKey = 1;

            Supplier1.Active       = true;
            Supplier1.Address      = "64 Zoo Lane";
            Supplier1.Email        = "*****@*****.**";
            Supplier1.LastDelivery = DateTime.Now.Date;
            Supplier1.Name         = "WotC";
            Supplier1.ID           = PrimaryKey;

            Suppliers.ThisSupplier = Supplier1;
            PrimaryKey             = Suppliers.Add();

            Suppliers.ThisSupplier.Find(PrimaryKey);
            Assert.AreEqual(Suppliers.ThisSupplier, Supplier1);
        }
        public void ListAndCountOK()
        {
            clsSupplierCollection AllSupplier = new clsSupplierCollection();
            List <clsSupplier>    TestList    = new List <clsSupplier>();
            clsSupplier           TestItem    = new clsSupplier();

            TestItem.Address           = "1b";
            TestItem.City              = "Birmingham";
            TestItem.County            = "eastmidlands";
            TestItem.DateAdded         = System.DateTime.Now.Date;
            TestItem.Mobile            = "078";
            TestItem.Name              = "Mark";
            TestItem.Postcode          = "CV6";
            TestItem.PositionInCompany = "1bbbbbbbbbbbbbbbbbbbbbb25";
            TestItem.SupplierName      = "Audi";
            TestItem.Title             = "Mr";
            TestItem.WorkExt           = "312";
            TestItem.WorkNumber        = "12134";
            TestList.Add(TestItem);
            AllSupplier.SupplierList = TestList;
            Assert.AreEqual(AllSupplier.Count, TestList.Count);
        }
        public void SupplierUpdateMethodOK()
        {
            clsSupplierCollection AllSuppliers = new clsSupplierCollection();
            clsSupplier           TestItem     = new clsSupplier();
            Int32 PrimaryKey = 0;

            TestItem.Address           = "1b";
            TestItem.City              = "Birmingham";
            TestItem.County            = "eastmidlands";
            TestItem.DateAdded         = System.DateTime.Now.Date;
            TestItem.Mobile            = "078";
            TestItem.Name              = "Mark";
            TestItem.Postcode          = "CV6";
            TestItem.PositionInCompany = "1bbbbbbbbbbbbbbbbbbbbbb25";
            TestItem.SupplierName      = "Audi";
            TestItem.Title             = "Mr";
            TestItem.WorkExt           = "312";
            TestItem.WorkNumber        = "12134";
            TestItem.SupplierEmail     = "*****@*****.**";
            AllSuppliers.ThisSupplier  = TestItem;
            PrimaryKey                 = AllSuppliers.Add();
            TestItem.SupplierID        = PrimaryKey;
            TestItem.Address           = "2b";
            TestItem.City              = "Coventry";
            TestItem.County            = "westmidlands";
            TestItem.DateAdded         = System.DateTime.Now.Date;
            TestItem.Mobile            = "079";
            TestItem.Name              = "john";
            TestItem.Postcode          = "CV8";
            TestItem.PositionInCompany = "1cccccccc";
            TestItem.SupplierName      = "bmw";
            TestItem.Title             = "Mrs";
            TestItem.WorkExt           = "412";
            TestItem.WorkNumber        = "1214";
            TestItem.SupplierEmail     = "*****@*****.**";
            AllSuppliers.Update();
            AllSuppliers.ThisSupplier.Find(PrimaryKey);
            Assert.AreEqual(AllSuppliers.ThisSupplier, TestItem);
        }
예제 #26
0
        public void DeleteMethodOK()
        {
            clsSupplierCollection AllSupplier = new clsSupplierCollection();
            clsSupplier           TestItem    = new clsSupplier();
            Int32 PrimaryKey = 0;

            //data to delete
            TestItem.CompanyName     = "teesLTD";
            TestItem.Product         = "tShirts";
            TestItem.PhoneNumber     = "07456332127";
            TestItem.EmailAddress    = "*****@*****.**";
            TestItem.Address         = "101 Second Avenue";
            TestItem.PostCode        = "LE1 1ST";
            AllSupplier.ThisSupplier = TestItem;
            PrimaryKey          = AllSupplier.Add();
            TestItem.SupplierID = PrimaryKey;
            AllSupplier.ThisSupplier.Find(PrimaryKey);
            AllSupplier.Delete();
            Boolean Found = AllSupplier.ThisSupplier.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
예제 #27
0
        public void FilterMethodTestDataFound()
        {
            clsSupplierCollection FilteredSuppliers = new clsSupplierCollection();
            Boolean OK = true;

            FilteredSuppliers.Filter("Test Data");
            if (FilteredSuppliers.Count == 2)
            {
                if (FilteredSuppliers.SupplierList[0].ID != 2)
                {
                    OK = false;
                }
                if (FilteredSuppliers.SupplierList[1].ID != 3)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
    void DisplaySupplier()
    {
        //set variable equal to the session number
        SupplierID = Convert.ToInt32(Session["SupplierID"]);
        //Create instance in Supplier collection class
        clsSupplierCollection SupplierBook = new clsSupplierCollection();

        //run SupplierID through the find function
        SupplierBook.ThisSupplier.Find(SupplierID);
        //assign the data from records in the database to the text boxes
        txtAddress.Text           = SupplierBook.ThisSupplier.Address;
        txtCity.Text              = SupplierBook.ThisSupplier.City;
        txtCounty.Text            = SupplierBook.ThisSupplier.County;
        txtDateAdded.Text         = SupplierBook.ThisSupplier.DateAdded.ToShortDateString();
        txtMobile.Text            = SupplierBook.ThisSupplier.Mobile;
        txtName.Text              = SupplierBook.ThisSupplier.Name;
        txtPostcode.Text          = SupplierBook.ThisSupplier.Postcode;
        txtPositionInCompany.Text = SupplierBook.ThisSupplier.PositionInCompany;
        txtSupplierName.Text      = SupplierBook.ThisSupplier.SupplierName;
        txtTitle.Text             = SupplierBook.ThisSupplier.Title;
        txtWorkExt.Text           = SupplierBook.ThisSupplier.WorkExt;
        txtWorkNumber.Text        = SupplierBook.ThisSupplier.WorkNumber;
        txtSupplierEmail.Text     = SupplierBook.ThisSupplier.SupplierEmail;
    }
예제 #29
0
    protected void displaySupplier()
    {
        clsSupplierCollection allSupplier = new clsSupplierCollection();

        allSupplier.thisSupplier.Equals(SupplierId);
    }
예제 #30
0
        public void InstanceOK()
        {
            clsSupplierCollection AllSupplier = new clsSupplierCollection();

            Assert.IsNotNull(AllSupplier);
        }