private void DisplayData() { ICommunityRepository repo = new CommnityRepository(); this.grdCommunityList.DataSource = repo.GetCommunities(); this.grdCommunityList.DataBind(); }
protected void btnAdd_Click(object sender, EventArgs e) { //커뮤니티 개체 가져오기 var community = new CommunityModel(); // Prouctivity Power Tools 2017 설치 후 Ctrl + Alt + ] community.CommunityName = txtCommunityName.Value; community.CommunityDescription = txtCommunityDescription.Value; community.MeaderHtnl = txtMeaderHtnl.Value; community.FooterHtnl = txtFooterHtnl.Value; //저장소 클래스 가져오기 var addRepo = new CommnityRepository(); community = addRepo.Add(community); lblDisplay.Text = String.Format("{0}번 글이 저장되었습니다.", community.CommunityId); }