예제 #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Business.LeaveManagement.LeaveApprovalConfiguration objLeaveApprovalConfiguration = new Business.LeaveManagement.LeaveApprovalConfiguration();
                Entity.LeaveManagement.LeaveApprovalConfiguration   leaveApprovalConfiguration    = new Entity.LeaveManagement.LeaveApprovalConfiguration();

                leaveApprovalConfiguration.LeaveApprovalConfigurationId    = LeaveApprovalConfigurationId;
                leaveApprovalConfiguration.ApproverDesignationId           = Convert.ToInt32(ddlApproverDesignation.SelectedValue);
                leaveApprovalConfiguration.LeaveDesignationConfigurationId = Convert.ToInt32(ddlRequestorDesignation.SelectedValue);
                leaveApprovalConfiguration.ApprovalLevel = Convert.ToInt32(ddlApprovalLevel.SelectedValue);
                int response = objLeaveApprovalConfiguration.LeaveApprovalConfig_Save(leaveApprovalConfiguration);
                if (response > 0)
                {
                    Clear();
                    LeaveApprovalConfig_GetAll();
                    Message.IsSuccess = true;
                    Message.Text      = "Saved Successfully";
                }
                else
                {
                    Message.IsSuccess = false;
                    Message.Text      = "Exists";
                }
                Message.Show = true;
            }
            catch (Exception ex)
            {
                ex.WriteException();

                Message.IsSuccess = false;
                Message.Text      = ex.Message;
                Message.Show      = true;
            }
        }
 public static DataTable LeaveApprovalDetails_GetAll(Entity.LeaveManagement.LeaveApprovalConfiguration leaveApprovalConfiguration)
 {
     using (DataTable dt = new DataTable())
     {
         using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString()))
         {
             using (SqlCommand cmd = new SqlCommand())
             {
                 cmd.Connection  = con;
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.CommandText = "usp_HR_LeaveApprovalConfig_GetAll";
                 if (leaveApprovalConfiguration.LeaveApprovalConfigurationId == 0)
                 {
                     cmd.Parameters.AddWithValue("@LeaveApprovalConfigId", DBNull.Value);
                 }
                 else
                 {
                     cmd.Parameters.AddWithValue("@LeaveApprovalConfigId", leaveApprovalConfiguration.LeaveApprovalConfigurationId);
                 }
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(dt);
                 }
                 con.Close();
             }
         }
         return(dt);
     }
 }
예제 #3
0
        public static int LeaveEmployeeWiseApprovalConfiguration_Save(Entity.LeaveManagement.LeaveApprovalConfiguration leaveApprovalConfiguration)
        {
            int retValue = 0;

            using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = con;
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "usp_HR_LeaveEmployeeWiseApprovalConfiguration_Save";

                    cmd.Parameters.AddWithValue("@LeaveEmployeeWiseApprovalConfigId", leaveApprovalConfiguration.LeaveEmployeeWiseApprovalConfigurationId);
                    cmd.Parameters.AddWithValue("@EmployeeId", leaveApprovalConfiguration.EmployeeId);
                    cmd.Parameters.AddWithValue("@ApproverId", leaveApprovalConfiguration.ApproverId);
                    cmd.Parameters.AddWithValue("@ApproverLevel", leaveApprovalConfiguration.ApprovalLevel);
                    cmd.Parameters.AddWithValue("@CreatedBy", leaveApprovalConfiguration.CreatedBy);

                    if (con.State == ConnectionState.Closed)
                    {
                        con.Open();
                    }
                    retValue = cmd.ExecuteNonQuery();
                    con.Close();
                }
            }
            return(retValue);
        }
 public DataTable LeaveEmployeeWiseApprovalConfiguration_GetAll(Entity.LeaveManagement.LeaveApprovalConfiguration leaveApprovalConfiguration)
 {
     return(DataAccess.LeaveManagement.LeaveApprovalConfiguration.LeaveEmployeeWiseApprovalConfiguration_GetAll(leaveApprovalConfiguration));
 }
 public int LeaveEmployeeWiseApprovalConfiguration_Save(Entity.LeaveManagement.LeaveApprovalConfiguration leaveApprovalConfiguration)
 {
     return(DataAccess.LeaveManagement.LeaveApprovalConfiguration.LeaveEmployeeWiseApprovalConfiguration_Save(leaveApprovalConfiguration));
 }