//worry db에 추가하기 public int AddSuggest(ref CSuggest aSuggest) { Feb_suggest tmp_Suggest = new Feb_suggest(); tmp_Suggest.title = aSuggest.title; tmp_Suggest.content = aSuggest.content; tmp_Suggest.reg_date = aSuggest.reg_date; tmp_Suggest.writer = aSuggest.writer; theUserContext.Feb_suggest.InsertOnSubmit(tmp_Suggest); theUserContext.SubmitChanges(); return(1); } //Addsuggest
//worry db에 추가하기 public int AddWorry(ref CWorry aWorry) { Feb_Worry tmp_worry = new Feb_Worry(); tmp_worry.title = aWorry.title; tmp_worry.content = aWorry.content; tmp_worry.writer = aWorry.writer; tmp_worry.reg_date = DateTime.Now; tmp_worry.report_chk = 0; theUserContext.Feb_Worry.InsertOnSubmit(tmp_worry); theUserContext.SubmitChanges(); return(1); } //AddWorry
} //생성자 public int AddUser(ref CUser aUser) //근데 여기서 ref안써도 되지 않나? { string tmp_email = aUser.email; int tmpCount = theUserContext.Feb_member.Where(x => x.email == tmp_email).Count(); if (tmpCount > 0) { //같은 이메일 사용자가 있음 return(0); } Feb_member tmp_user = new Feb_member(); tmp_user.email = aUser.email; tmp_user.pw = aUser.pw; tmp_user.nickname = aUser.nickname; tmp_user.leave_chk = aUser.leave_chk ? 1 : 0; tmp_user.report_chk = aUser.report_chk ? 1 : 0; theUserContext.Feb_member.InsertOnSubmit(tmp_user); theUserContext.SubmitChanges(); return(1); } //AddUser