Beispiel #1
0
        public List <ClusterAssignmentDto> ClusterGetByEmpID(int ID)
        {
            SqlConnection con = new SqlConnection(DBConstants.MFIS_CS);
            List <ClusterAssignmentDto> listcluster = new List <ClusterAssignmentDto>();
            SqlCommand cmd = new SqlCommand("uspClusterDetailsgetbyEmpid", con);

            cmd.Parameters.AddWithValue("@EmpID", ID);
            cmd.CommandType = CommandType.StoredProcedure;
            con.Open();
            SqlDataReader        dr         = cmd.ExecuteReader();
            ClusterAssignmentDto clusterdto = null;

            while (dr.Read())
            {
                clusterdto           = new ClusterAssignmentDto();
                clusterdto.ClusterID = Convert.ToInt32(dr["ClusterID"]);
                listcluster.Add(clusterdto);
            }
            return(listcluster);
        }
Beispiel #2
0
        public List <ClusterAssignmentDto> GetAllClusterAssignments()
        {
            SqlConnection con = new SqlConnection(DBConstants.MFIS_CS);
            List <ClusterAssignmentDto> lstClusterAssignments = new List <ClusterAssignmentDto>();
            SqlCommand cmd = new SqlCommand("uspAssignClustertoEmployeedetails", con);

            cmd.CommandType = CommandType.StoredProcedure;
            con.Open();
            SqlDataReader        dr         = cmd.ExecuteReader();
            ClusterAssignmentDto clusterdto = null;

            while (dr.Read())
            {
                clusterdto              = new ClusterAssignmentDto();
                clusterdto.ClusterID    = Convert.ToInt32(dr["EMPid"]);
                clusterdto.ClusterName  = Convert.ToString(dr["ClusterName"]);
                clusterdto.EmployeeName = Convert.ToString(dr["EmployeeName"]);
                clusterdto.RoleName     = Convert.ToString(dr["RoleName"]);

                lstClusterAssignments.Add(clusterdto);
            }
            return(lstClusterAssignments);
        }