Exemple #1
0
        public static int LeaveType_Save(Entity.LeaveManagement.LeaveType objLeaveType)
        {
            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_LeaveType_Save";
                    cmd.Parameters.AddWithValue("@LeaveTypeId", objLeaveType.LeaveTypeId);
                    cmd.Parameters.AddWithValue("@LeaveTypeName", objLeaveType.LeaveTypeName);
                    cmd.Parameters.AddWithValue("@LeaveTypeDescription", objLeaveType.LeaveTypeDescription);

                    if (con.State == ConnectionState.Closed)
                    {
                        con.Open();
                    }
                    retValue = cmd.ExecuteNonQuery();
                    con.Close();
                }
            }
            return(retValue);
        }
 public int LeaveTypeDelete(Entity.LeaveManagement.LeaveType objLeaveType)
 {
     return(DataAccess.LeaveManagement.LeaveType.LeaveType_Delete(objLeaveType));
 }
 public DataTable LeaveTypeGetAll(Entity.LeaveManagement.LeaveType objLeaveType)
 {
     return(DataAccess.LeaveManagement.LeaveType.LeaveType_GetAll());
 }