Exemplo n.º 1
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            Repeater list = (Repeater)ControlsList1.FindControl("rptList");
            string   id   = UIControlHelper.GetCheckBoxByRepeater(list, "chkId");

            if (id.Length == 0)
            {
                MessageHelper.ShowAndBack(Page, MessageHelper.GetMessage("NOCHECK"));
                return;
            }
            if (id.Split(',').Length > 1)
            {
                MessageHelper.ShowAndBack(Page, MessageHelper.GetMessage("MORECHECK"));
                return;
            }

            try
            {
                ZhuJi.UUMS.Domain.Controls domainControls = new ZhuJi.UUMS.Domain.Controls();

                domainControls.Id = int.Parse(id);

                ZhuJi.UUMS.IDAL.IControls controls = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.Controls)) as ZhuJi.UUMS.IDAL.IControls;
                controls.Delete(domainControls);

                Response.Redirect(Request.Url.ToString(), true);
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }
        }
Exemplo n.º 2
0
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            Repeater list = (Repeater)ControlsList1.FindControl("rptList");
            string   id   = UIControlHelper.GetCheckBoxByRepeater(list, "chkId");

            if (id.Length == 0)
            {
                MessageHelper.ShowAndBack(Page, MessageHelper.GetMessage("NOCHECK"));
                return;
            }
            if (id.Split(',').Length > 1)
            {
                MessageHelper.ShowAndBack(Page, MessageHelper.GetMessage("MORECHECK"));
                return;
            }
            Initialize();
            pnlEdit.Visible        = true;
            ControlsEdit1.Identity = int.Parse(id);
            ControlsEdit1.Command  = "EDIT";
            ControlsEdit1.Initialize();
        }