Esempio n. 1
0
        private void DisplayData()
        {
            MaximServiceRepository repo = new MaximServiceRepository();

            this.lstMaxims.DataSource = repo.GetMaxims();
            this.lstMaxims.DataBind();
        }
Esempio n. 2
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Request.QueryString["Id"]);

            MaximServiceRepository repo = new MaximServiceRepository();

            repo.RemoveMaxim(id);

            //리스트 페이지로 이동
            Response.RedirectPermanent("FrmMaximList.aspx");
        }
Esempio n. 3
0
        private void DisplayData()
        {
            int id = Convert.ToInt32(Request.QueryString["Id"]);

            MaximServiceRepository repo = new MaximServiceRepository();
            Maxim maxim = repo.GetMaximById(id);

            this.lblId.Text      = id.ToString();
            this.txtName.Text    = maxim.Name;
            this.txtContent.Text = maxim.Content;
        }
Esempio n. 4
0
        protected void btnWrite_Click(object sender, EventArgs e)
        {
            Maxim maxim = new Maxim();

            maxim.Name    = txtName.Text;
            maxim.Content = txtContent.Text;

            MaximServiceRepository repo = new MaximServiceRepository();

            maxim.Id = repo.AddMaxim(maxim).Id;

            lblDisplay.Text = maxim.Id.ToString() + "번 데이터가 입력되었습니다.";
        }
        private void DisplayData()
        {
            int id = Convert.ToInt32(Request.QueryString["Id"]);

            MaximServiceRepository repo = new MaximServiceRepository();
            Maxim maxim = repo.GetMaximById(id);

            this.lblId.Text      = id.ToString();
            this.lblName.Text    = maxim.Name;
            this.lblContent.Text = maxim.Content;

            this.btnModify.NavigateUrl = "FrmMaximModify.aspx?Id=" + id;
            this.btnDelete.NavigateUrl = "FrmMaximDelete.aspx?Id=" + id;
        }
Esempio n. 6
0
        protected void btnModify_Click(object sender, EventArgs e)
        {
            Maxim maxim = new Maxim();

            //Id를 채워서 넘겨줌.
            maxim.Id      = Convert.ToInt32(Request.QueryString["Id"]);
            maxim.Name    = txtName.Text;
            maxim.Content = txtContent.Text;

            MaximServiceRepository repo = new MaximServiceRepository();

            maxim = repo.UpdateMaxim(maxim);

            lblDisplay.Text = maxim.Id.ToString() + "번 데이터가 수정되었습니다.";

            DisplayData();
        }
Esempio n. 7
0
 public MaximController(MaximServiceRepository maximService)
 {
     _repo = maximService;
 }