Пример #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            SeriesBiz  pBiz = new SeriesBiz();
            lwg_Series p;

            if (string.IsNullOrEmpty(hdfID.Value))
            {
                p            = new lwg_Series();
                lblNote.Text = "Insert error, please try again";
            }
            else
            {
                p            = pBiz.GetByID(int.Parse(hdfID.Value));
                lblNote.Text = "Update error, please try again";
            }
            if (p != null)
            {
                p.Name = txtName.Text;
                if (pBiz.SaveSeries(p))
                {
                    rptSeries.DataSource = pBiz.GetListSeries();
                    rptSeries.DataBind();
                    txtName.Text         = string.Empty;
                    pnEditSeries.Visible = false;
                    pnListSeries.Visible = true;
                    return;
                }
            }
            lblNote.Visible = true;
        }