/// <summary>
 /// 初始化查询列表
 /// </summary>
 public void BindGrid()
 {
     try
     {
         ZhuJi.UUMS.IDAL.IResources resources = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.Resources)) as ZhuJi.UUMS.IDAL.IResources;
         gvList.DataSource = resources.GetObjects(base.Where, base.OrderNo);
         gvList.DataBind();
     }
     catch (Exception ex)
     {
         ShowMessage(ex);
     }
 }
        /// <summary>
        /// 初始化添加/编辑表单
        /// </summary>
        public void Initialize()
        {
            btnAdd.Visible  = false;
            btnEdit.Visible = false;
            btnDel.Visible  = false;

            try
            {
                ZhuJi.UUMS.IDAL.IResources          resources     = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.Resources)) as ZhuJi.UUMS.IDAL.IResources;
                IList <ZhuJi.UUMS.Domain.Resources> listResources = resources.GetObjects();
                foreach (ZhuJi.UUMS.Domain.Resources domainResources in listResources)
                {
                    ResourcesId.Items.Add(new ListItem(domainResources.ResourceName.ToString(), domainResources.Id.ToString()));
                }

                ZhuJi.UUMS.IDAL.IControlsType          controlsType     = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.ControlsType)) as ZhuJi.UUMS.IDAL.IControlsType;
                IList <ZhuJi.UUMS.Domain.ControlsType> listControlsType = controlsType.GetObjects();
                foreach (ZhuJi.UUMS.Domain.ControlsType domainControlsType in listControlsType)
                {
                    ControlType.Items.Add(new ListItem(domainControlsType.Text.ToString(), domainControlsType.Id.ToString()));
                }

                ZhuJi.UUMS.IDAL.IControlsAttribute          controlsAttribute     = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.ControlsAttribute)) as ZhuJi.UUMS.IDAL.IControlsAttribute;
                IList <ZhuJi.UUMS.Domain.ControlsAttribute> listControlsAttribute = controlsAttribute.GetObjects();
                foreach (ZhuJi.UUMS.Domain.ControlsAttribute domainControlsAttribute in listControlsAttribute)
                {
                    Attribute.Items.Add(new ListItem(domainControlsAttribute.Text.ToString(), domainControlsAttribute.Id.ToString()));
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }

            switch (_command)
            {
            case "ADD":
                Add();
                break;

            case "EDIT":
                Edit();
                break;
            }
        }
        protected void gvList_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                ZhuJi.UUMS.Domain.Resources domainResources = new ZhuJi.UUMS.Domain.Resources();

                domainResources.Id = int.Parse(gvList.Rows[e.RowIndex].Cells[0].Text);

                ZhuJi.UUMS.IDAL.IResources resources = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.Resources)) as ZhuJi.UUMS.IDAL.IResources;
                resources.Delete(domainResources);

                gvList.EditIndex = -1;
                BindGrid();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void gvList_RowInserting(object sender, EventArgs e)
        {
            try
            {
                ZhuJi.UUMS.Domain.Resources domainResources = new ZhuJi.UUMS.Domain.Resources();
                TextBox txtResourceName = (TextBox)gvList.FooterRow.FindControl("txtResourceName");
                TextBox txtOrderBy      = (TextBox)gvList.FooterRow.FindControl("txtOrderBy");

                domainResources.ResourceName = txtResourceName.Text.Trim();
                domainResources.OrderBy      = int.Parse(txtOrderBy.Text.Trim());

                ZhuJi.UUMS.IDAL.IResources resources = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.Resources)) as ZhuJi.UUMS.IDAL.IResources;
                resources.Insert(domainResources);

                gvList.EditIndex = -1;
                BindGrid();
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }
        }