protected void btnAssign_Click(object sender, EventArgs e) { if (DgvTempDeptRepSearchDetails.Behaviors.Selection.SelectedRows.Count > 0) { DataTable dt = Util.GetCurrentTemporaryRepresentative(); if (dt != null && dt.Rows.Count > 0) { lblStatusMessage.Text = "Please remove current representative first."; return; } //DataRow[] dr = dt.Select(" RepresentativeName = '" + DgvTempDeptRepSearchDetails.Behaviors.Selection.SelectedRows[0].Items[1].ToString() + "'"); //if (dr.Length > 0) //{ // lblStatusMessage.Text = "Selected employee is already a representative"; // return; //} foreach (GridRecord selected in DgvTempDeptRepSearchDetails.Behaviors.Selection.SelectedRows) { assign_employeeID = selected.Items.GetValue(0).ToString(); } atdrCtrl = GetControl(); atdrCtrl.SelectAssign(Convert.ToInt16(assign_employeeID)); DgvTempDeptRepSearchDetails.ClearDataSource(); FillCurrentRepresentativeList(); drdEmployeeList.ClearSelection(); } else { lblStatusMessage.Text = "Please select the employee to assign."; } }
/// <summary> /// Fills selected changed employee to datagrid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void drdEmployeeList_SelectionChanged(object sender, Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs e) { try { String selectedEmployee = drdEmployeeList.SelectedItem.Text; atdrCtrl = GetControl(); DataTable dt = atdrCtrl.SelectEmployeeName(selectedEmployee); DgvTempDeptRepSearchDetails.DataSource = dt; DgvTempDeptRepSearchDetails.DataBind(); } catch (Exception ex) { Logger.WriteErrorLog(ex); } }
protected void btnEmployee_Click(object sender, EventArgs e) { try { if (Convert.ToString(drdEmployeeList.SelectedValue) != "") { DgvTempDeptRepSearchDetails.DataSource = Util.GetEmployeeDetails(drdEmployeeList.CurrentValue); DgvTempDeptRepSearchDetails.DataBind(); } else { lblStatusMessage.Text = "Choose one employee to assign."; } } catch (Exception ex) { //print something } }