Ejemplo n.º 1
0
 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.";
     }
 }
Ejemplo n.º 2
0
 /// <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);
     }
 }
Ejemplo n.º 3
0
        //protected void DgvTempDepteHeadSearchDetails_RowSelectionChanged(object sender,
        //    Infragistics.Web.UI.GridControls.SelectedRowEventArgs e)
        //{
        //    assign_employeeID = e.CurrentSelectedRows[0].Attributes["EmployeeID"];
        //}

        //protected void DgvCurrentAuthorizedPerson_RowSelectionChanged(object sender,
        //    Infragistics.Web.UI.GridControls.SelectedRowEventArgs e)
        //{
        //    remove_employeeID = e.CurrentSelectedRows[0].Attributes["EmployeeID"];
        //}

        protected void btnEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                if (Convert.ToString(drdHeadEmployeeList.SelectedValue) != "")
                {
                    DgvTempDepteHeadSearchDetails.DataSource = Util.GetEmployeeDetails(drdHeadEmployeeList.CurrentValue);
                    DgvTempDepteHeadSearchDetails.DataBind();
                }
                else
                {
                    lblStatusMessage.Text = "Choose one employee to assign.";
                }
            }
            catch (Exception ex)
            {
                //print something
            }
        }