private void frmSales_Load(object sender, EventArgs e) { admin = new clsAdmin(); DataTable temp = new DataTable(); // fill cboHouse cboHouse.DisplayMember = "Address"; cboHouse.ValueMember = "RefHouse"; cboHouse.DataSource = admin.HouseListToDataTable(admin.Search_All_Houses()); // fill cboClient cboClient.DisplayMember = "ClientName"; cboClient.ValueMember = "RefClient"; cboClient.DataSource = admin.ClientListToDataTable(admin.All_Client()); // fill cboAgent cboAgent.DisplayMember = "AgentName"; cboAgent.ValueMember = "RefAgent"; cboAgent.DataSource = admin.AgentListToDataTable(admin.Search_All_Agents()); if (permission != 2) { gridAll.DataSource = admin.All_Sales(); } else { gridAll.DataSource = admin.Search_Sales_Belong_To_RefAgent(RefAgent); } gridAll.ReadOnly = true; ButtonControl(true, false, false, false, true, false); }