private void BindLeaveType()
 {
     try
     {
         LeaveBl           objLeaveBl  = new LeaveBl();
         ApplicationResult objResults  = new ApplicationResult();
         Controls          objControls = new Controls();
         for (int i = 0; i < gvLeave.Rows.Count; i++)
         {
             DropDownList ddlLeaveType = (DropDownList)gvLeave.Rows[i].Cells[3].FindControl("ddlLeaveType");
             objResults = objLeaveBl.Leave_SelectAll();
             if (objResults != null)
             {
                 if (objResults.resultDT.Rows.Count > 0)
                 {
                     objControls.BindDropDown_ListBox(objResults.resultDT, ddlLeaveType, "LeaveName", "LeaveID");
                 }
                 ddlLeaveType.Items.Insert(0, new ListItem("-Select-", ""));
             }
         }
     }
     catch (Exception ex)
     {
         logger.Error("Error", ex);
         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
     }
 }
Beispiel #2
0
        public void BindLeave()
        {
            ApplicationResult objResult  = new ApplicationResult();
            LeaveBl           objLeavebl = new LeaveBl();

            objResult = objLeavebl.Leave_SelectAll();
            if (objResult.resultDT.Rows.Count > 0)
            {
                gvLeave.DataSource = objResult.resultDT;
                gvLeave.DataBind();
                PanelVisibility(1);
            }
            else
            {
                PanelVisibility(2);
            }
        }