Пример #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            myRemax = new projectRemaxDBEntities1();
            var employeeInfo = from emp in myRemax.Employees
                               select emp;

            var propInfo = from prop in myRemax.Properties
                           select prop;

            if (chkAgent.Checked && chkProperty.Checked == false)
            {
                employeeInfo = from emp in myRemax.Employees
                               where emp.RefEmployee.ToString() == cboAgents.Text
                               select emp;

                gridResults.DataSource = employeeInfo.ToList();
            }
            else if (chkProperty.Checked && chkAgent.Checked == false)
            {
                propInfo = from prop in myRemax.Properties
                           where prop.RefProperty.ToString() == cboProperties.Text
                           select prop;

                gridResults.DataSource = propInfo.ToList();
            }
            else
            {
            }
        }
Пример #2
0
        private void frmAdmin_Load(object sender, EventArgs e)
        {
            myRemax = new projectRemaxDBEntities1();

            var empInfo = from emp in myRemax.Employees
                          select emp.RefEmployee;

            var clientInfo = from cli in myRemax.Clients
                             select cli.RefClient;

            var propertyInfo = from prop in myRemax.Properties
                               select prop.RefProperty;

            cboEmployee.DisplayMember = "RefEmployee";
            cboEmployee.ValueMember   = "RefEmployee";
            cboEmployee.DataSource    = empInfo.ToList();

            cboClients.DisplayMember = "RefClient";
            cboClients.ValueMember   = "RefClient";
            cboClients.DataSource    = clientInfo.ToList();

            cboProperty.DisplayMember = "RefProperty";
            cboProperty.ValueMember   = "RefProperty";
            cboProperty.DataSource    = propertyInfo.ToList();

            tabEmployees  = clsGlobal.mySet.Tables["Employees"];
            tabClients    = clsGlobal.mySet.Tables["Clients"];
            tabProperties = clsGlobal.mySet.Tables["Properties"];
        }
Пример #3
0
        private void frmClient_Load(object sender, EventArgs e)
        {
            myRemax = new projectRemaxDBEntities1();

            var employeeInfo = from emp in myRemax.Employees
                               select emp.RefEmployee;

            cboAgents.DisplayMember = "FirstName";
            cboAgents.ValueMember   = "RefEmployee";
            cboAgents.DataSource    = employeeInfo.ToList();

            var propertyInfo = from prop in myRemax.Properties
                               select prop.RefEmployee;

            cboProperties.DisplayMember = "Type";
            cboProperties.ValueMember   = "RefProperty";
            cboProperties.DataSource    = propertyInfo.ToList();
        }
Пример #4
0
        private void cboProperty_SelectedIndexChanged(object sender, EventArgs e)
        {
            Property propFound = myRemax.Properties.Find(cboProperty.SelectedValue);

            if (propFound != null)
            {
                txtPropertyAgent.Text    = propFound.RefEmployee.ToString();
                txtPropertyLocation.Text = propFound.Location;
                txtPropertyType.Text     = propFound.Type;
                txtPropertyPrice.Text    = propFound.Price.ToString();
                txtPropertySize.Text     = propFound.Size;
            }

            myRemax = new projectRemaxDBEntities1();

            var propInfo = from property in myRemax.Properties
                           where property.RefProperty.ToString() == cboProperty.SelectedValue.ToString()
                           select property;

            gridResult.DataSource = propInfo.ToList();
        }
Пример #5
0
        private void cboClients_SelectedIndexChanged(object sender, EventArgs e)
        {
            Client cliFound = myRemax.Clients.Find(cboClients.SelectedValue);

            if (cliFound != null)
            {
                txtFirstClient.Text    = cliFound.FirstName;
                txtLastClient.Text     = cliFound.LastName;
                txtClientsAgent.Text   = cliFound.RefEmployee.ToString();
                txtType.Text           = cliFound.Type;
                txtPropertyClient.Text = cliFound.RefProperty.ToString();
            }

            myRemax = new projectRemaxDBEntities1();

            var clientInfo = from client in myRemax.Clients
                             where client.RefClient.ToString() == cboClients.SelectedValue.ToString()
                             select client;

            gridResult.DataSource = clientInfo.ToList();
        }