protected void btnAssign_Click(object sender, EventArgs e)
 {
     if (DgvTempDepteHeadSearchDetails.Behaviors.Selection.SelectedRows.Count > 0)
             {
                 DataTable dt = Util.GetCurrentTemporaryHead();
                 if (dt!= null && dt.Rows.Count > 0)
             {
                 lblStatusMessage.Text = "Please remove current head first.";
                 return;
             }
             //DataRow[] dr = dt.Select(" RepresentativeName = '" + DgvTempDepteHeadSearchDetails.Behaviors.Selection.SelectedRows[0].Items[1].ToString() + "'");
             //if (dr.Length > 0)
             //{
             //    lblStatusMessage.Text = "Selected employee is already a representative";
             //    return;
             //}
                 foreach (GridRecord select in DgvTempDepteHeadSearchDetails.Behaviors.Selection.SelectedRows)
                     assign_employeeID = select.Items.GetValue(0).ToString();
             atdrCtrl = GetControl();
             atdrCtrl.SelectAssign(Convert.ToInt16(assign_employeeID));
             DgvTempDepteHeadSearchDetails.ClearDataSource();
             FillHeadList();
             drdHeadEmployeeList.ClearSelection();
     }
     else
         lblStatusMessage.Text = "Please select the employee to assign.";
 }
 private AssignTemporaryDepartmentHeadControl GetControl()
 {
     if (atdrCtrl == null)
         atdrCtrl = new AssignTemporaryDepartmentHeadControl();
     return atdrCtrl;
 }
 /// <summary>
 /// Fills selected changed employee to datagrid
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void drdHeadEmployeeList_SelectionChanged(object sender,
     Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs e)
 {
     try
     {
         String selectedEmployee = drdHeadEmployeeList.SelectedItem.Text;
         atdrCtrl = GetControl();
         DataTable dt = atdrCtrl.SelectEmployeeName(selectedEmployee);
         DgvTempDepteHeadSearchDetails.DataSource = dt;
         DgvTempDepteHeadSearchDetails.DataBind();
     }
     catch(Exception ex)
     {
         Logger.WriteErrorLog(ex);
     }
 }
 /// <summary>
 /// Loads the AssignTempDeptHead form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         FillEmployee();
         StationeryStoreInventorySystemController.Util.PutSession(sessionKey, atdrCtrl);
     }
     else
     {
         atdrCtrl = (AssignTemporaryDepartmentHeadControl)StationeryStoreInventorySystemController.Util.GetSession(sessionKey);
     }
     FillHeadList();
 }
 protected void btnRemove_Click(object sender, EventArgs e)
 {
     if (DgvCurrentAuthorizedPerson.Behaviors.Selection.SelectedRows.Count > 0)
     {
         foreach (GridRecord selectedRow in DgvCurrentAuthorizedPerson.Behaviors.Selection.SelectedRows)
             remove_employeeID = selectedRow.Items.GetValue(0).ToString();
         atdrCtrl = GetControl();
         atdrCtrl.SelectRemove(Convert.ToInt16(remove_employeeID));
         FillHeadList();
     }
     else
         lblStatusMessage.Text = "Please select employee to remove.";
 }