public static Contractor Create(int id)
        {
            Contractor contractor = null;

            using (IDataReader reader = DBContractor.Get(id))
            {
                if(reader.Read())
                {
                    contractor = new Contractor(id);
                    contractor.Name = reader["Name"].ToString();
                    contractor.Phone = reader["Phone"].ToString();
                    contractor.Movile = reader["Movile"].ToString();
                    contractor.StatusCode = reader["Status"].ToString();
                }
            }

            if (contractor == null)
                return Contractor.Empty;

            using (IDataReader reader = DBContractor.GetAllSpecialties(id))
            {
                while (reader.Read())
                {
                    contractor.Specialties.Add(reader["SpecialtyId"].ToString());
                }
            }

            using (IDataReader reader = DBContractor.GetBankAccounts(id))
            {
                while (reader.Read())
                {
                    ContractorBankAccount bankAccount = new ContractorBankAccount(Convert.ToInt32(reader["ContractorAccountId"]));

                    bankAccount.AccountNumber = reader["Account"].ToString();
                    bankAccount.Bank = reader["Bank"].ToString();
                    contractor.BankAccounts.Add(bankAccount);
                }
            }

            return contractor;
        }
        public static ContractorBankAccount Create(int contractorId, int contractorBankAccountId)
        {
            ContractorBankAccount bankAccount = new ContractorBankAccount(contractorId);

            using (IDataReader reader = DBContractor.GetBankAccount(contractorId, contractorBankAccountId))
            {
                if (reader.Read())
                {
                    bankAccount.Bank = (string)reader["Bank"];
                    bankAccount.AccountNumber = (string)reader["Account"];
                }
            }

            return bankAccount;
        }
        private void Save()
        {
            Contractor contractor = new Contractor(_contractorId);
            ContractorBankAccount bankAccount = null;

            contractor.Name = this.txtName.Text;
            contractor.Phone = this.txtPhone.Text;
            contractor.Movile = this.txtMovile.Text;
            contractor.StatusCode = this.ddlStatus.SelectedValue;

            foreach (ListItem item in this.lstSpecialties.Items)
            {
                if (item.Selected)
                {
                    contractor.Specialties.Add(item.Value);
                }
            }

            bankAccount = new ContractorBankAccount(BankAccountId1);
            bankAccount.Bank = txtBank1.Text;
            bankAccount.AccountNumber = txtBankAccount1.Text;
            contractor.BankAccounts.Add(bankAccount);

            bankAccount = new ContractorBankAccount(BankAccountId2);
            bankAccount.Bank = txtBank2.Text;
            bankAccount.AccountNumber = txtBankAccount2.Text;
            contractor.BankAccounts.Add(bankAccount);

            bankAccount = new ContractorBankAccount(BankAccountId3);
            bankAccount.Bank = txtBank3.Text;
            bankAccount.AccountNumber = txtBankAccount3.Text;
            contractor.BankAccounts.Add(bankAccount);

            contractor.Save();
        }