private void getLeaveTypes() { try { string OCODE = ((SessionUser)Session["SessionUser"]).OCode; List <HRM_LEAVE_TYPE> leaveTypes = leaveBll.GetAllLeaveType(OCODE); if (leaveTypes.Count > 0) { RLeaveTypes.DataSource = leaveTypes; RLeaveTypes.DataBind(); drpLeaveType.DataSource = leaveTypes; drpLeaveType.DataTextField = "LEV_TYPE"; drpLeaveType.DataValueField = "LEV_ID"; drpLeaveType.DataBind(); drpLeaveType.Items.Insert(0, new ListItem("--Select--")); } } catch (Exception) { throw; } }
private void getLeaveTypes() { try { string OCODE = ((SessionUser)Session["SessionUser"]).OCode; List <HRM_LEAVE_TYPE> leaveTypes = leaveBll.GetAllLeaveType(OCODE); if (leaveTypes.Count > 0) { RLeaveTypes.DataSource = leaveTypes; RLeaveTypes.DataBind(); drpLeaveType.DataSource = leaveTypes; drpLeaveType.DataTextField = "LEV_TYPE"; drpLeaveType.DataValueField = "LEV_ID"; drpLeaveType.DataBind(); drpLeaveType.Items.Insert(0, new ListItem("--Select--")); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }