Beispiel #1
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            Repeater list = (Repeater)LoggingList1.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.Log.Domain.Logging domainLogging = new ZhuJi.Log.Domain.Logging();

                domainLogging.Id = int.Parse(id);

                ZhuJi.Log.IDAL.ILogging logging = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Log.NHibernateDAL.Logging)) as ZhuJi.Log.IDAL.ILogging;
                logging.Delete(domainLogging);

                Response.Redirect(Request.Url.ToString(), true);
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 初始化查询列表
 /// </summary>
 public void List()
 {
     try
     {
         ZhuJi.Log.IDAL.ILogging logging = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Log.NHibernateDAL.Logging)) as ZhuJi.Log.IDAL.ILogging;
         rptList.DataSource = logging.GetObjects(base.Where, base.OrderNo, base.PageNo, base.PageSize);
         rptList.DataBind();
         if (base.IsShowPager)
         {
             simplePager.Visible     = true;
             simplePager.CurrentPage = base.PageNo;
             simplePager.PageSize    = base.PageSize;
             simplePager.PageUrl     = Request.Url.ToString();
             simplePager.RecordCount = logging.GetRowCount;
             simplePager.DataBind();
         }
     }
     catch (Exception ex)
     {
         ShowMessage(ex);
     }
 }