예제 #1
0
        public managerModel getManagerName(int manager_id)
        {
            managerModel manager = new managerModel();

            try
            {
                com.CommandText = "exec getGymsOfManager @manager_id";
                com.Parameters.Clear();
                com.Parameters.Add("@manager_id", SqlDbType.Int, 4).Value = manager_id;


                com.Connection.Open();
                SqlDataReader reader = com.ExecuteReader();
                while (reader.Read())
                {
                    manager.Name   = reader[5].ToString();
                    manager.Family = reader[6].ToString();
                }
            }
            finally
            {
                com.Connection.Close();
            }

            return(manager);
        }
예제 #2
0
        private void main_Load(object sender, EventArgs e)
        {
            line.Width = lbltab1.Width;
            line.Left  = lbltab1.Left;
            managerModel m = Managment.getInstance().getManagerName(id);

            lblname.Text   = m.Name;
            lblfamily.Text = m.Family;
        }