Exemplo n.º 1
0
        protected void rptSeries_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            SeriesBiz  pBiz = new SeriesBiz();
            lwg_Series p    = pBiz.GetByID(int.Parse(e.CommandArgument.ToString()));

            if (e.CommandName.Equals("EDIT"))
            {
                if (p != null)
                {
                    btnAdd.Text          = "Update";
                    txtTitle.Text        = "Update Series";
                    hdfID.Value          = e.CommandArgument.ToString();
                    pnEditSeries.Visible = true;
                    pnListSeries.Visible = false;
                    txtName.Text         = p.Name;
                }
            }
            else if (e.CommandName.Equals("DELETE"))
            {
                if (p != null)
                {
                    if (pBiz.DeleteSeries(p))
                    {
                        BindingSeries();
                    }
                }
            }
        }