private void LeaveDesignationWiseConfiguration_GetAll() { Business.LeaveManagement.LeaveDesignationWiseConfiguration objLeaveDesignationWiseConfiguration = new Business.LeaveManagement.LeaveDesignationWiseConfiguration(); Entity.LeaveManagement.LeaveDesignationWiseConfiguration leaveDesignationWiseConfiguration = new Entity.LeaveManagement.LeaveDesignationWiseConfiguration(); DataTable dt = objLeaveDesignationWiseConfiguration.LeaveDesignationConfig_GetAll(leaveDesignationWiseConfiguration); gvLeaveDesignationConfiguration.DataSource = dt; gvLeaveDesignationConfiguration.DataBind(); }
private bool LeaveDesignationConfigValidate() { bool retValue = true; try { if (ddlLeaveType.SelectedIndex == 0) { Message.IsSuccess = false; Message.Text = "Please select Leave Type."; Message.Show = true; return(false); } if (ddlDesignation.SelectedIndex == 0) { Message.IsSuccess = false; Message.Text = "Please select Designation."; Message.Show = true; return(false); } if (string.IsNullOrEmpty(txtLeaveCount.Text.Trim())) { Message.IsSuccess = false; Message.Text = "Please enter Leave Total."; Message.Show = true; return(false); } if (string.IsNullOrEmpty(txtCarryForwardCount.Text.Trim())) { Message.IsSuccess = false; Message.Text = "Please enter Carry Forward Amount."; Message.Show = true; return(false); } if (string.IsNullOrEmpty(txtMinApplyDays.Text.Trim())) { Message.IsSuccess = false; Message.Text = "Please enter Min Apply Days."; Message.Show = true; return(false); } if (string.IsNullOrEmpty(txtMaxApplyDays.Text.Trim())) { Message.IsSuccess = false; Message.Text = "Please enter Max Apply Days."; Message.Show = true; return(false); } Business.LeaveManagement.LeaveDesignationWiseConfiguration objLeaveDesignationWiseConfiguration = new Business.LeaveManagement.LeaveDesignationWiseConfiguration(); Entity.LeaveManagement.LeaveDesignationWiseConfiguration leaveDesignationWiseConfiguration = new Entity.LeaveManagement.LeaveDesignationWiseConfiguration(); leaveDesignationWiseConfiguration.LeaveTypeId = Convert.ToInt32(ddlLeaveType.SelectedValue); leaveDesignationWiseConfiguration.DesignationId = Convert.ToInt32(ddlDesignation.SelectedValue); DataTable dt = objLeaveDesignationWiseConfiguration.LeaveDesignationConfig_GetAll(leaveDesignationWiseConfiguration); if (LeaveDesignationWiseConfigurationId == 0) { if (dt != null && dt.AsEnumerable().Any()) { Message.IsSuccess = false; Message.Text = "Designation configuration already exists."; Message.Show = true; return(false); } } else { if (dt == null || !dt.AsEnumerable().Any()) { Message.IsSuccess = false; Message.Text = "Designation configuration does not exists."; Message.Show = true; return(false); } } } catch (Exception ex) { ex.WriteException(); Message.IsSuccess = false; Message.Text = ex.Message; Message.Show = true; } return(retValue); }