Exemple #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            ContractProducts cp = obj as ContractProducts;

            if ((object)cp == null)
            {
                return(false);
            }
            return((this.ContractProducts_Contract == cp.ContractProducts_Contract) && (this.ContractProducts_Product == cp.ContractProducts_Product));
        }
Exemple #2
0
        public List <ContractProducts> GetContractProducts()
        {
            Datahandler             dh          = Datahandler.getData();
            List <ContractProducts> clientProds = new List <ContractProducts>();
            DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetContractProducts + this.ContractProducts_Contract.ContractIdentifier + "'");

            foreach (DataRow item in table.Rows)
            {
                ContractProducts cp = new ContractProducts();
                cp.ContractProducts_Contract = new Contract();
                cp.ContractProducts_Contract.ContractIdentifier = item[DataAccesHelper.cpContractId].ToString();
                List <Product> p = new Product().GetAllProducts(item[DataAccesHelper.cpProductCode].ToString());
                cp.ContractProducts_Product = p[0];
                clientProds.Add(cp);
            }

            return(clientProds);
        }