//회원 수정 public Boolean update(MemberVO mv) { Boolean result = false; try { scon = new SqlConnection(connectionString); scom = new SqlCommand(); scom.Connection = scon; scom.CommandType = CommandType.StoredProcedure; scom.CommandText = "dbo.MemberUpdate"; //파라미터 추가 //scom.Parameters.AddWithValue("@groupid",1); scom.Parameters.AddWithValue("@MemberID", mv.MemberID); scom.Parameters.AddWithValue("@MemberPWD", mv.MemberPWD); scom.Parameters.AddWithValue("@MemberName", mv.MemberName); scom.Parameters.AddWithValue("@Email", mv.Email); scom.Parameters.AddWithValue("@Telephone", mv.Telephone); scon.Open(); scom.ExecuteNonQuery(); result = true; } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } finally { if (scon != null) { scon.Close(); } } return(result); }
//마이페이지 초기데이터 public MemberVO select(string MemberID) { MemberVO mv = new MemberVO(); try { scon = new SqlConnection(connectionString); sda = new SqlDataAdapter(); scom = new SqlCommand("dbo.MemberSelect", scon); scom.Parameters.Add(new SqlParameter("@MemberID", MemberID)); scom.CommandType = CommandType.StoredProcedure; sda.SelectCommand = scom; scon.Open(); DataSet ds = new DataSet(); sda.Fill(ds); mv.MemberID = ds.Tables[0].Rows[0][0].ToString(); mv.MemberPWD = ds.Tables[0].Rows[0][1].ToString(); mv.MemberName = ds.Tables[0].Rows[0][2].ToString(); mv.Email = ds.Tables[0].Rows[0][3].ToString(); mv.Telephone = ds.Tables[0].Rows[0][4].ToString(); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } finally { if (scon != null) { scon.Close(); } } return(mv); }