public List<Designation> GetAllDesignations()
        {
            try
            {

                List<Designation> designation = new List<Designation>();
                connection.Open();
                string designationQuery = "select * from t_Designation";
                command.CommandText = designationQuery;
                SqlDataReader designationReader = command.ExecuteReader();
                while (designationReader.Read())
                {
                    Designation aDesignation = new Designation();
                    aDesignation.Id = Convert.ToInt16(designationReader[0].ToString());
                    aDesignation.DesignationName = designationReader[1].ToString();
                    designation.Add(aDesignation);
                    //designation.Add(designationReader[0].ToString());

                }

                return designation;
            }
            finally
            {
                connection.Close();
            }
        }
        public Designation GetDesignation(int id)
        {
            Designation aDesignation = new Designation();
            List<Designation> designations = GetAllDesignations();
            foreach (Designation designation in designations)
            {
                if (designation.Id == id)
                {
                    aDesignation.Id = designation.Id;
                    aDesignation.DesignationName = designation.DesignationName;

                }

            }
            return aDesignation;
        }